2022-02-05 20:32:54 +00:00
---
2023-03-03 08:38:38 +00:00
2021-03-11 18:23:01 +00:00
# Go-NEB is a Matrix bot written in Go. It is the successor to Matrix-NEB, the original Matrix bot written in Python.
2022-07-16 20:59:21 +00:00
# Project source code URL: https://github.com/matrix-org/go-neb
2021-03-11 18:23:01 +00:00
2021-03-12 10:03:13 +00:00
matrix_bot_go_neb_enabled : true
2023-03-03 08:38:38 +00:00
2023-10-06 12:14:03 +00:00
# renovate: datasource=docker depName=matrixdotorg/go-neb
2021-03-11 18:23:01 +00:00
matrix_bot_go_neb_version : latest
2023-03-03 08:38:38 +00:00
matrix_bot_go_neb_scheme : https
# The hostname at which Go-NEB is served.
matrix_bot_go_neb_hostname : ''
# The path at which Go-NEB is exposed.
# This value must either be `/` or not end with a slash (e.g. `/go-neb`).
matrix_bot_go_neb_path_prefix : /
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 '/' }}"
2021-03-11 18:23:01 +00:00
matrix_bot_go_neb_base_path : "{{ matrix_base_data_path }}/go-neb"
matrix_bot_go_neb_config_path : "{{ matrix_bot_go_neb_base_path }}/config"
matrix_bot_go_neb_config_path_in_container : "/config/config.yaml"
matrix_bot_go_neb_data_path : "{{ matrix_bot_go_neb_base_path }}/data"
matrix_bot_go_neb_data_store_path : "{{ matrix_bot_go_neb_data_path }}/store"
2023-03-03 08:38:38 +00:00
matrix_bot_go_neb_container_image : "{{ matrix_bot_go_neb_container_image_registry_prefix }}matrixdotorg/go-neb:{{ matrix_bot_go_neb_container_image_tag }}"
matrix_bot_go_neb_container_image_tag : "{{ matrix_bot_go_neb_version }}"
matrix_bot_go_neb_container_image_force_pull : "{{ matrix_bot_go_neb_container_image.endswith(':latest') }}"
matrix_bot_go_neb_container_image_registry_prefix : docker.io/
# The base container network. It will be auto-created by this role if it doesn't exist already.
matrix_bot_go_neb_container_network : matrix-bot-go-neb
# A list of additional container networks that the container would be connected to.
# The role does not create these networks, so make sure they already exist.
# Use this to expose this container to another reverse proxy, which runs in a different container network.
matrix_bot_go_neb_container_additional_networks : [ ]
2021-03-12 10:10:00 +00:00
# Controls whether the matrix-bot-go-neb container exposes its HTTP port (tcp/4050 in the container).
#
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:4050"), or empty string to not expose.
matrix_bot_go_neb_container_http_host_bind_port : ''
2023-03-03 08:38:38 +00:00
# matrix_bot_go_neb_container_labels_traefik_enabled controls whether labels to assist a Traefik reverse-proxy will be attached to the container.
# See `../templates/labels.j2` for details.
#
# To inject your own other container labels, see `matrix_bot_go_neb_container_labels_additional_labels`.
matrix_bot_go_neb_container_labels_traefik_enabled : true
matrix_bot_go_neb_container_labels_traefik_docker_network : "{{ matrix_bot_go_neb_container_network }}"
matrix_bot_go_neb_container_labels_traefik_hostname : "{{ matrix_bot_go_neb_hostname }}"
# The path prefix must either be `/` or not end with a slash (e.g. `/go-neb`).
matrix_bot_go_neb_container_labels_traefik_path_prefix : "{{ matrix_bot_go_neb_path_prefix }}"
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 %}"
matrix_bot_go_neb_container_labels_traefik_priority : 0
matrix_bot_go_neb_container_labels_traefik_entrypoints : web-secure
matrix_bot_go_neb_container_labels_traefik_tls : "{{ matrix_bot_go_neb_container_labels_traefik_entrypoints != 'web' }}"
matrix_bot_go_neb_container_labels_traefik_tls_certResolver : default # noqa var-naming
# Controls which additional headers to attach to all HTTP responses.
# To add your own headers, use `matrix_bot_go_neb_container_labels_traefik_additional_response_headers_custom`
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) }}"
matrix_bot_go_neb_container_labels_traefik_additional_response_headers_auto : |
{{
{}
| combine ({'X-XSS-Protection': matrix_bot_go_neb_http_header_xss_protection} if matrix_bot_go_neb_http_header_xss_protection else {})
| combine ({'X-Frame-Options': matrix_bot_go_neb_http_header_frame_options} if matrix_bot_go_neb_http_header_frame_options else {})
| 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 {})
| combine ({'Content-Security-Policy': matrix_bot_go_neb_http_header_content_security_policy} if matrix_bot_go_neb_http_header_content_security_policy else {})
| combine ({'Permission-Policy': matrix_bot_go_neb_http_header_content_permission_policy} if matrix_bot_go_neb_http_header_content_permission_policy else {})
| 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 {})
}}
matrix_bot_go_neb_container_labels_traefik_additional_response_headers_custom : {}
# matrix_bot_go_neb_container_labels_additional_labels contains a multiline string with additional labels to add to the container label file.
# See `../templates/labels.j2` for details.
#
# Example:
# matrix_bot_go_neb_container_labels_additional_labels: |
# my.label=1
# another.label="here"
matrix_bot_go_neb_container_labels_additional_labels : ''
2021-03-11 18:23:01 +00:00
# A list of extra arguments to pass to the container
matrix_bot_go_neb_container_extra_arguments : [ ]
# List of systemd services that matrix-bot-go-neb.service depends on
2024-01-07 07:23:24 +00:00
matrix_bot_go_neb_systemd_required_services_list : "{{ matrix_bot_go_neb_systemd_required_services_list_default + matrix_bot_go_neb_systemd_required_services_list_auto + matrix_bot_go_neb_systemd_required_services_list_custom }}"
matrix_bot_go_neb_systemd_required_services_list_default : [ 'docker.service' ]
matrix_bot_go_neb_systemd_required_services_list_auto : [ ]
matrix_bot_go_neb_systemd_required_services_list_custom : [ ]
2021-03-11 18:23:01 +00:00
# List of systemd services that matrix-bot-go-neb.service wants
matrix_bot_go_neb_systemd_wanted_services_list : [ ]
2023-03-03 08:38:38 +00:00
# Specifies the value of the `X-XSS-Protection` header
# Stops pages from loading when they detect reflected cross-site scripting (XSS) attacks.
#
# Learn more about it is here:
# - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection
# - https://portswigger.net/web-security/cross-site-scripting/reflected
matrix_bot_go_neb_http_header_xss_protection : "1; mode=block"
# Specifies the value of the `X-Frame-Options` header which controls whether framing can happen.
# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
matrix_bot_go_neb_http_header_frame_options : SAMEORIGIN
# Specifies the value of the `X-Content-Type-Options` header.
# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
matrix_bot_go_neb_http_header_content_type_options : nosniff
# Specifies the value of the `Content-Security-Policy` header.
# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
matrix_bot_go_neb_http_header_content_security_policy : frame-ancestors 'self'
# Specifies the value of the `Permission-Policy` header.
# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permission-Policy
matrix_bot_go_neb_http_header_content_permission_policy : "{{ 'interest-cohort=()' if matrix_bot_go_neb_floc_optout_enabled else '' }}"
# Specifies the value of the `Strict-Transport-Security` header.
# See: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
matrix_bot_go_neb_http_header_strict_transport_security : "max-age=31536000; includeSubDomains{{ '; preload' if matrix_bot_go_neb_hsts_preload_enabled else '' }}"
# Controls whether to send a "Permissions-Policy interest-cohort=();" header along with all responses
#
# Learn more about what it is here:
# - https://www.eff.org/deeplinks/2021/03/googles-floc-terrible-idea
# - https://paramdeo.com/blog/opting-your-website-out-of-googles-floc-network
# - https://amifloced.org/
#
# Of course, a better solution is to just stop using browsers (like Chrome), which participate in such tracking practices.
# See: `matrix_bot_go_neb_content_permission_policy`
matrix_bot_go_neb_floc_optout_enabled : true
# Controls if HSTS preloading is enabled
#
# In its strongest and recommended form, the [HSTS policy](https://www.chromium.org/hsts) includes all subdomains, and
# indicates a willingness to be "preloaded" into browsers:
# `Strict-Transport-Security: max-age=31536000; includeSubDomains; preload`
# For more information visit:
# - https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security
# - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
# - https://hstspreload.org/#opt-in
# See: `matrix_bot_go_neb_http_header_strict_transport_security`
matrix_bot_go_neb_hsts_preload_enabled : false
2021-03-11 18:23:01 +00:00
# Database-related configuration fields.
#
# MUST be "sqlite3". No other type is supported.
matrix_bot_go_neb_database_engine : 'sqlite3'
matrix_bot_go_neb_sqlite_database_path_local : "{{ matrix_bot_go_neb_data_path }}/bot.db"
matrix_bot_go_neb_sqlite_database_path_in_container : "/data/bot.db"
matrix_bot_go_neb_storage_database : "{{
{
'sqlite3' : (matrix_bot_go_neb_sqlite_database_path_in_container + '?_busy_timeout=5000'),
}[ matrix_bot_go_neb_database_engine]
}}"
# The bot's username(s). These users need to be created manually beforehand.
# The access tokens that the bot uses to authenticate.
# Generate one as described in
# https://github.com/spantaleev/matrix-docker-ansible-deploy/blob/master/docs/configuring-playbook-dimension.md#access-token
# via curl. With the element method, you might run into decryption problems (see https://github.com/matrix-org/go-neb#quick-start)
2021-03-28 09:10:22 +00:00
matrix_bot_go_neb_clients : [ ]
2021-03-12 14:36:13 +00:00
# - UserID: "@goneb:{{ matrix_domain }}"
2021-03-11 18:23:01 +00:00
# AccessToken: "MDASDASJDIASDJASDAFGFRGER"
# DeviceID: "DEVICE1"
2024-01-07 15:04:23 +00:00
# HomeserverURL: "{{ matrix_addons_homeserver_client_api_url }}"
2021-03-11 18:23:01 +00:00
# Sync: true
# AutoJoinRooms: true
# DisplayName: "Go-NEB!"
2021-03-12 13:59:42 +00:00
# AcceptVerificationFromUsers: [":{{ matrix_domain }}"]
2021-03-11 18:23:01 +00:00
#
2021-03-12 14:36:13 +00:00
# - UserID: "@another_goneb:{{ matrix_domain }}"
2021-03-11 18:23:01 +00:00
# AccessToken: "MDASDASJDIASDJASDAFGFRGER"
# DeviceID: "DEVICE2"
2024-01-07 15:04:23 +00:00
# HomeserverURL: "{{ matrix_addons_homeserver_client_api_url }}"
2021-03-11 18:23:01 +00:00
# Sync: false
# AutoJoinRooms: false
# DisplayName: "Go-NEB!"
2021-03-12 13:59:42 +00:00
# AcceptVerificationFromUsers: ["^@admin:{{ matrix_domain }}"]
2021-03-11 18:23:01 +00:00
# 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
2021-03-28 09:10:22 +00:00
matrix_bot_go_neb_realms : [ ]
2021-03-11 18:23:01 +00:00
# - 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
2021-03-28 09:10:22 +00:00
matrix_bot_go_neb_sessions : [ ]
2021-03-11 18:23:01 +00:00
# - SessionID: "your_github_session"
# RealmID: "github_realm"
2021-03-12 14:36:13 +00:00
# UserID: "@YOUR_USER_ID:{{ matrix_domain }}" # This needs to be the username of the person that's allowed to use the !github commands
2021-03-11 18:23:01 +00:00
# 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
2021-03-28 09:10:22 +00:00
matrix_bot_go_neb_services : [ ]
2021-03-11 18:23:01 +00:00
# - ID: "echo_service"
# Type: "echo"
2021-03-12 14:36:13 +00:00
# UserID: "@goneb:{{ matrix_domain }}"
2021-03-11 18:23:01 +00:00
# Config: {}
## Can be obtained from https://developers.giphy.com/dashboard/
# - ID: "giphy_service"
# Type: "giphy"
2021-03-12 14:36:13 +00:00
# UserID: "@goneb:{{ matrix_domain }}" # requires a Syncing client
2021-03-11 18:23:01 +00:00
# Config:
# api_key: "qwg4672vsuyfsfe"
# use_downsized: false
#
## This service has been dead for over a year :/
# - ID: "guggy_service"
# Type: "guggy"
2021-03-12 14:36:13 +00:00
# UserID: "@goneb:{{ matrix_domain }}" # requires a Syncing client
2021-03-11 18:23:01 +00:00
# Config:
# api_key: "2356saaqfhgfe"
#
## API Key via https://developers.google.com/custom-search/v1/introduction
## CX via http://www.google.com/cse/manage/all
## https://stackoverflow.com/questions/6562125/getting-a-cx-id-for-custom-search-google-api-python
## 'Search the entire web' and 'Image search' enabled for best results
# - ID: "google_service"
# Type: "google"
2021-03-12 14:36:13 +00:00
# UserID: "@goneb:{{ matrix_domain }}" # requires a Syncing client
2021-03-11 18:23:01 +00:00
# Config:
# api_key: "AIzaSyA4FD39m9"
# cx: "AIASDFWSRRtrtr"
#
## Get a key via https://api.imgur.com/oauth2/addclient
2021-03-12 14:57:23 +00:00
## Select "oauth2 without callback url"
2021-03-11 18:23:01 +00:00
# - ID: "imgur_service"
# Type: "imgur"
2021-03-12 14:36:13 +00:00
# UserID: "@imgur:{{ matrix_domain }}" # requires a Syncing client
2021-03-11 18:23:01 +00:00
# Config:
2021-03-12 14:57:23 +00:00
# client_id: "AIzaSyA4FD39m9"
# client_secret: "somesecret"
2021-03-11 18:23:01 +00:00
#
# - ID: "wikipedia_service"
# Type: "wikipedia"
2021-03-12 14:36:13 +00:00
# UserID: "@goneb:{{ matrix_domain }}" # requires a Syncing client
2021-03-11 18:23:01 +00:00
# Config:
#
# - ID: "rss_service"
# Type: "rssbot"
2021-03-12 14:36:13 +00:00
# UserID: "@another_goneb:{{ matrix_domain }}"
2021-03-11 18:23:01 +00:00
# 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"
2021-03-12 14:36:13 +00:00
# UserID: "@goneb:{{ matrix_domain }}" # requires a Syncing client
2021-03-11 18:23:01 +00:00
# Config:
# RealmID: "github_realm"
#
# # Make sure your BASE_URL can be accessed by Github!
# - ID: "github_webhook_service"
# Type: "github-webhook"
2021-03-12 14:36:13 +00:00
# UserID: "@another_goneb:{{ matrix_domain }}"
2021-03-11 18:23:01 +00:00
# Config:
# RealmID: "github_realm"
2021-03-12 14:36:13 +00:00
# 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.
2021-03-11 18:23:01 +00:00
# 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"
2021-03-12 14:36:13 +00:00
# UserID: "@slackapi:{{ matrix_domain }}"
2021-03-11 18:23:01 +00:00
# Config:
# Hooks:
# "hook1":
# RoomID: "!someroom:id"
# MessageType: "m.text" # default is m.text
#
# - ID: "alertmanager_service"
# Type: "alertmanager"
2021-03-12 14:36:13 +00:00
# UserID: "@alertmanager:{{ matrix_domain }}"
2021-03-11 18:23:01 +00:00
# Config:
# # This is for information purposes only. It should point to Go-NEB path as follows:
# # `/services/hooks/<base64 encoded service ID>`
# # 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":
2022-02-05 20:32:54 +00:00
# text_template: "{% raw %}{{range .Alerts -}} [{{ .Status }}] {{index .Labels \"alertname\"}}: {{index .Annotations \"description\"}} {{ end -}}{% endraw %}"
# 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 %}"
2021-03-11 18:23:01 +00:00
# msg_type: "m.text" # Must be either `m.text` or `m.notice`
# Default configuration template which covers the generic use case.
# You can customize it by controlling the various variables inside it.
#
# For a more advanced customization, you can extend the default (see `matrix_bot_go_neb_configuration_extension_yaml`)
# or completely replace this variable with your own template.
matrix_bot_go_neb_configuration_yaml : "{{ lookup('template', 'templates/config.yaml.j2') }}"
matrix_bot_go_neb_configuration_extension_yaml : |
# Your custom YAML configuration goes here.
# This configuration extends the default starting configuration (`matrix_bot_go_neb_configuration_yaml`).
#
# You can override individual variables from the default configuration, or introduce new ones.
#
# If you need something more special, you can take full control by
# completely redefining `matrix_bot_go_neb_configuration_yaml`.
2022-07-18 08:22:05 +00:00
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 {} }}"
2021-03-11 18:23:01 +00:00
# Holds the final configuration (a combination of the default and its extension).
# You most likely don't need to touch this variable. Instead, see `matrix_bot_go_neb_configuration_yaml`.
2022-07-18 09:28:39 +00:00
matrix_bot_go_neb_configuration : "{{ matrix_bot_go_neb_configuration_yaml | from_yaml | combine(matrix_bot_go_neb_configuration_extension, recursive=True) }}"