Matrix Docker Ansible eploy
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.
 
 

346 lines
17 KiB

  1. ---
  2. # Go-NEB is a Matrix bot written in Go. It is the successor to Matrix-NEB, the original Matrix bot written in Python.
  3. # Project source code URL: https://github.com/matrix-org/go-neb
  4. matrix_bot_go_neb_enabled: true
  5. matrix_bot_go_neb_version: latest
  6. matrix_bot_go_neb_scheme: https
  7. # The hostname at which Go-NEB is served.
  8. matrix_bot_go_neb_hostname: ''
  9. # The path at which Go-NEB is exposed.
  10. # This value must either be `/` or not end with a slash (e.g. `/go-neb`).
  11. matrix_bot_go_neb_path_prefix: /
  12. matrix_bot_go_neb_base_url: "{{ matrix_bot_go_neb_scheme }}://{{ matrix_bot_go_neb_hostname }}{{ matrix_bot_go_neb_path_prefix }}{{ '' if matrix_bot_go_neb_path_prefix == '/' else '/' }}"
  13. matrix_bot_go_neb_base_path: "{{ matrix_base_data_path }}/go-neb"
  14. matrix_bot_go_neb_config_path: "{{ matrix_bot_go_neb_base_path }}/config"
  15. matrix_bot_go_neb_config_path_in_container: "/config/config.yaml"
  16. matrix_bot_go_neb_data_path: "{{ matrix_bot_go_neb_base_path }}/data"
  17. matrix_bot_go_neb_data_store_path: "{{ matrix_bot_go_neb_data_path }}/store"
  18. matrix_bot_go_neb_container_image: "{{ matrix_bot_go_neb_container_image_registry_prefix }}matrixdotorg/go-neb:{{ matrix_bot_go_neb_container_image_tag }}"
  19. matrix_bot_go_neb_container_image_tag: "{{ matrix_bot_go_neb_version }}"
  20. matrix_bot_go_neb_container_image_force_pull: "{{ matrix_bot_go_neb_container_image.endswith(':latest') }}"
  21. matrix_bot_go_neb_container_image_registry_prefix: docker.io/
  22. # The base container network. It will be auto-created by this role if it doesn't exist already.
  23. matrix_bot_go_neb_container_network: matrix-bot-go-neb
  24. # A list of additional container networks that the container would be connected to.
  25. # The role does not create these networks, so make sure they already exist.
  26. # Use this to expose this container to another reverse proxy, which runs in a different container network.
  27. matrix_bot_go_neb_container_additional_networks: []
  28. # Controls whether the matrix-bot-go-neb container exposes its HTTP port (tcp/4050 in the container).
  29. #
  30. # Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:4050"), or empty string to not expose.
  31. matrix_bot_go_neb_container_http_host_bind_port: ''
  32. # matrix_bot_go_neb_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
  33. # See `../templates/labels.j2` for details.
  34. #
  35. # To inject your own other container labels, see `matrix_bot_go_neb_container_labels_additional_labels`.
  36. matrix_bot_go_neb_container_labels_traefik_enabled: true
  37. matrix_bot_go_neb_container_labels_traefik_docker_network: "{{ matrix_bot_go_neb_container_network }}"
  38. matrix_bot_go_neb_container_labels_traefik_hostname: "{{ matrix_bot_go_neb_hostname }}"
  39. # The path prefix must either be `/` or not end with a slash (e.g. `/go-neb`).
  40. matrix_bot_go_neb_container_labels_traefik_path_prefix: "{{ matrix_bot_go_neb_path_prefix }}"
  41. matrix_bot_go_neb_container_labels_traefik_rule: "Host(`{{ matrix_bot_go_neb_container_labels_traefik_hostname }}`){% if matrix_bot_go_neb_container_labels_traefik_path_prefix != '/' %} && PathPrefix(`{{ matrix_bot_go_neb_container_labels_traefik_path_prefix }}`){% endif %}"
  42. matrix_bot_go_neb_container_labels_traefik_priority: 0
  43. matrix_bot_go_neb_container_labels_traefik_entrypoints: web-secure
  44. matrix_bot_go_neb_container_labels_traefik_tls: "{{ matrix_bot_go_neb_container_labels_traefik_entrypoints != 'web' }}"
  45. matrix_bot_go_neb_container_labels_traefik_tls_certResolver: default # noqa var-naming
  46. # Controls which additional headers to attach to all HTTP responses.
  47. # To add your own headers, use `matrix_bot_go_neb_container_labels_traefik_additional_response_headers_custom`
  48. matrix_bot_go_neb_container_labels_traefik_additional_response_headers: "{{ matrix_bot_go_neb_container_labels_traefik_additional_response_headers_auto | combine(matrix_bot_go_neb_container_labels_traefik_additional_response_headers_custom) }}"
  49. matrix_bot_go_neb_container_labels_traefik_additional_response_headers_auto: |
  50. {{
  51. {}
  52. | combine ({'X-XSS-Protection': matrix_bot_go_neb_http_header_xss_protection} if matrix_bot_go_neb_http_header_xss_protection else {})
  53. | combine ({'X-Frame-Options': matrix_bot_go_neb_http_header_frame_options} if matrix_bot_go_neb_http_header_frame_options else {})
  54. | combine ({'X-Content-Type-Options': matrix_bot_go_neb_http_header_content_type_options} if matrix_bot_go_neb_http_header_content_type_options else {})
  55. | combine ({'Content-Security-Policy': matrix_bot_go_neb_http_header_content_security_policy} if matrix_bot_go_neb_http_header_content_security_policy else {})
  56. | combine ({'Permission-Policy': matrix_bot_go_neb_http_header_content_permission_policy} if matrix_bot_go_neb_http_header_content_permission_policy else {})
  57. | combine ({'Strict-Transport-Security': matrix_bot_go_neb_http_header_strict_transport_security} if matrix_bot_go_neb_http_header_strict_transport_security and matrix_bot_go_neb_container_labels_traefik_tls else {})
  58. }}
  59. matrix_bot_go_neb_container_labels_traefik_additional_response_headers_custom: {}
  60. # matrix_bot_go_neb_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
  61. # See `../templates/labels.j2` for details.
  62. #
  63. # Example:
  64. # matrix_bot_go_neb_container_labels_additional_labels: |
  65. # my.label=1
  66. # another.label="here"
  67. matrix_bot_go_neb_container_labels_additional_labels: ''
  68. # A list of extra arguments to pass to the container
  69. matrix_bot_go_neb_container_extra_arguments: []
  70. # List of systemd services that matrix-bot-go-neb.service depends on
  71. matrix_bot_go_neb_systemd_required_services_list: ['docker.service']
  72. # List of systemd services that matrix-bot-go-neb.service wants
  73. matrix_bot_go_neb_systemd_wanted_services_list: []
  74. # Specifies the value of the `X-XSS-Protection` header
  75. # Stops pages from loading when they detect reflected cross-site scripting (XSS) attacks.
  76. #
  77. # Learn more about it is here:
  78. # - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
  79. # - https://portswigger.net/web-security/cross-site-scripting/reflected
  80. matrix_bot_go_neb_http_header_xss_protection: "1; mode=block"
  81. # Specifies the value of the `X-Frame-Options` header which controls whether framing can happen.
  82. # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
  83. matrix_bot_go_neb_http_header_frame_options: SAMEORIGIN
  84. # Specifies the value of the `X-Content-Type-Options` header.
  85. # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
  86. matrix_bot_go_neb_http_header_content_type_options: nosniff
  87. # Specifies the value of the `Content-Security-Policy` header.
  88. # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
  89. matrix_bot_go_neb_http_header_content_security_policy: frame-ancestors 'self'
  90. # Specifies the value of the `Permission-Policy` header.
  91. # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permission-Policy
  92. matrix_bot_go_neb_http_header_content_permission_policy: "{{ 'interest-cohort=()' if matrix_bot_go_neb_floc_optout_enabled else '' }}"
  93. # Specifies the value of the `Strict-Transport-Security` header.
  94. # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
  95. matrix_bot_go_neb_http_header_strict_transport_security: "max-age=31536000; includeSubDomains{{ '; preload' if matrix_bot_go_neb_hsts_preload_enabled else '' }}"
  96. # Controls whether to send a "Permissions-Policy interest-cohort=();" header along with all responses
  97. #
  98. # Learn more about what it is here:
  99. # - https://www.eff.org/deeplinks/2021/03/googles-floc-terrible-idea
  100. # - https://paramdeo.com/blog/opting-your-website-out-of-googles-floc-network
  101. # - https://amifloced.org/
  102. #
  103. # Of course, a better solution is to just stop using browsers (like Chrome), which participate in such tracking practices.
  104. # See: `matrix_bot_go_neb_content_permission_policy`
  105. matrix_bot_go_neb_floc_optout_enabled: true
  106. # Controls if HSTS preloading is enabled
  107. #
  108. # In its strongest and recommended form, the [HSTS policy](https://www.chromium.org/hsts) includes all subdomains, and
  109. # indicates a willingness to be "preloaded" into browsers:
  110. # `Strict-Transport-Security: max-age=31536000; includeSubDomains; preload`
  111. # For more information visit:
  112. # - https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security
  113. # - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
  114. # - https://hstspreload.org/#opt-in
  115. # See: `matrix_bot_go_neb_http_header_strict_transport_security`
  116. matrix_bot_go_neb_hsts_preload_enabled: false
  117. # Database-related configuration fields.
  118. #
  119. # MUST be "sqlite3". No other type is supported.
  120. matrix_bot_go_neb_database_engine: 'sqlite3'
  121. matrix_bot_go_neb_sqlite_database_path_local: "{{ matrix_bot_go_neb_data_path }}/bot.db"
  122. matrix_bot_go_neb_sqlite_database_path_in_container: "/data/bot.db"
  123. matrix_bot_go_neb_storage_database: "{{
  124. {
  125. 'sqlite3': (matrix_bot_go_neb_sqlite_database_path_in_container + '?_busy_timeout=5000'),
  126. }[matrix_bot_go_neb_database_engine]
  127. }}"
  128. # The bot's username(s). These users need to be created manually beforehand.
  129. # The access tokens that the bot uses to authenticate.
  130. # Generate one as described in
  131. # https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-dimension.md#access-token
  132. # via curl. With the element method, you might run into decryption problems (see https://github.com/matrix-org/go-neb#quick-start)
  133. matrix_bot_go_neb_clients: []
  134. # - UserID: "@goneb:{{ matrix_domain }}"
  135. # AccessToken: "MDASDASJDIASDJASDAFGFRGER"
  136. # DeviceID: "DEVICE1"
  137. # HomeserverURL: "{{ matrix_homeserver_container_url }}"
  138. # Sync: true
  139. # AutoJoinRooms: true
  140. # DisplayName: "Go-NEB!"
  141. # AcceptVerificationFromUsers: [":{{ matrix_domain }}"]
  142. #
  143. # - UserID: "@another_goneb:{{ matrix_domain }}"
  144. # AccessToken: "MDASDASJDIASDJASDAFGFRGER"
  145. # DeviceID: "DEVICE2"
  146. # HomeserverURL: "{{ matrix_homeserver_container_url }}"
  147. # Sync: false
  148. # AutoJoinRooms: false
  149. # DisplayName: "Go-NEB!"
  150. # AcceptVerificationFromUsers: ["^@admin:{{ matrix_domain }}"]
  151. # The list of realms which Go-NEB is aware of.
  152. # Delete or modify this list as appropriate.
  153. # See the docs for /configureAuthRealm for the full list of options:
  154. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ConfigureAuthRealmRequest
  155. matrix_bot_go_neb_realms: []
  156. # - ID: "github_realm"
  157. # Type: "github"
  158. # Config: {} # No need for client ID or Secret as Go-NEB isn't generating OAuth URLs
  159. # The list of *authenticated* sessions which Go-NEB is aware of.
  160. # Delete or modify this list as appropriate.
  161. # The full list of options are shown below: there is no single HTTP endpoint
  162. # which maps to this section.
  163. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#Session
  164. matrix_bot_go_neb_sessions: []
  165. # - SessionID: "your_github_session"
  166. # RealmID: "github_realm"
  167. # UserID: "@YOUR_USER_ID:{{ matrix_domain }}" # This needs to be the username of the person that's allowed to use the !github commands
  168. # Config:
  169. # # Populate these fields by generating a "Personal Access Token" on github.com
  170. # AccessToken: "YOUR_GITHUB_ACCESS_TOKEN"
  171. # Scopes: "admin:org_hook,admin:repo_hook,repo,user"
  172. # The list of services which Go-NEB is aware of.
  173. # Delete or modify this list as appropriate.
  174. # See the docs for /configureService for the full list of options:
  175. # https://matrix-org.github.io/go-neb/pkg/github.com/matrix-org/go-neb/api/index.html#ConfigureServiceRequest
  176. matrix_bot_go_neb_services: []
  177. # - ID: "echo_service"
  178. # Type: "echo"
  179. # UserID: "@goneb:{{ matrix_domain }}"
  180. # Config: {}
  181. ## Can be obtained from https://developers.giphy.com/dashboard/
  182. # - ID: "giphy_service"
  183. # Type: "giphy"
  184. # UserID: "@goneb:{{ matrix_domain }}" # requires a Syncing client
  185. # Config:
  186. # api_key: "qwg4672vsuyfsfe"
  187. # use_downsized: false
  188. #
  189. ## This service has been dead for over a year :/
  190. # - ID: "guggy_service"
  191. # Type: "guggy"
  192. # UserID: "@goneb:{{ matrix_domain }}" # requires a Syncing client
  193. # Config:
  194. # api_key: "2356saaqfhgfe"
  195. #
  196. ## API Key via https://developers.google.com/custom-search/v1/introduction
  197. ## CX via http://www.google.com/cse/manage/all
  198. ## https://stackoverflow.com/questions/6562125/getting-a-cx-id-for-custom-search-google-api-python
  199. ## 'Search the entire web' and 'Image search' enabled for best results
  200. # - ID: "google_service"
  201. # Type: "google"
  202. # UserID: "@goneb:{{ matrix_domain }}" # requires a Syncing client
  203. # Config:
  204. # api_key: "AIzaSyA4FD39m9"
  205. # cx: "AIASDFWSRRtrtr"
  206. #
  207. ## Get a key via https://api.imgur.com/oauth2/addclient
  208. ## Select "oauth2 without callback url"
  209. # - ID: "imgur_service"
  210. # Type: "imgur"
  211. # UserID: "@imgur:{{ matrix_domain }}" # requires a Syncing client
  212. # Config:
  213. # client_id: "AIzaSyA4FD39m9"
  214. # client_secret: "somesecret"
  215. #
  216. # - ID: "wikipedia_service"
  217. # Type: "wikipedia"
  218. # UserID: "@goneb:{{ matrix_domain }}" # requires a Syncing client
  219. # Config:
  220. #
  221. # - ID: "rss_service"
  222. # Type: "rssbot"
  223. # UserID: "@another_goneb:{{ matrix_domain }}"
  224. # Config:
  225. # feeds:
  226. # "http://lorem-rss.herokuapp.com/feed?unit=second&interval=60":
  227. # rooms: ["!qmElAGdFYCHoCJuaNt:localhost"]
  228. # must_include:
  229. # author:
  230. # - author1
  231. # description:
  232. # - lorem
  233. # - ipsum
  234. # must_not_include:
  235. # title:
  236. # - Lorem
  237. # - Ipsum
  238. #
  239. # - ID: "github_cmd_service"
  240. # Type: "github"
  241. # UserID: "@goneb:{{ matrix_domain }}" # requires a Syncing client
  242. # Config:
  243. # RealmID: "github_realm"
  244. #
  245. # # Make sure your BASE_URL can be accessed by Github!
  246. # - ID: "github_webhook_service"
  247. # Type: "github-webhook"
  248. # UserID: "@another_goneb:{{ matrix_domain }}"
  249. # Config:
  250. # RealmID: "github_realm"
  251. # ClientUserID: "@YOUR_USER_ID:{{ matrix_domain }}" # needs to be an authenticated user so Go-NEB can create webhooks. Check the UserID field in the github_realm in matrix_bot_go_neb_sessions.
  252. # Rooms:
  253. # "!someroom:id":
  254. # Repos:
  255. # "matrix-org/synapse":
  256. # Events: ["push", "issues"]
  257. # "matrix-org/dendron":
  258. # Events: ["pull_request"]
  259. # "!anotherroom:id":
  260. # Repos:
  261. # "matrix-org/synapse":
  262. # Events: ["push", "issues"]
  263. # "matrix-org/dendron":
  264. # Events: ["pull_request"]
  265. #
  266. # - ID: "slackapi_service"
  267. # Type: "slackapi"
  268. # UserID: "@slackapi:{{ matrix_domain }}"
  269. # Config:
  270. # Hooks:
  271. # "hook1":
  272. # RoomID: "!someroom:id"
  273. # MessageType: "m.text" # default is m.text
  274. #
  275. # - ID: "alertmanager_service"
  276. # Type: "alertmanager"
  277. # UserID: "@alertmanager:{{ matrix_domain }}"
  278. # Config:
  279. # # This is for information purposes only. It should point to Go-NEB path as follows:
  280. # # `/services/hooks/<base64 encoded service ID>`
  281. # # Where in this case "service ID" is "alertmanager_service"
  282. # # Make sure your BASE_URL can be accessed by the Alertmanager instance!
  283. # webhook_url: "http://localhost/services/hooks/YWxlcnRtYW5hZ2VyX3NlcnZpY2U"
  284. # # Each room will get the notification with the alert rendered with the given template
  285. # rooms:
  286. # "!someroomid:domain.tld":
  287. # text_template: "{% raw %}{{range .Alerts -}} [{{ .Status }}] {{index .Labels \"alertname\"}}: {{index .Annotations \"description\"}} {{ end -}}{% endraw %}"
  288. # html_template: "{% raw %}{{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 -}}{% endraw %}"
  289. # msg_type: "m.text" # Must be either `m.text` or `m.notice`
  290. # Default configuration template which covers the generic use case.
  291. # You can customize it by controlling the various variables inside it.
  292. #
  293. # For a more advanced customization, you can extend the default (see `matrix_bot_go_neb_configuration_extension_yaml`)
  294. # or completely replace this variable with your own template.
  295. matrix_bot_go_neb_configuration_yaml: "{{ lookup('template', 'templates/config.yaml.j2') }}"
  296. matrix_bot_go_neb_configuration_extension_yaml: |
  297. # Your custom YAML configuration goes here.
  298. # This configuration extends the default starting configuration (`matrix_bot_go_neb_configuration_yaml`).
  299. #
  300. # You can override individual variables from the default configuration, or introduce new ones.
  301. #
  302. # If you need something more special, you can take full control by
  303. # completely redefining `matrix_bot_go_neb_configuration_yaml`.
  304. matrix_bot_go_neb_configuration_extension: "{{ matrix_bot_go_neb_configuration_extension_yaml | from_yaml if matrix_bot_go_neb_configuration_extension_yaml | from_yaml is mapping else {} }}"
  305. # Holds the final configuration (a combination of the default and its extension).
  306. # You most likely don't need to touch this variable. Instead, see `matrix_bot_go_neb_configuration_yaml`.
  307. matrix_bot_go_neb_configuration: "{{ matrix_bot_go_neb_configuration_yaml | from_yaml | combine(matrix_bot_go_neb_configuration_extension, recursive=True) }}"