You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

193 lines
7.5 KiB

  1. # Go-NEB Configuration File
  2. #
  3. # This file provides an alternative way to configure Go-NEB which does not involve HTTP APIs.
  4. #
  5. # This file can be supplied to go-neb by the environment variable `CONFIG_FILE=config.yaml`.
  6. # It will force Go-NEB to operate in "config" mode. This means:
  7. # - Go-NEB will ONLY use the data contained inside this file.
  8. # - All of Go-NEB's /admin HTTP listeners will be disabled. You will be unable to add new services at runtime.
  9. # - The environment variable `DATABASE_URL` will be ignored and an in-memory database will be used instead.
  10. #
  11. # This file is broken down into 4 sections which matches the following HTTP APIs:
  12. # - /configureClient
  13. # - /configureAuthRealm
  14. # - /configureService
  15. # - /requestAuthSession (redirects not supported)
  16. # The list of clients which Go-NEB is aware of.
  17. # Delete or modify this list as appropriate.
  18. # See the docs for /configureClient for the full list of options:
  19. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ClientConfig
  20. clients:
  21. - UserID: "@goneb:localhost"
  22. AccessToken: "MDASDASJDIASDJASDAFGFRGER"
  23. DeviceID: "DEVICE1"
  24. HomeserverURL: "http://localhost:8008"
  25. Sync: true
  26. AutoJoinRooms: true
  27. DisplayName: "Go-NEB!"
  28. AcceptVerificationFromUsers: [":localhost:8008"]
  29. - UserID: "@another_goneb:localhost"
  30. AccessToken: "MDASDASJDIASDJASDAFGFRGER"
  31. DeviceID: "DEVICE2"
  32. HomeserverURL: "http://localhost:8008"
  33. Sync: false
  34. AutoJoinRooms: false
  35. DisplayName: "Go-NEB!"
  36. AcceptVerificationFromUsers: ["^@admin:localhost:8008$"]
  37. # The list of realms which Go-NEB is aware of.
  38. # Delete or modify this list as appropriate.
  39. # See the docs for /configureAuthRealm for the full list of options:
  40. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ConfigureAuthRealmRequest
  41. realms:
  42. - ID: "github_realm"
  43. Type: "github"
  44. Config: {} # No need for client ID or Secret as Go-NEB isn't generating OAuth URLs
  45. # The list of *authenticated* sessions which Go-NEB is aware of.
  46. # Delete or modify this list as appropriate.
  47. # The full list of options are shown below: there is no single HTTP endpoint
  48. # which maps to this section.
  49. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#Session
  50. sessions:
  51. - SessionID: "your_github_session"
  52. RealmID: "github_realm"
  53. UserID: "@YOUR_USER_ID:localhost"
  54. Config:
  55. # Populate these fields by generating a "Personal Access Token" on github.com
  56. AccessToken: "YOUR_GITHUB_ACCESS_TOKEN"
  57. Scopes: "admin:org_hook,admin:repo_hook,repo,user"
  58. # The list of services which Go-NEB is aware of.
  59. # Delete or modify this list as appropriate.
  60. # See the docs for /configureService for the full list of options:
  61. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ConfigureServiceRequest
  62. services:
  63. - ID: "giphy_service"
  64. Type: "giphy"
  65. UserID: "@goneb:localhost" # requires a Syncing client
  66. Config:
  67. api_key: "qwg4672vsuyfsfe"
  68. use_downsized: false
  69. - ID: "guggy_service"
  70. Type: "guggy"
  71. UserID: "@goneb:localhost" # requires a Syncing client
  72. Config:
  73. api_key: "2356saaqfhgfe"
  74. - ID: "google_service"
  75. Type: "google"
  76. UserID: "@goneb:localhost" # requires a Syncing client
  77. Config:
  78. api_key: "AIzaSyA4FD39m9"
  79. cx: "AIASDFWSRRtrtr"
  80. - ID: "imgur_service"
  81. Type: "imgur"
  82. UserID: "@imgur:localhost" # requires a Syncing client
  83. Config:
  84. api_key: "AIzaSyA4FD39m9"
  85. - ID: "wikipedia_service"
  86. Type: "wikipedia"
  87. UserID: "@goneb:localhost" # requires a Syncing client
  88. Config:
  89. - ID: "rss_service"
  90. Type: "rssbot"
  91. UserID: "@another_goneb:localhost"
  92. Config:
  93. feeds:
  94. "http://lorem-rss.herokuapp.com/feed?unit=second&interval=60":
  95. rooms: ["!qmElAGdFYCHoCJuaNt:localhost"]
  96. must_include:
  97. author:
  98. - author1
  99. description:
  100. - lorem
  101. - ipsum
  102. must_not_include:
  103. title:
  104. - Lorem
  105. - Ipsum
  106. - ID: "github_cmd_service"
  107. Type: "github"
  108. UserID: "@goneb:localhost" # requires a Syncing client
  109. Config:
  110. RealmID: "github_realm"
  111. # Make sure your BASE_URL can be accessed by Github!
  112. - ID: "github_webhook_service"
  113. Type: "github-webhook"
  114. UserID: "@another_goneb:localhost"
  115. Config:
  116. RealmID: "github_realm"
  117. ClientUserID: "@YOUR_USER_ID:localhost" # needs to be an authenticated user so Go-NEB can create webhooks.
  118. Rooms:
  119. "!someroom:id":
  120. Repos:
  121. "matrix-org/synapse":
  122. Events: ["push", "issues"]
  123. "matrix-org/dendron":
  124. Events: ["pull_request"]
  125. "!anotherroom:id":
  126. Repos:
  127. "matrix-org/synapse":
  128. Events: ["push", "issues"]
  129. "matrix-org/dendron":
  130. Events: ["pull_request"]
  131. - ID: "slackapi_service"
  132. Type: "slackapi"
  133. UserID: "@slackapi:localhost"
  134. Config:
  135. Hooks:
  136. "hook1":
  137. RoomID: "!someroom:id"
  138. MessageType: "m.text" # default is m.text
  139. - ID: "alertmanager_service"
  140. Type: "alertmanager"
  141. UserID: "@alertmanager:localhost"
  142. Config:
  143. # This is for information purposes only. It should point to Go-NEB path as follows:
  144. # `/services/hooks/<base64 encoded service ID>`
  145. # Where in this case "service ID" is "alertmanager_service"
  146. # Make sure your BASE_URL can be accessed by the Alertmanager instance!
  147. webhook_url: "http://localhost/services/hooks/YWxlcnRtYW5hZ2VyX3NlcnZpY2U"
  148. # Each room will get the notification with the alert rendered with the given template
  149. rooms:
  150. "!someroomid:domain.tld":
  151. text_template: >
  152. {{range .Alerts -}}
  153. {{- $severity := index .Labels "severity" -}}
  154. {{- if eq .Status "firing" -}}
  155. {{- if eq $severity "critical" -}} [CRITICAL]
  156. {{- else if eq $severity "warning" -}} [WARNING]
  157. {{- else if eq $severity "info" -}} [INFO]
  158. {{- else -}} [{{ if $severity }}{{ $severity }}{{ else }}FIRING{{ end }}]
  159. {{- end -}}
  160. {{- else -}} [RESOLVED]
  161. {{- end }} {{ index .Labels "alertname" -}}
  162. {{- if index .Annotations "description" -}}: {{ index .Annotations "description" -}}{{- end }}
  163. {{ end -}}
  164. html_template: >
  165. {{range .Alerts -}}
  166. {{- $severity := index .Labels "severity" -}}
  167. {{- if eq .Status "firing" -}}
  168. {{- if eq $severity "critical" -}} <font data-mx-color="#ffffff" data-mx-bg-color="#ff0000"><b>[CRITICAL]</b></font>
  169. {{- else if eq $severity "warning" -}} <font data-mx-color="#ffa500"><b>[WARNING]</b></font>
  170. {{- else if eq $severity "info" -}} <font data-mx-color="#17a2b8"><b>[INFO]</b></font>
  171. {{- else -}} <b>[{{ if $severity }}{{ $severity }}{{ else }}FIRING{{ end }}]</b>
  172. {{- end -}}
  173. {{- else -}} <font data-mx-color="#008000"><b>[RESOLVED]</b></font>
  174. {{- end }} {{ index .Labels "alertname" -}}
  175. {{- if index .Annotations "description" -}}: {{ index .Annotations "description" -}}{{- end -}}
  176. {{- if .GeneratorURL }} (<a href="{{ .GeneratorURL }}">source</a>)<br/>{{- end }}
  177. {{ end -}}
  178. msg_type: "m.text" # Must be either `m.text` or `m.notice`