hookshot role groundwork
This commit is contained in:
110
roles/matrix-bridge-hookshot/templates/config.yml.j2
Normal file
110
roles/matrix-bridge-hookshot/templates/config.yml.j2
Normal file
@ -0,0 +1,110 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
bridge:
|
||||
# Basic homeserver configuration
|
||||
#
|
||||
domain: {{ matrix_domain }}
|
||||
url: {{ matrix_hookshot_homeserver_address }}
|
||||
mediaUrl: { matrix_hookshot_homeserver_address }}
|
||||
port: {{ matrix_hookshot_hookshot_port }}
|
||||
bindAddress: 0.0.0.0
|
||||
{% if matrix_hookshot_github_enabled %}
|
||||
github:
|
||||
# (Optional) Configure this to enable GitHub support
|
||||
#
|
||||
auth:
|
||||
# Authentication for the GitHub App.
|
||||
#
|
||||
id: {{ matrix_hookshot_github_appid }}
|
||||
privateKeyFile: {{ matrix_hookshot_github_private_key }}
|
||||
webhook:
|
||||
# Webhook settings for the GitHub app.
|
||||
#
|
||||
secret: {{ matrix_hookshot_github_secret }}
|
||||
{% if matrix_hookshot_github_oauth_enabled %}
|
||||
oauth:
|
||||
# (Optional) Settings for allowing users to sign in via OAuth.
|
||||
#
|
||||
client_id: {{ matrix_hookshot_github_oauth_id }}
|
||||
client_secret: {{ matrix_hookshot_github_oauth_secret }}
|
||||
redirect_uri: {{ matrix_hookshot_github_oauth_uri }}
|
||||
{% endif %}
|
||||
defaultOptions:
|
||||
# (Optional) Default options for GitHub connections.
|
||||
#
|
||||
ignoreHooks: {{ matrix_hookshot_github_ignore_hooks }}
|
||||
commandPrefix: {{ matrix_hookshot_github_command_prefix }}
|
||||
showIssueRoomLink: {{ matrix_hookshot_github_show_issue_room_link }}
|
||||
prDiff: {{ matrix_hookshot_github_pr_diff }}
|
||||
includingLabels:{{ matrix_hookshot_github_including_labels }}
|
||||
excludingLabels: {{ matrix_hookshot_github_excluding_labels }}
|
||||
{% endif %}
|
||||
{% if matrix_hookshot_gitlab_enabled %}
|
||||
gitlab:
|
||||
# (Optional) Configure this to enable GitLab support
|
||||
#
|
||||
instances:
|
||||
{{ matrix_hookshot_gitlab_instances }}
|
||||
webhook:
|
||||
secret: {{ matrix_hookshot_gitlab_secret }}
|
||||
{% endif %}
|
||||
{% if matrix_hookshot_jira_enabled %}
|
||||
jira:
|
||||
# (Optional) Configure this to enable Jira support
|
||||
#
|
||||
webhook:
|
||||
secret: {{ matrix_hookshot_jira_secret }}
|
||||
oauth:
|
||||
client_id: {{ matrix_hookshot_jira_oauth_id }}
|
||||
client_secret: {{ matrix_hookshot_jira_oauth_secret }}
|
||||
redirect_uri: {{ matrix_hookshot_jira_oauth_uri }}
|
||||
{% endif %}
|
||||
{% if matrix_hookshot_generic_enabled %}
|
||||
generic:
|
||||
# (Optional) Support for generic webhook events. `allowJsTransformationFunctions` will allow users to write short transformation snippets in code, and thus is unsafe in untrusted environments
|
||||
#
|
||||
enabled: {{ matrix_hookshot_generic_enabled }}
|
||||
urlPrefix: {{ matrix_hookshot_generic_urlprefix }}
|
||||
allowJsTransformationFunctions: {{ matrix_hookshot_generic_allow_js_transformation_functions }}
|
||||
userIdPrefix: {{ matrix_hookshot_generic_user_id_prefix }}
|
||||
{% endif %}
|
||||
provisioning:
|
||||
# (Optional) Provisioning API for integration managers
|
||||
#
|
||||
secret: {{ matrix_hookshot_provisioning_secret }}
|
||||
passFile:
|
||||
# A passkey used to encrypt tokens stored inside the bridge.
|
||||
# Run openssl genpkey -out passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:4096 to generate
|
||||
#
|
||||
passkey.pem
|
||||
bot:
|
||||
# (Optional) Define profile information for the bot user
|
||||
#
|
||||
displayname: GitHub Bot
|
||||
avatar: mxc://half-shot.uk/2876e89ccade4cb615e210c458e2a7a6883fe17d
|
||||
metrics:
|
||||
# (Optional) Prometheus metrics support
|
||||
#
|
||||
enabled: {{ matrix_hookshot_metrics_enabled }}
|
||||
logging:
|
||||
# (Optional) Logging settings. You can have a severity debug,info,warn,error
|
||||
#
|
||||
level: info
|
||||
listeners:
|
||||
# (Optional) HTTP Listener configuration.
|
||||
# Bind resource endpoints to ports and addresses.
|
||||
# 'resources' may be any of webhooks, widgets, metrics, provisioning, appservice
|
||||
#
|
||||
- port: {{ matrix_hookshot_webhook_port }}
|
||||
bindAddress: 0.0.0.0
|
||||
resources:
|
||||
- webhooks
|
||||
- widgets
|
||||
- port: {{ matrix_hookshot_metrics_port }}
|
||||
bindAddress: 0.0.0.0
|
||||
resources:
|
||||
- metrics
|
||||
- port: {{ matrix_hookshot_hookshot_port }}
|
||||
bindAddress: 0.0.0.0
|
||||
resources:
|
||||
- provisioning
|
||||
- appservice
|
16
roles/matrix-bridge-hookshot/templates/registration.yml.j2
Normal file
16
roles/matrix-bridge-hookshot/templates/registration.yml.j2
Normal file
@ -0,0 +1,16 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
id: matrix-hookshot # This can be anything, but must be unique within your homeserver
|
||||
as_token: {{ matrix_hookshot_appservice_token }} # This again can be a random string
|
||||
hs_token: {{ matrix_hookshot_homeserver_token }} # ..as can this
|
||||
namespaces:
|
||||
rooms: []
|
||||
users:
|
||||
- regex: "@_github_.*:{{ matrix_domain }}"
|
||||
exclusive: true
|
||||
aliases:
|
||||
- regex: "#github_.+:{{ matrix_domain }}"
|
||||
exclusive: true
|
||||
|
||||
sender_localpart: hookshot
|
||||
url: "http://{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_hookshot_port }}" # This should match the bridge.port in your config file
|
||||
rate_limited: false
|
@ -0,0 +1,37 @@
|
||||
#jinja2: lstrip_blocks: "True"
|
||||
[Unit]
|
||||
Description=A bridge between Matrix and multiple project management services, such as GitHub, GitLab and JIRA.
|
||||
{% for service in matrix_hookshot_systemd_required_services_list %}
|
||||
Requires={{ service }}
|
||||
After={{ service }}
|
||||
{% endfor %}
|
||||
{% for service in matrix_hookshot_systemd_wanted_services_list %}
|
||||
Wants={{ service }}
|
||||
{% endfor %}
|
||||
DefaultDependencies=no
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
Environment="HOME={{ matrix_systemd_unit_home_path }}"
|
||||
ExecStartPre=-{{ matrix_host_command_docker }} kill matrix-hookshot
|
||||
ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-hookshot
|
||||
|
||||
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-hookshot \
|
||||
--log-driver=none \
|
||||
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
|
||||
--cap-drop=ALL \
|
||||
--network={{ matrix_docker_network }} \
|
||||
-v {{ matrix_hookshot_base_path }}:/data:z \
|
||||
{% for arg in matrix_hookshot_container_extra_arguments %}
|
||||
{{ arg }} \
|
||||
{% endfor %}
|
||||
{{ matrix_hookshot_docker_image }}
|
||||
|
||||
ExecStop=-{{ matrix_host_command_docker }} kill matrix-hookshot
|
||||
ExecStop=-{{ matrix_host_command_docker }} rm matrix-hookshot
|
||||
Restart=always
|
||||
RestartSec=30
|
||||
SyslogIdentifier=matrix-hookshot
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Reference in New Issue
Block a user