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

Fix Telegram bridge HTTP proxying when not using matrix-nginx-proxy

From what I see, this was never implemented to begin with.

Fixes #189 (Github Issue).
pull/194/head
Slavi Pantaleev 6 лет назад
Родитель
Сommit
7379968a3c
5 измененных файлов: 18 добавлений и 5 удалений
  1. +2
    -0
      group_vars/matrix_servers
  2. +4
    -2
      roles/matrix-bridge-mautrix-telegram/defaults/main.yml
  3. +1
    -1
      roles/matrix-bridge-mautrix-telegram/tasks/setup_install.yml
  4. +9
    -0
      roles/matrix-bridge-mautrix-telegram/tasks/validate_config.yml
  5. +2
    -2
      roles/matrix-bridge-mautrix-telegram/templates/systemd/matrix-mautrix-telegram.service.j2

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

@@ -122,6 +122,8 @@ matrix_mautrix_telegram_systemd_required_services_list: |


matrix_mautrix_telegram_public_endpoint: "/{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'telegram') | to_uuid }}" matrix_mautrix_telegram_public_endpoint: "/{{ matrix_synapse_macaroon_secret_key | password_hash('sha512', 'telegram') | to_uuid }}"


matrix_mautrix_telegram_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:9006' }}"

###################################################################### ######################################################################
# #
# /matrix-bridge-mautrix-telegram # /matrix-bridge-mautrix-telegram


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

@@ -21,8 +21,10 @@ matrix_mautrix_telegram_homeserver_domain: '{{ matrix_domain }}'
matrix_mautrix_telegram_appservice_address: 'http://matrix-mautrix-telegram:8080' matrix_mautrix_telegram_appservice_address: 'http://matrix-mautrix-telegram:8080'
matrix_mautrix_telegram_appservice_public_external: 'https://{{ matrix_server_fqn_matrix }}{{ matrix_mautrix_telegram_public_endpoint }}' matrix_mautrix_telegram_appservice_public_external: 'https://{{ matrix_server_fqn_matrix }}{{ matrix_mautrix_telegram_public_endpoint }}'


# Set this to a port number to expose on the host when not using matrix-nginx-proxy
matrix_mautrix_telegram_container_exposed_port_number: ~
# Controls whether the matrix-telegram container exposes its HTTP port (tcp/8080 in the container).
#
# Takes an "<ip>:<port>" or "<port>" value (e.g. "127.0.0.1:9006"), or empty string to not expose.
matrix_mautrix_telegram_container_http_host_bind_port: ''


# A list of extra arguments to pass to the container # A list of extra arguments to pass to the container
matrix_mautrix_telegram_container_extra_arguments: [] matrix_mautrix_telegram_container_extra_arguments: []


+ 1
- 1
roles/matrix-bridge-mautrix-telegram/tasks/setup_install.yml Просмотреть файл

@@ -112,7 +112,7 @@
proxy_pass http://$backend; proxy_pass http://$backend;
{% else %} {% else %}
{# Generic configuration for use outside of our container setup #} {# Generic configuration for use outside of our container setup #}
proxy_pass http://127.0.0.1:8080;
proxy_pass http://127.0.0.1:9006;
{% endif %} {% endif %}
} }




+ 9
- 0
roles/matrix-bridge-mautrix-telegram/tasks/validate_config.yml Просмотреть файл

@@ -9,3 +9,12 @@
- "matrix_mautrix_telegram_api_id" - "matrix_mautrix_telegram_api_id"
- "matrix_mautrix_telegram_api_hash" - "matrix_mautrix_telegram_api_hash"
- "matrix_mautrix_telegram_public_endpoint" - "matrix_mautrix_telegram_public_endpoint"

- name: (Deprecation) Catch and report renamed Telegram variables
fail:
msg: >-
Your configuration contains a variable, which now has a different name.
Please change your configuration to rename the variable (`{{ item.old }}` -> `{{ item.new }}`).
when: "item.old in vars"
with_items:
- {'old': 'matrix_mautrix_telegram_container_exposed_port_number', 'new': '<superseded by matrix_mautrix_telegram_container_http_host_bind_port>'}

+ 2
- 2
roles/matrix-bridge-mautrix-telegram/templates/systemd/matrix-mautrix-telegram.service.j2 Просмотреть файл

@@ -26,8 +26,8 @@ ExecStart=/usr/bin/docker run --rm --name matrix-mautrix-telegram \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \ --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \ --cap-drop=ALL \
--network={{ matrix_docker_network }} \ --network={{ matrix_docker_network }} \
{% if matrix_mautrix_telegram_container_exposed_port_number is not none %}
-p 127.0.0.1:{{ matrix_mautrix_telegram_container_exposed_port_number }}:8080 \
{% if matrix_mautrix_telegram_container_http_host_bind_port %}
-p {{ matrix_mautrix_telegram_container_http_host_bind_port }}:8080 \
{% endif %} {% endif %}
-v {{ matrix_mautrix_telegram_base_path }}:/data:z \ -v {{ matrix_mautrix_telegram_base_path }}:/data:z \
{% for arg in matrix_mautrix_telegram_container_extra_arguments %} {% for arg in matrix_mautrix_telegram_container_extra_arguments %}


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