Skip to content

Commit 978d24a

Browse files
committed
Upgrade Hookshot (6.0.3 -> 7.0.0) and remove provisioning API and integration with Dimension
Ref: - #4326 - https://github.com/matrix-org/matrix-hookshot/releases/tag/7.0.0 - matrix-org/matrix-hookshot#931 Closes #4326
1 parent 1fdb3dd commit 978d24a

File tree

6 files changed

+10
-81
lines changed

6 files changed

+10
-81
lines changed

docs/configuring-playbook-bridge-hookshot.md

-5
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ Unless indicated otherwise, the following endpoints are reachable on your `matri
103103
| github oauth | `/hookshot/webhooks/oauth` | `matrix_hookshot_github_oauth_endpoint` | GitHub "Callback URL" |
104104
| jira oauth | `/hookshot/webhooks/jira/oauth` | `matrix_hookshot_jira_oauth_endpoint` | Jira OAuth |
105105
| figma endpoint | `/hookshot/webhooks/figma/webhook` | `matrix_hookshot_figma_endpoint` | Figma |
106-
| provisioning | `/hookshot/v1/` | `matrix_hookshot_provisioning_endpoint` | Dimension [provisioning](#provisioning-api) |
107106
| appservice | `/hookshot/_matrix/app/` | `matrix_hookshot_appservice_endpoint` | Matrix server |
108107
| widgets | `/hookshot/widgetapi/` | `matrix_hookshot_widgets_endpoint` | Widgets |
109108

@@ -132,10 +131,6 @@ aux_file_definitions:
132131
133132
For more information, see the documentation in the [default configuration of the aux role](https://github.com/mother-of-all-self-hosting/ansible-role-aux/blob/main/defaults/main.yml).
134133
135-
### Provisioning API
136-
137-
The provisioning API will be enabled automatically if you set `matrix_dimension_enabled: true` and provided a `matrix_hookshot_provisioning_secret`, unless you override it either way. To use hookshot with Dimension, you will need to enter as "Provisioning URL": `http://matrix-hookshot:9002`, which is made up of the variables `matrix_hookshot_container_url` and `matrix_hookshot_provisioning_port`.
138-
139134
### Collision with matrix-appservice-webhooks
140135
141136
If you are also running [matrix-appservice-webhooks](configuring-playbook-bridge-appservice-webhooks.md), it reserves its namespace by the default setting `matrix_appservice_webhooks_user_prefix: '_webhook_'`. You should take care if you modify its or hookshot's prefix that they do not collide with each other's namespace (default `matrix_hookshot_generic_userIdPrefix: '_webhooks_'`).

group_vars/matrix_servers

-3
Original file line numberDiff line numberDiff line change
@@ -2317,7 +2317,6 @@ matrix_hookshot_container_http_host_bind_ports_defaultmapping:
23172317
- "{{ matrix_playbook_service_host_bind_interface_prefix }}{{ matrix_hookshot_appservice_port }}:{{ matrix_hookshot_appservice_port }}"
23182318
- "{{ matrix_playbook_service_host_bind_interface_prefix }}{{ matrix_hookshot_metrics_port }}:{{ matrix_hookshot_metrics_port }}"
23192319
- "{{ matrix_playbook_service_host_bind_interface_prefix }}{{ matrix_hookshot_webhook_port }}:{{ matrix_hookshot_webhook_port }}"
2320-
- "{{ matrix_playbook_service_host_bind_interface_prefix }}{{ matrix_hookshot_provisioning_port }}:{{ matrix_hookshot_provisioning_port }}"
23212320

23222321
matrix_hookshot_container_http_host_bind_ports: "{{ matrix_hookshot_container_http_host_bind_ports_defaultmapping if matrix_playbook_service_host_bind_interface_prefix else [] }}"
23232322

@@ -2326,8 +2325,6 @@ matrix_hookshot_container_labels_traefik_docker_network: "{{ matrix_playbook_rev
23262325
matrix_hookshot_container_labels_traefik_entrypoints: "{{ traefik_entrypoint_primary }}"
23272326
matrix_hookshot_container_labels_traefik_tls_certResolver: "{{ traefik_certResolver_primary }}"
23282327

2329-
matrix_hookshot_provisioning_enabled: "{{ matrix_hookshot_provisioning_secret and matrix_dimension_enabled }}"
2330-
23312328
matrix_hookshot_metrics_enabled: "{{ prometheus_enabled or matrix_metrics_exposure_enabled }}"
23322329

23332330
matrix_hookshot_metrics_proxying_enabled: "{{ matrix_hookshot_metrics_enabled and matrix_metrics_exposure_enabled }}"

roles/custom/matrix-bridge-hookshot/defaults/main.yml

+2-20
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ matrix_hookshot_container_additional_networks_auto: []
2929
matrix_hookshot_container_additional_networks_custom: []
3030

3131
# renovate: datasource=docker depName=halfshot/matrix-hookshot
32-
matrix_hookshot_version: 6.0.3
32+
matrix_hookshot_version: 7.0.0
3333

3434
matrix_hookshot_docker_image: "{{ matrix_hookshot_docker_image_registry_prefix }}matrix-org/matrix-hookshot:{{ matrix_hookshot_version }}"
3535
matrix_hookshot_docker_image_registry_prefix: "{{ 'localhost/' if matrix_hookshot_container_image_self_build else matrix_hookshot_docker_image_registry_prefix_upstream }}"
@@ -187,16 +187,6 @@ matrix_hookshot_feeds_enabled: true
187187
matrix_hookshot_feeds_pollIntervalSeconds: 600 # noqa var-naming
188188
matrix_hookshot_feeds_pollTimeoutSeconds: 30 # noqa var-naming
189189

190-
191-
matrix_hookshot_provisioning_enabled: false
192-
# There is no need to edit ports. use matrix_hookshot_container_http_host_bind_ports below to expose ports instead.
193-
matrix_hookshot_provisioning_port: 9002
194-
matrix_hookshot_provisioning_secret: ''
195-
# Provisioning will be automatically enabled if Dimension is enabled and you have provided a provisioning secret, unless you override it
196-
matrix_hookshot_provisioning_internal: "/v1"
197-
matrix_hookshot_provisioning_hostname: "{{ matrix_hookshot_public_hostname }}"
198-
matrix_hookshot_provisioning_endpoint: "{{ matrix_hookshot_public_endpoint }}{{ matrix_hookshot_provisioning_internal }}"
199-
200190
# Valid values: error, warn, info, debug
201191
matrix_hookshot_logging_level: warn
202192

@@ -289,15 +279,7 @@ matrix_hookshot_container_labels_widgets_traefik_entrypoints: "{{ matrix_hooksho
289279
matrix_hookshot_container_labels_widgets_traefik_tls: "{{ matrix_hookshot_container_labels_widgets_traefik_entrypoints != 'web' }}"
290280
matrix_hookshot_container_labels_widgets_traefik_tls_certResolver: "{{ matrix_hookshot_container_labels_traefik_tls_certResolver }}" # noqa var-naming
291281

292-
# Controls whether labels will be added that expose Hookshot's provisioning endpoint
293-
matrix_hookshot_container_labels_provisioning_enabled: "{{ matrix_hookshot_provisioning_enabled }}"
294-
matrix_hookshot_container_labels_provisioning_traefik_rule: "Host(`{{ matrix_hookshot_provisioning_hostname }}`) && PathPrefix(`{{ matrix_hookshot_provisioning_endpoint }}`)"
295-
matrix_hookshot_container_labels_provisioning_traefik_priority: 0
296-
matrix_hookshot_container_labels_provisioning_traefik_entrypoints: "{{ matrix_hookshot_container_labels_traefik_entrypoints }}"
297-
matrix_hookshot_container_labels_provisioning_traefik_tls: "{{ matrix_hookshot_container_labels_provisioning_traefik_entrypoints != 'web' }}"
298-
matrix_hookshot_container_labels_provisioning_traefik_tls_certResolver: "{{ matrix_hookshot_container_labels_traefik_tls_certResolver }}" # noqa var-naming
299-
300-
# Controls whether labels will be added that expose Hookshot's provisioning endpoint
282+
# Controls whether labels will be added that expose Hookshot's metrics endpoint
301283
matrix_hookshot_container_labels_metrics_enabled: "{{ matrix_hookshot_metrics_enabled and matrix_hookshot_metrics_proxying_enabled }}"
302284
matrix_hookshot_container_labels_metrics_traefik_rule: "Host(`{{ matrix_hookshot_metrics_proxying_hostname }}`) && PathPrefix(`{{ matrix_hookshot_metrics_proxying_path_prefix }}`)"
303285
matrix_hookshot_container_labels_metrics_traefik_priority: 0

roles/custom/matrix-bridge-hookshot/tasks/validate_config.yml

+7-8
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@
3939
- {'old': 'matrix_hookshot_queue_port', 'new': 'matrix_hookshot_cache_redis_port'}
4040
- {'old': 'matrix_hookshot_experimental_encryption_enabled', 'new': 'matrix_hookshot_encryption_enabled'}
4141
- {'old': 'matrix_hookshot_docker_image_name_prefix', 'new': 'matrix_hookshot_docker_image_registry_prefix'}
42+
- {'old': 'matrix_hookshot_provisioning_enabled', 'new': '<removed - see https://github.com/matrix-org/matrix-hookshot/pull/931 and the `matrix_hookshot_widgets_*` variables>'}
43+
- {'old': 'matrix_hookshot_provisioning_port', 'new': '<removed - see https://github.com/matrix-org/matrix-hookshot/pull/931 and the `matrix_hookshot_widgets_*` variables>'}
44+
- {'old': 'matrix_hookshot_provisioning_secret', 'new': '<removed - see https://github.com/matrix-org/matrix-hookshot/pull/931 and the `matrix_hookshot_widgets_*` variables>'}
45+
- {'old': 'matrix_hookshot_provisioning_internal', 'new': '<removed - see https://github.com/matrix-org/matrix-hookshot/pull/931 and the `matrix_hookshot_widgets_*` variables>'}
46+
- {'old': 'matrix_hookshot_provisioning_hostname', 'new': '<removed - see https://github.com/matrix-org/matrix-hookshot/pull/931 and the `matrix_hookshot_widgets_*` variables>'}
47+
- {'old': 'matrix_hookshot_provisioning_endpoint', 'new': '<removed - see https://github.com/matrix-org/matrix-hookshot/pull/931 and the `matrix_hookshot_widgets_*` variables>'}
48+
- {'old': 'matrix_hookshot_container_labels_provisioning_enabled', 'new': '<removed - see https://github.com/matrix-org/matrix-hookshot/pull/931 and the `matrix_hookshot_widgets_*` variables>'}
4249

4350
- name: Fail if required Hookshot settings not defined
4451
ansible.builtin.fail:
@@ -92,14 +99,6 @@
9299
You need to define at least one Figma instance in `matrix_hookshot_figma_instances` to enable Figma.
93100
when: "matrix_hookshot_figma_enabled and matrix_hookshot_figma_instances | length == 0"
94101

95-
- name: Fail if required provisioning settings not defined
96-
ansible.builtin.fail:
97-
msg: >-
98-
You need to define a required configuration setting (`{{ item }}`) to enable provisioning.
99-
when: "matrix_hookshot_provisioning_enabled and vars[item] == ''"
100-
with_items:
101-
- "matrix_hookshot_provisioning_secret"
102-
103102
- name: Fail if no Redis queue enabled when Hookshot encryption is enabled
104103
ansible.builtin.fail:
105104
msg: >-

roles/custom/matrix-bridge-hookshot/templates/config.yaml.j2

+1-13
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,6 @@ feeds:
8989
pollIntervalSeconds: {{ matrix_hookshot_feeds_pollIntervalSeconds | to_json }}
9090
pollTimeoutSeconds: {{ matrix_hookshot_feeds_pollTimeoutSeconds | to_json }}
9191
{% endif %}
92-
{% if matrix_hookshot_provisioning_enabled %}
93-
provisioning:
94-
# (Optional) Provisioning API for integration managers
95-
#
96-
secret: {{ matrix_hookshot_provisioning_secret | to_json }}
97-
{% endif %}
9892
passFile:
9993
# A passkey used to encrypt tokens stored inside the bridge.
10094
# Run openssl genpkey -out passkey.pem -outform PEM -algorithm RSA -pkeyopt rsa_keygen_bits:4096 to generate
@@ -143,7 +137,7 @@ permissions: {{ matrix_hookshot_permissions | to_json }}
143137
listeners:
144138
# (Optional) HTTP Listener configuration.
145139
# Bind resource endpoints to ports and addresses.
146-
# 'resources' may be any of webhooks, widgets, metrics, provisioning, appservice
140+
# 'resources' may be any of webhooks, widgets, metrics
147141
#
148142
{# always enabled since all services need it #}
149143
- port: {{ matrix_hookshot_webhook_port }}
@@ -156,12 +150,6 @@ listeners:
156150
resources:
157151
- metrics
158152
{% endif %}
159-
{% if matrix_hookshot_provisioning_enabled %}
160-
- port: {{ matrix_hookshot_provisioning_port }}
161-
bindAddress: 0.0.0.0
162-
resources:
163-
- provisioning
164-
{% endif %}
165153
{% if matrix_hookshot_widgets_enabled %}
166154
- port: {{ matrix_hookshot_widgets_port }}
167155
bindAddress: 0.0.0.0

roles/custom/matrix-bridge-hookshot/templates/labels.j2

-32
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ traefik.docker.network={{ matrix_hookshot_container_labels_traefik_docker_networ
1414
traefik.http.services.matrix-hookshot-webhooks.loadbalancer.server.port={{ matrix_hookshot_webhook_port }}
1515
traefik.http.services.matrix-hookshot-appservice.loadbalancer.server.port={{ matrix_hookshot_appservice_port }}
1616
traefik.http.services.matrix-hookshot-widgets.loadbalancer.server.port={{ matrix_hookshot_widgets_port }}
17-
traefik.http.services.matrix-hookshot-provisioning.loadbalancer.server.port={{ matrix_hookshot_provisioning_port }}
1817
traefik.http.services.matrix-hookshot-metrics.loadbalancer.server.port={{ matrix_hookshot_metrics_port }}
1918

2019
{% if matrix_hookshot_container_labels_webhooks_enabled %}
@@ -118,37 +117,6 @@ traefik.http.routers.matrix-hookshot-widgets.tls.certResolver={{ matrix_hookshot
118117
############################################################
119118
{% endif %}
120119

121-
{% if matrix_hookshot_container_labels_provisioning_enabled %}
122-
############################################################
123-
# #
124-
# Provisioning #
125-
# #
126-
############################################################
127-
128-
traefik.http.middlewares.matrix-hookshot-provisioning-strip-prefix.stripprefix.prefixes={{ matrix_hookshot_provisioning_endpoint }}
129-
130-
traefik.http.routers.matrix-hookshot-provisioning.rule={{ matrix_hookshot_container_labels_provisioning_traefik_rule }}
131-
traefik.http.routers.matrix-hookshot-provisioning.middlewares=matrix-hookshot-provisioning-strip-prefix
132-
133-
{% if matrix_hookshot_container_labels_provisioning_traefik_priority | int > 0 %}
134-
traefik.http.routers.matrix-hookshot-provisioning.priority={{ matrix_hookshot_container_labels_provisioning_traefik_priority }}
135-
{% endif %}
136-
137-
traefik.http.routers.matrix-hookshot-provisioning.service=matrix-hookshot-provisioning
138-
traefik.http.routers.matrix-hookshot-provisioning.entrypoints={{ matrix_hookshot_container_labels_provisioning_traefik_entrypoints }}
139-
140-
traefik.http.routers.matrix-hookshot-provisioning.tls={{ matrix_hookshot_container_labels_provisioning_traefik_tls | to_json }}
141-
{% if matrix_hookshot_container_labels_provisioning_traefik_tls %}
142-
traefik.http.routers.matrix-hookshot-provisioning.tls.certResolver={{ matrix_hookshot_container_labels_provisioning_traefik_tls_certResolver }}
143-
{% endif %}
144-
145-
############################################################
146-
# #
147-
# /Provisioning #
148-
# #
149-
############################################################
150-
{% endif %}
151-
152120

153121
{% if matrix_hookshot_container_labels_metrics_enabled %}
154122
############################################################

0 commit comments

Comments
 (0)