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.

166 lines
6.4 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. - UserID: "@another_goneb:localhost"
  29. AccessToken: "MDASDASJDIASDJASDAFGFRGER"
  30. DeviceID: "DEVICE2"
  31. HomeserverURL: "http://localhost:8008"
  32. Sync: false
  33. AutoJoinRooms: false
  34. DisplayName: "Go-NEB!"
  35. # The list of realms which Go-NEB is aware of.
  36. # Delete or modify this list as appropriate.
  37. # See the docs for /configureAuthRealm for the full list of options:
  38. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ConfigureAuthRealmRequest
  39. realms:
  40. - ID: "github_realm"
  41. Type: "github"
  42. Config: {} # No need for client ID or Secret as Go-NEB isn't generating OAuth URLs
  43. # The list of *authenticated* sessions which Go-NEB is aware of.
  44. # Delete or modify this list as appropriate.
  45. # The full list of options are shown below: there is no single HTTP endpoint
  46. # which maps to this section.
  47. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#Session
  48. sessions:
  49. - SessionID: "your_github_session"
  50. RealmID: "github_realm"
  51. UserID: "@YOUR_USER_ID:localhost"
  52. Config:
  53. # Populate these fields by generating a "Personal Access Token" on github.com
  54. AccessToken: "YOUR_GITHUB_ACCESS_TOKEN"
  55. Scopes: "admin:org_hook,admin:repo_hook,repo,user"
  56. # The list of services which Go-NEB is aware of.
  57. # Delete or modify this list as appropriate.
  58. # See the docs for /configureService for the full list of options:
  59. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ConfigureServiceRequest
  60. services:
  61. - ID: "giphy_service"
  62. Type: "giphy"
  63. UserID: "@goneb:localhost" # requires a Syncing client
  64. Config:
  65. api_key: "qwg4672vsuyfsfe"
  66. use_downsized: false
  67. - ID: "guggy_service"
  68. Type: "guggy"
  69. UserID: "@goneb:localhost" # requires a Syncing client
  70. Config:
  71. api_key: "2356saaqfhgfe"
  72. - ID: "google_service"
  73. Type: "google"
  74. UserID: "@goneb:localhost" # requires a Syncing client
  75. Config:
  76. api_key: "AIzaSyA4FD39m9"
  77. cx: "AIASDFWSRRtrtr"
  78. - ID: "imgur_service"
  79. Type: "imgur"
  80. UserID: "@imgur:localhost" # requires a Syncing client
  81. Config:
  82. api_key: "AIzaSyA4FD39m9"
  83. - ID: "wikipedia_service"
  84. Type: "wikipedia"
  85. UserID: "@goneb:localhost" # requires a Syncing client
  86. Config:
  87. - ID: "rss_service"
  88. Type: "rssbot"
  89. UserID: "@another_goneb:localhost"
  90. Config:
  91. feeds:
  92. "http://lorem-rss.herokuapp.com/feed?unit=second&interval=60":
  93. rooms: ["!qmElAGdFYCHoCJuaNt:localhost"]
  94. must_include:
  95. author:
  96. - author1
  97. description:
  98. - lorem
  99. - ipsum
  100. must_not_include:
  101. title:
  102. - Lorem
  103. - Ipsum
  104. - ID: "github_cmd_service"
  105. Type: "github"
  106. UserID: "@goneb:localhost" # requires a Syncing client
  107. Config:
  108. RealmID: "github_realm"
  109. # Make sure your BASE_URL can be accessed by Github!
  110. - ID: "github_webhook_service"
  111. Type: "github-webhook"
  112. UserID: "@another_goneb:localhost"
  113. Config:
  114. RealmID: "github_realm"
  115. ClientUserID: "@YOUR_USER_ID:localhost" # needs to be an authenticated user so Go-NEB can create webhooks.
  116. Rooms:
  117. "!someroom:id":
  118. Repos:
  119. "matrix-org/synapse":
  120. Events: ["push", "issues"]
  121. "matrix-org/dendron":
  122. Events: ["pull_request"]
  123. "!anotherroom:id":
  124. Repos:
  125. "matrix-org/synapse":
  126. Events: ["push", "issues"]
  127. "matrix-org/dendron":
  128. Events: ["pull_request"]
  129. - ID: "slackapi_service"
  130. Type: "slackapi"
  131. UserID: "@slackapi:localhost"
  132. Config:
  133. Hooks:
  134. "hook1":
  135. RoomID: "!someroom:id"
  136. MessageType: "m.text" # default is m.text
  137. - ID: "alertmanager_service"
  138. Type: "alertmanager"
  139. UserID: "@alertmanager:localhost"
  140. Config:
  141. # This is for information purposes only. It should point to Go-NEB path as follows:
  142. # `/services/hooks/<base64 encoded service ID>`
  143. # Where in this case "service ID" is "alertmanager_service"
  144. # Make sure your BASE_URL can be accessed by the Alertmanager instance!
  145. webhook_url: "http://localhost/services/hooks/YWxlcnRtYW5hZ2VyX3NlcnZpY2U"
  146. # Each room will get the notification with the alert rendered with the given template
  147. rooms:
  148. "!someroomid:domain.tld":
  149. text_template: "{{range .Alerts -}} [{{ .Status }}] {{index .Labels \"alertname\" }}: {{index .Annotations \"description\"}} {{ end -}}"
  150. html_template: "{{range .Alerts -}} {{ $severity := index .Labels \"severity\" }} {{ if eq .Status \"firing\" }} {{ if eq $severity \"critical\"}} <font color='red'><b>[FIRING - CRITICAL]</b></font> {{ else if eq $severity \"warning\"}} <font color='orange'><b>[FIRING - WARNING]</b></font> {{ else }} <b>[FIRING - {{ $severity }}]</b> {{ end }} {{ else }} <font color='green'><b>[RESOLVED]</b></font> {{ end }} {{ index .Labels \"alertname\"}} : {{ index .Annotations \"description\"}} <a href=\"{{ .GeneratorURL }}\">source</a><br/>{{end -}}"
  151. msg_type: "m.text" # Must be either `m.text` or `m.notice`