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).
This commit is contained in:
Slavi Pantaleev 2019-05-26 20:50:52 +03:00
parent 120abaf391
commit 7379968a3c
5 changed files with 18 additions and 5 deletions

View file

@ -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_container_http_host_bind_port: "{{ '' if matrix_nginx_proxy_enabled else '127.0.0.1:9006' }}"
######################################################################
#
# /matrix-bridge-mautrix-telegram

View file

@ -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_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
matrix_mautrix_telegram_container_extra_arguments: []

View file

@ -112,7 +112,7 @@
proxy_pass http://$backend;
{% else %}
{# 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 %}
}

View file

@ -9,3 +9,12 @@
- "matrix_mautrix_telegram_api_id"
- "matrix_mautrix_telegram_api_hash"
- "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>'}

View file

@ -26,8 +26,8 @@ ExecStart=/usr/bin/docker run --rm --name matrix-mautrix-telegram \
--user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
--cap-drop=ALL \
--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 %}
-v {{ matrix_mautrix_telegram_base_path }}:/data:z \
{% for arg in matrix_mautrix_telegram_container_extra_arguments %}