Skip to content
This repository has been archived by the owner on Aug 6, 2021. It is now read-only.

txn2/n2bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

n2bot

n2bot receives POSTed JSON messages, transforms them through templates, and relays them to an IRC channel based on configuration rules.

Example Configuration:

replacements:
  - pattern: user1
    replacement: cjimti
rules:
  - name: Gitlab Merge Request
    producer: Gitlab
    contentRule:
      key: object_kind
      equals: merge_request
    description: Gitlab merge request.
    template: "{{ .object_attributes.assignee.username }}, \x0304MERGE REQUEST\x03 #{{ .object_attributes.id }} is \x0313{{ .object_attributes.state }}\x03 for \x0307{{ .project.name }}\x03 {{ .project.web_url }} cc {{ .user.username }}"

Development

Run from source:

DEBUG=true CONFIG=example.yml go run ./n2bot.go

Build container:

docker build --build-arg version=1.1.0 -t txn2/n2bot:1.1.0 .
docker push txn2/n2bot:1.1.0

Run container:

docker run -p 8080:8080 -e IP=0.0.0.0 -v $(pwd)/example.yml:/example.yml txn2/n2bot:1.1.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published