From 207030cb48c06e83e3e9d9baebdbc595340d7dd8 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 3 Feb 2025 23:07:42 +0100 Subject: [PATCH] Solved matrix port bug --- group_vars/all/09_ports.yml | 2 +- roles/docker-compose/tasks/main.yml | 5 +++-- roles/docker-matrix-compose/templates/nginx.conf.j2 | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/group_vars/all/09_ports.yml b/group_vars/all/09_ports.yml index cdcfe198..aa38e612 100644 --- a/group_vars/all/09_ports.yml +++ b/group_vars/all/09_ports.yml @@ -25,7 +25,7 @@ ports: roulette-wheel: 8013 joomla: 8014 attendize: 8015 - matrix: 8016 + #matrix: 8016 Not used anymore baserow: 8017 matomo: 8018 listmonk: 8019 diff --git a/roles/docker-compose/tasks/main.yml b/roles/docker-compose/tasks/main.yml index 8f598c51..4d72985d 100644 --- a/roles/docker-compose/tasks/main.yml +++ b/roles/docker-compose/tasks/main.yml @@ -5,11 +5,12 @@ - name: "Set global domain based on application_id" set_fact: domain: "{{ domains[application_id] if application_id in domains else None }}" - # Default case: One Domain exists. Some applications like matrix don't have an default key + # Default case: One domain exists. Some applications like matrix don't have an default domain - name: "Set global http_port to {{ ports.localhost.http_ports[application_id] }}" set_fact: - http_port: "{{ ports.localhost.http_ports[application_id] }}" + http_port: "{{ ports.localhost.http_ports[application_id] if application_id in ports.localhost.http_ports else None }}" + # Default case: One port exists. Some applications like matrix don't have an default port - name: "remove {{ docker_compose_instance_directory }} and all its contents" file: diff --git a/roles/docker-matrix-compose/templates/nginx.conf.j2 b/roles/docker-matrix-compose/templates/nginx.conf.j2 index 08876f58..2695045e 100644 --- a/roles/docker-matrix-compose/templates/nginx.conf.j2 +++ b/roles/docker-matrix-compose/templates/nginx.conf.j2 @@ -1,6 +1,7 @@ server { # Somehow .j2 doesn't interpretate the passed variable right. For this reasons this redeclaration is necessary {% set domain = domains.matrix_synapse %} + {% set http_port = ports.localhost.http_ports.matrix_synapse %} server_name {{domain}}; {% include 'roles/letsencrypt/templates/ssl_header.j2' %}