# Go-NEB Configuration File # # This file provides an alternative way to configure Go-NEB which does not involve HTTP APIs. # # This file can be supplied to go-neb by the environment variable `CONFIG_FILE=config.yaml`. # It will force Go-NEB to operate in "config" mode. This means: # - Go-NEB will ONLY use the data contained inside this file. # - All of Go-NEB's /admin HTTP listeners will be disabled. You will be unable to add new services at runtime. # - The environment variable `DATABASE_URL` will be ignored and an in-memory database will be used instead. # # This file is broken down into 4 sections which matches the following HTTP APIs: # - /configureClient # - /configureAuthRealm # - /configureService # - /requestAuthSession (redirects not supported) # The list of clients which Go-NEB is aware of. # Delete or modify this list as appropriate. # See the docs for /configureClient for the full list of options: # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ClientConfig clients: - UserID: "@goneb:localhost" AccessToken: "MDASDASJDIASDJASDAFGFRGER" DeviceID: "DEVICE1" HomeserverURL: "http://localhost:8008" Sync: true AutoJoinRooms: true DisplayName: "Go-NEB!" AcceptVerificationFromUsers: [":localhost:8008"] - UserID: "@another_goneb:localhost" AccessToken: "MDASDASJDIASDJASDAFGFRGER" DeviceID: "DEVICE2" HomeserverURL: "http://localhost:8008" Sync: false AutoJoinRooms: false DisplayName: "Go-NEB!" AcceptVerificationFromUsers: ["^@admin:localhost:8008$"] # The list of realms which Go-NEB is aware of. # Delete or modify this list as appropriate. # See the docs for /configureAuthRealm for the full list of options: # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ConfigureAuthRealmRequest realms: - ID: "github_realm" Type: "github" Config: {} # No need for client ID or Secret as Go-NEB isn't generating OAuth URLs # The list of *authenticated* sessions which Go-NEB is aware of. # Delete or modify this list as appropriate. # The full list of options are shown below: there is no single HTTP endpoint # which maps to this section. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#Session sessions: - SessionID: "your_github_session" RealmID: "github_realm" UserID: "@YOUR_USER_ID:localhost" Config: # Populate these fields by generating a "Personal Access Token" on github.com AccessToken: "YOUR_GITHUB_ACCESS_TOKEN" Scopes: "admin:org_hook,admin:repo_hook,repo,user" # The list of services which Go-NEB is aware of. # Delete or modify this list as appropriate. # See the docs for /configureService for the full list of options: # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ConfigureServiceRequest services: - ID: "giphy_service" Type: "giphy" UserID: "@goneb:localhost" # requires a Syncing client Config: api_key: "qwg4672vsuyfsfe" use_downsized: false - ID: "guggy_service" Type: "guggy" UserID: "@goneb:localhost" # requires a Syncing client Config: api_key: "2356saaqfhgfe" - ID: "google_service" Type: "google" UserID: "@goneb:localhost" # requires a Syncing client Config: api_key: "AIzaSyA4FD39m9" cx: "AIASDFWSRRtrtr" - ID: "imgur_service" Type: "imgur" UserID: "@imgur:localhost" # requires a Syncing client Config: api_key: "AIzaSyA4FD39m9" - ID: "wikipedia_service" Type: "wikipedia" UserID: "@goneb:localhost" # requires a Syncing client Config: - ID: "rss_service" Type: "rssbot" UserID: "@another_goneb:localhost" Config: feeds: "http://lorem-rss.herokuapp.com/feed?unit=second&interval=60": rooms: ["!qmElAGdFYCHoCJuaNt:localhost"] must_include: author: - author1 description: - lorem - ipsum must_not_include: title: - Lorem - Ipsum - ID: "github_cmd_service" Type: "github" UserID: "@goneb:localhost" # requires a Syncing client Config: RealmID: "github_realm" # Make sure your BASE_URL can be accessed by Github! - ID: "github_webhook_service" Type: "github-webhook" UserID: "@another_goneb:localhost" Config: RealmID: "github_realm" ClientUserID: "@YOUR_USER_ID:localhost" # needs to be an authenticated user so Go-NEB can create webhooks. Rooms: "!someroom:id": Repos: "matrix-org/synapse": Events: ["push", "issues"] "matrix-org/dendron": Events: ["pull_request"] "!anotherroom:id": Repos: "matrix-org/synapse": Events: ["push", "issues"] "matrix-org/dendron": Events: ["pull_request"] - ID: "slackapi_service" Type: "slackapi" UserID: "@slackapi:localhost" Config: Hooks: "hook1": RoomID: "!someroom:id" MessageType: "m.text" # default is m.text - ID: "alertmanager_service" Type: "alertmanager" UserID: "@alertmanager:localhost" Config: # This is for information purposes only. It should point to Go-NEB path as follows: # `/services/hooks/` # Where in this case "service ID" is "alertmanager_service" # Make sure your BASE_URL can be accessed by the Alertmanager instance! webhook_url: "http://localhost/services/hooks/YWxlcnRtYW5hZ2VyX3NlcnZpY2U" # Each room will get the notification with the alert rendered with the given template rooms: "!someroomid:domain.tld": text_template: > {{range .Alerts -}} {{- $severity := index .Labels "severity" -}} {{- if eq .Status "firing" -}} {{- if eq $severity "critical" -}} [CRITICAL] {{- else if eq $severity "warning" -}} [WARNING] {{- else if eq $severity "info" -}} [INFO] {{- else -}} [{{ if $severity }}{{ $severity }}{{ else }}FIRING{{ end }}] {{- end -}} {{- else -}} [RESOLVED] {{- end }} {{ index .Labels "alertname" -}} {{- if index .Annotations "description" -}}: {{ index .Annotations "description" -}}{{- end }} {{ end -}} html_template: > {{range .Alerts -}} {{- $severity := index .Labels "severity" -}} {{- if eq .Status "firing" -}} {{- if eq $severity "critical" -}} [CRITICAL] {{- else if eq $severity "warning" -}} [WARNING] {{- else if eq $severity "info" -}} [INFO] {{- else -}} [{{ if $severity }}{{ $severity }}{{ else }}FIRING{{ end }}] {{- end -}} {{- else -}} [RESOLVED] {{- end }} {{ index .Labels "alertname" -}} {{- if index .Annotations "description" -}}: {{ index .Annotations "description" -}}{{- end -}} {{- if .GeneratorURL }} (source)
{{- end }} {{ end -}} msg_type: "m.text" # Must be either `m.text` or `m.notice`