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.

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