From 5e1d96c727c7aa92e38c05eb23d9f1c1e5ca271a Mon Sep 17 00:00:00 2001 From: Plailect Date: Thu, 31 Jan 2019 11:20:45 -0500 Subject: [PATCH] Add `matrix_appservice_irc_container_expose_client_server_api_port` --- group_vars/matrix-servers | 10 ++++++++++ roles/matrix-synapse/defaults/main.yml | 3 +++ .../systemd/matrix-appservice-irc.service.j2 | 2 ++ 3 files changed, 15 insertions(+) diff --git a/group_vars/matrix-servers b/group_vars/matrix-servers index 7d4beccea..30e55131f 100644 --- a/group_vars/matrix-servers +++ b/group_vars/matrix-servers @@ -9,6 +9,16 @@ # You can also override ANY variable (seen here or in any given role), # by re-defining it in your own configuration file (`inventory/host_vars/matrix.`). +###################################################################### +# +# matrix-appservice-irc +# +###################################################################### + +# Normally, matrix-nginx-proxy is enabled and nginx can reach matrix-appservice-irc over the container network. +# If matrix-nginx-proxy is not enabled, or you otherwise have a need for it, you can expose +# matrix-appservice-irc's client-server port to the local host (`127.0.0.1:9999`). +matrix_appservice_irc_container_expose_client_server_api_port: "{{ not matrix_nginx_proxy_enabled }}" ###################################################################### # diff --git a/roles/matrix-synapse/defaults/main.yml b/roles/matrix-synapse/defaults/main.yml index 33e191621..5b8b6fc85 100644 --- a/roles/matrix-synapse/defaults/main.yml +++ b/roles/matrix-synapse/defaults/main.yml @@ -10,6 +10,9 @@ matrix_synapse_ext_path: "{{ matrix_synapse_base_path }}/ext" # Controls whether the Synapse container exposes the Client/Server API port (tcp/8008). matrix_synapse_container_expose_client_server_api_port: false +# Controls whether the Appservice IRC container exposes the Client/Server API port (tcp/9999). +matrix_appservice_irc_container_expose_client_server_api_port: false + # List of systemd services that matrix-synapse.service depends on matrix_synapse_systemd_required_services_list: ['docker.service'] diff --git a/roles/matrix-synapse/templates/ext/appservice-irc/systemd/matrix-appservice-irc.service.j2 b/roles/matrix-synapse/templates/ext/appservice-irc/systemd/matrix-appservice-irc.service.j2 index 194a791df..2353796b0 100644 --- a/roles/matrix-synapse/templates/ext/appservice-irc/systemd/matrix-appservice-irc.service.j2 +++ b/roles/matrix-synapse/templates/ext/appservice-irc/systemd/matrix-appservice-irc.service.j2 @@ -13,7 +13,9 @@ ExecStart=/usr/bin/docker run --rm --name matrix-appservice-irc \ --log-driver=none \ -e "UID={{ matrix_user_uid }}" -e "GID={{ matrix_user_gid }}" \ --network={{ matrix_docker_network }} \ + {% if matrix_appservice_irc_container_expose_client_server_api_port %} -p 127.0.0.1:9999:9999 \ + {% endif %} -v {{ matrix_appservice_irc_base_path }}:/data:z \ {{ matrix_appservice_irc_docker_image }} \ -c /data/config.yaml -f /data/registration.yaml -p 9999