refine hookshot role using --test

This commit is contained in:
HarHarLinks 2022-01-08 16:51:52 +01:00
parent b8ee1980ea
commit 495bfedc0d
7 changed files with 19 additions and 17 deletions

View file

@ -10,6 +10,7 @@ matrix_hookshot_docker_image_force_pull: "{{ matrix_hookshot_docker_image.endswi
matrix_hookshot_base_path: "{{ matrix_base_data_path }}/hookshot"
matrix_hookshot_homeserver_address: "{{ matrix_homeserver_container_url }}"
matrix_hookshot_container_url: 'matrix-hookshot'
matrix_hookshot_public_endpoint: /hookshot

View file

@ -35,13 +35,13 @@
- name: Generate Matrix hookshot proxying configuration for matrix-nginx-proxy
set_fact:
matrix_appservice_webhooks_matrix_nginx_proxy_configuration: |
matrix_hookshot_matrix_nginx_proxy_configuration: |
{% if matrix_hookshot_metrics_enabled %}
location {{ matrix_hookshot_metrics_endpoint }} {
{% if matrix_nginx_proxy_enabled|default(False) %}
{# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s;
set $backend "matrix-hookshot:{{ matrix_hookshot_metrics_port }}";
set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_metrics_port }}";
proxy_pass http://$backend/metrics;
{% else %}
{# Generic configuration for use outside of our container setup #}
@ -58,7 +58,7 @@
{% if matrix_nginx_proxy_enabled|default(False) %}
{# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s;
set $backend "matrix-hookshot:{{ matrix_hookshot_appservice_port }}";
set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_appservice_port }}";
proxy_pass http://$backend/$1;
{% else %}
{# Generic configuration for use outside of our container setup #}
@ -71,7 +71,7 @@
{% if matrix_nginx_proxy_enabled|default(False) %}
{# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s;
set $backend "matrix-hookshot:{{ matrix_hookshot_provisioning_port }}";
set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_provisioning_port }}";
proxy_pass http://$backend/$1;
{% else %}
{# Generic configuration for use outside of our container setup #}
@ -84,7 +84,7 @@
{% if matrix_nginx_proxy_enabled|default(False) %}
{# Use the embedded DNS resolver in Docker containers to discover the service #}
resolver 127.0.0.11 valid=5s;
set $backend "matrix-hookshot:{{ matrix_hookshot_webhook_port }}";
set $backend "{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_webhook_port }}";
proxy_pass http://$backend/$1;
{% else %}
{# Generic configuration for use outside of our container setup #}
@ -93,7 +93,7 @@
proxy_set_header Host $host;
}
- name: Register webhooks Appservice proxying configuration with matrix-nginx-proxy
- name: Register hookshot proxying configuration with matrix-nginx-proxy
set_fact:
matrix_nginx_proxy_proxy_matrix_additional_server_configuration_blocks: |
{{
@ -113,4 +113,4 @@
Please make sure that you're proxying the `{{ matrix_hookshot_public_endpoint }}`
URL endpoint to the matrix-hookshot container.
You can expose the container's ports using the `matrix_hookshot_container_http_host_bind_ports` variable.
when: "matrix_appservice_webhooks_enabled|bool and matrix_nginx_proxy_enabled is not defined"
when: "matrix_hookshot_enabled|bool and matrix_nginx_proxy_enabled is not defined"

View file

@ -21,7 +21,7 @@
- name: Check if hookshot passkey exists
stat:
path: "{{ matrix_hookshot_data_path }}/passkey.pem"
path: "{{ matrix_hookshot_base_path }}/passkey.pem"
register: hookshot_passkey_file
- name: Generate hookshot passkey if it doesn't exist
@ -32,7 +32,7 @@
- name: Ensure hookshot config.yaml installed if provided
copy:
content: "{{ matrix_hookshot_config|to_nice_yaml }}"
content: "{{ matrix_hookshot_configuration|to_nice_yaml }}"
dest: "{{ matrix_hookshot_base_path }}/config.yaml"
mode: 0644
owner: "{{ matrix_user_username }}"

View file

@ -4,7 +4,7 @@ bridge:
#
domain: {{ matrix_domain }}
url: {{ matrix_hookshot_homeserver_address }}
mediaUrl: { matrix_hookshot_homeserver_address }}
mediaUrl: {{ matrix_hookshot_homeserver_address }}
port: {{ matrix_hookshot_appservice_port }}
bindAddress: 0.0.0.0
{% if matrix_hookshot_github_enabled %}

View file

@ -12,5 +12,5 @@ namespaces:
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
url: "http://{{ matrix_hookshot_container_url }}:{{ matrix_hookshot_appservice_port }}" # This should match the bridge.port in your config file
rate_limited: false

View file

@ -13,10 +13,10 @@ 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
ExecStartPre=-{{ matrix_host_command_docker }} kill {{ matrix_hookshot_container_url }}
ExecStartPre=-{{ matrix_host_command_docker }} rm {{ matrix_hookshot_container_url }}
ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-hookshot \
ExecStart={{ matrix_host_command_docker }} run --rm --name {{ matrix_hookshot_container_url }} \
--log-driver=none \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
@ -30,11 +30,11 @@ ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-hookshot \
{% endfor %}
{{ matrix_hookshot_docker_image }}
ExecStop=-{{ matrix_host_command_docker }} kill matrix-hookshot
ExecStop=-{{ matrix_host_command_docker }} rm matrix-hookshot
ExecStop=-{{ matrix_host_command_docker }} kill {{ matrix_hookshot_container_url }}
ExecStop=-{{ matrix_host_command_docker }} rm {{ matrix_hookshot_container_url }}
Restart=always
RestartSec=30
SyslogIdentifier=matrix-hookshot
SyslogIdentifier={{ matrix_hookshot_container_url }}
[Install]
WantedBy=multi-user.target

View file

@ -36,6 +36,7 @@
- matrix-bridge-mx-puppet-instagram
- matrix-bridge-sms
- matrix-bridge-heisenbridge
- matrix-bridge-hookshot
- matrix-bot-matrix-reminder-bot
- matrix-bot-go-neb
- matrix-bot-mjolnir