Просмотр исходного кода

Remove wsproxy PathPrefix, it needs a subdomain

There's no setting in the iMessage bridge that allows a path.
Also don't bind port by default, wsproxy has no TLS.
Syncproxy should never expose a port, it's only internal.
pull/2261/head
Johan Swetzén 2 лет назад
Родитель
Сommit
67fc739fba
4 измененных файлов: 4 добавлений и 22 удалений
  1. +1
    -2
      group_vars/matrix_servers
  2. +2
    -5
      roles/custom/matrix-bridge-mautrix-wsproxy/defaults/main.yml
  3. +0
    -3
      roles/custom/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2
  4. +1
    -12
      roles/custom/matrix-bridge-mautrix-wsproxy/templates/wsproxy-labels.j2

+ 1
- 2
group_vars/matrix_servers Просмотреть файл

@@ -1239,8 +1239,7 @@ matrix_mautrix_wsproxy_systemd_required_services_list: |
matrix_mautrix_wsproxy_homeserver_domain: "{{ matrix_domain }}"

matrix_mautrix_wsproxy_homeserver_address: "{{ matrix_homeserver_container_url }}"
matrix_mautrix_wsproxy_hostname: "{{ matrix_server_fqn_matrix }}"
matrix_mautrix_wsproxy_path_prefix: /_matrix/wsproxy
matrix_mautrix_wsproxy_hostname: "wsproxy.{{ matrix_mautrix_wsproxy_homeserver_domain }}"

matrix_mautrix_wsproxy_container_additional_networks: |
{{


+ 2
- 5
roles/custom/matrix-bridge-mautrix-wsproxy/defaults/main.yml Просмотреть файл

@@ -15,13 +15,12 @@ matrix_mautrix_wsproxy_config_path: "{{ matrix_mautrix_wsproxy_base_path }}/conf
matrix_mautrix_wsproxy_homeserver_address: "{{ matrix_homeserver_container_url }}"
matrix_mautrix_wsproxy_homeserver_domain: "{{ matrix_domain }}"

matrix_mautrix_wsproxy_bind_port: true
matrix_mautrix_wsproxy_bind_port: false
matrix_mautrix_wsproxy_port: 29331

matrix_mautrix_wsproxy_appservice_address: "http://matrix-mautrix-wsproxy:{{ matrix_mautrix_wsproxy_port }}"

matrix_mautrix_wsproxy_hostname: ""
matrix_mautrix_wsproxy_path_prefix: ""

# The base container network. It will be auto-created by this role if it doesn't exist already.
matrix_mautrix_wsproxy_container_network: matrix-mautrix-wsproxy
@@ -34,8 +33,7 @@ matrix_mautrix_wsproxy_container_labels_traefik_enabled: true
matrix_mautrix_wsproxy_container_labels_traefik_docker_network: "{{ matrix_mautrix_wsproxy_container_network }}"
matrix_mautrix_wsproxy_container_labels_traefik_hostname: "{{ matrix_mautrix_wsproxy_hostname }}"
# The path prefix must either be `/` or not end with a slash (e.g. `/wsproxy`).
matrix_mautrix_wsproxy_container_labels_traefik_path_prefix: "{{ matrix_mautrix_wsproxy_path_prefix }}"
matrix_mautrix_wsproxy_container_labels_traefik_rule: "Host(`{{ matrix_mautrix_wsproxy_container_labels_traefik_hostname }}`){% if matrix_mautrix_wsproxy_container_labels_traefik_path_prefix != '/' %} && PathPrefix(`{{ matrix_mautrix_wsproxy_container_labels_traefik_path_prefix }}`){% endif %}"
matrix_mautrix_wsproxy_container_labels_traefik_rule: "Host(`{{ matrix_mautrix_wsproxy_container_labels_traefik_hostname }}`)"
matrix_mautrix_wsproxy_container_labels_traefik_priority: 0
matrix_mautrix_wsproxy_container_labels_traefik_entrypoints: web-secure
matrix_mautrix_wsproxy_container_labels_traefik_tls: "{{ matrix_mautrix_wsproxy_container_labels_traefik_entrypoints != 'web' }}"
@@ -140,7 +138,6 @@ matrix_mautrix_wsproxy_syncproxy_systemd_wanted_services_list: []

matrix_mautrix_wsproxy_syncproxy_shared_secret: ''
matrix_mautrix_wsproxy_syncproxy_port: 29332
matrix_mautrix_wsproxy_syncproxy_bind_port: true
matrix_mautrix_wsproxy_syncproxy_appservice_address: "http://matrix-mautrix-wsproxy-syncproxy:{{ matrix_mautrix_wsproxy_syncproxy_port }}"

# Database-related configuration fields


+ 0
- 3
roles/custom/matrix-bridge-mautrix-wsproxy/templates/systemd/matrix-mautrix-wsproxy-syncproxy.service.j2 Просмотреть файл

@@ -24,9 +24,6 @@ ExecStart={{ devture_systemd_docker_base_host_command_docker }} run --rm --name
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--network={{ matrix_docker_network }} \
{% if matrix_mautrix_wsproxy_syncproxy_bind_port %}
-p {{ matrix_mautrix_wsproxy_syncproxy_port }}:29331 \
{% endif %}
--env-file={{ matrix_mautrix_wsproxy_base_path }}/syncproxy-env \
{% for arg in matrix_mautrix_wsproxy_syncproxy_container_extra_arguments %}
{{ arg }} \


+ 1
- 12
roles/custom/matrix-bridge-mautrix-wsproxy/templates/wsproxy-labels.j2 Просмотреть файл

@@ -7,17 +7,6 @@ traefik.docker.network={{ matrix_mautrix_wsproxy_container_labels_traefik_docker

{% set middlewares = [] %}

{% if matrix_mautrix_wsproxy_container_labels_traefik_path_prefix != '/' %}
traefik.http.middlewares.matrix-mautrix-wsproxy-slashless-redirect.redirectregex.regex=({{ matrix_mautrix_wsproxy_container_labels_traefik_path_prefix | quote }})$
traefik.http.middlewares.matrix-mautrix-wsproxy-slashless-redirect.redirectregex.replacement=${1}/
{% set middlewares = middlewares + ['matrix-mautrix-wsproxy-slashless-redirect'] %}
{% endif %}

{% if matrix_mautrix_wsproxy_container_labels_traefik_path_prefix != '/' %}
traefik.http.middlewares.matrix-mautrix-wsproxy-strip-prefix.stripprefix.prefixes={{ matrix_mautrix_wsproxy_container_labels_traefik_path_prefix }}
{% set middlewares = middlewares + ['matrix-mautrix-wsproxy-strip-prefix'] %}
{% endif %}

{% if matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers.keys() | length > 0 %}
{% for name, value in matrix_mautrix_wsproxy_container_labels_traefik_additional_response_headers.items() %}
traefik.http.middlewares.matrix-mautrix-wsproxy-add-headers.headers.customresponseheaders.{{ name }}={{ value }}
@@ -39,7 +28,7 @@ traefik.http.routers.matrix-mautrix-wsproxy.tls={{ matrix_mautrix_wsproxy_contai
traefik.http.routers.matrix-mautrix-wsproxy.tls.certResolver={{ matrix_mautrix_wsproxy_container_labels_traefik_tls_certResolver }}
{% endif %}

traefik.http.services.matrix-sliding-sync.loadbalancer.server.port=8008
traefik.http.services.matrix-mautrix-wsproxy.loadbalancer.server.port={{ matrix_mautrix_wsproxy_port }}
{% endif %}

{{ matrix_mautrix_wsproxy_container_labels_additional_labels }}

Загрузка…
Отмена
Сохранить