n2bot

module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2021 License: MIT

README

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL