diff --git a/roles/web-app-matrix/tasks/03_webserver.yml b/roles/web-app-matrix/tasks/03_webserver.yml index e26720b1..89aea52d 100644 --- a/roles/web-app-matrix/tasks/03_webserver.yml +++ b/roles/web-app-matrix/tasks/03_webserver.yml @@ -28,6 +28,6 @@ src: "templates/nginx.conf.j2" dest: "{{ NGINX.DIRECTORIES.HTTP.SERVERS }}{{ MATRIX_SYNAPSE_DOMAIN }}.conf" vars: - domain: "{{ MATRIX_SYNAPSE_DOMAIN }}" # Didn't work in the past. May it works now. This does not seem to work @todo Check how to solve without declaring set_fact, seems a bug at templates + domain: "{{ MATRIX_SYNAPSE_DOMAIN }}" http_port: "{{ MATRIX_SYNAPSE_PORT }}" notify: restart openresty \ No newline at end of file diff --git a/roles/web-app-matrix/templates/nginx.conf.j2 b/roles/web-app-matrix/templates/nginx.conf.j2 index 18620f58..43cf066b 100644 --- a/roles/web-app-matrix/templates/nginx.conf.j2 +++ b/roles/web-app-matrix/templates/nginx.conf.j2 @@ -1,10 +1,4 @@ server { - {# Somehow .j2 doesn't interpretate the passed variable right. For this reasons this redeclaration is necessary #} - {# Could be that this is related to the set_fact use #} - {% set domain = MATRIX_SYNAPSE_DOMAIN | mandatory("MATRIX_SYNAPSE_DOMAIN is required") %} - {% set http_port = MATRIX_SYNAPSE_PORT | mandatory("MATRIX_PORT is required") %} - {% set FEDERATION_PORT = http_port %} - server_name {{ domain }}; {% include 'roles/srv-web-7-7-letsencrypt/templates/ssl_header.j2' %} @@ -17,4 +11,4 @@ server { {% include 'roles/srv-proxy-7-4-core/templates/location/html.conf.j2' %} {% include 'roles/srv-proxy-7-4-core/templates/location/upload.conf.j2' %} -} \ No newline at end of file +} diff --git a/roles/web-app-matrix/vars/main.yml b/roles/web-app-matrix/vars/main.yml index 92332184..0421edb5 100644 --- a/roles/web-app-matrix/vars/main.yml +++ b/roles/web-app-matrix/vars/main.yml @@ -17,6 +17,7 @@ MATRIX_WELL_KNOWN_FILE: "{{ MATRIX_WELL_KNOWN_DIRECTORY }}server" MATRIX_PROJECT: "{{ application_id | get_entity_name }}" MATRIX_REGISTRATION_FILE_FOLDER: "/data/" MATRIX_REGISTRATION_SHARED_SECRET: "{{ applications | get_app_conf(application_id, 'credentials.registration_shared_secret') }}" +FEDERATION_PORT: "{{ ports.public.federation['web-app-matrix_synapse'] }}" ## Synapse MATRIX_SYNAPSE_VERSION: "{{ applications | get_app_conf(application_id, 'docker.services.synapse.version') }}"