Skip to content

Commit

Permalink
Rename example config and add comments to it
Browse files Browse the repository at this point in the history
  • Loading branch information
fleaz committed Jan 24, 2022
1 parent 5270fcd commit 65285b8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ builds:
archives:
- files:
- LICENSE
- cpthook.yml.example
- cpthook_example.yml

checksum:
name_template: "checksums.txt"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ This dictionary maps hostnames to IRC-channels.

## Build a new module
When you want to create a new module, e.g. for the service 'Foo', follow these steps to get started:
- Add a section 'foo' to `cpthook.yml.example`. Everything below `cpthook.foo` will be provided to your module.
- Add a section 'foo' to `cpthook_example.yml`. Everything below `cpthook.foo` will be provided to your module.
- Add a case to the `main.createModuleObject` function
- Create `foo.go` and `foo_test.go` files in the `input` folder
- Implement the `Module` interface according to `input/helper.go`
Expand Down
12 changes: 12 additions & 0 deletions cpthook.yml.example → cpthook_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ http:
listen: ":8086"

logging:
# Available values are: TRACE, DEBUG, INFO, WARN, ERROR, FATAL, PANIC
level: "INFO"

irc:
host: "irc.hackint.org"
port: 6697

# When enabled, CptHook will use NOTICE instead of PRIVMSG to post messages
use_notice: false

ssl:
enabled: true

# You actually only have to set this when your irc server uses a self-signed certificate
cafile: "/etc/ssl/certs/ca-certificates.crt"
client_cert:
certfile: "/home/bot/bot.cert"
Expand All @@ -21,9 +27,13 @@ irc:
password: "VerySecure!"

modules:
# The name of the entry is arbitrary and can be choosen by you
my-prom-endpoint:
# Required: The URL path where this module will listen
endpoint: "/prom"
# Required: The type of module you wan't to use. Check the README for available options
type: "prometheus"
# Rest of the options are module specific and are documented in the README
channel: "#prometheusChannel"
hostname_filter: "(\\w*)\\.company.com:\\d{4}"

Expand All @@ -44,6 +54,8 @@ modules:
default_channel: "#defaultChannel"

another-simple:
# By giving them different URL endpoints, you can load a module twice
# to route webhooks to different irc channels
endpoint: "/simple2"
type: "simple"
default_channel: "#defaultChannel"
Expand Down

0 comments on commit 65285b8

Please sign in to comment.