From ea32b08a7b775480ddc476fdd045654af3fa44f2 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 20 Jan 2024 12:46:07 +0100 Subject: [PATCH] Solved matrix bugs --- roles/docker-compose/handlers/main.yml | 10 +++++----- roles/docker-matrix-compose/README.md | 13 +++++++++++++ roles/docker-matrix-compose/tasks/main.yml | 13 +++++++++++-- .../templates/docker-compose.yml.j2 | 4 +--- .../templates/nginx.conf.j2 | 17 +---------------- .../templates/synapse/homeserver.yaml.j2 | 2 +- 6 files changed, 32 insertions(+), 27 deletions(-) diff --git a/roles/docker-compose/handlers/main.yml b/roles/docker-compose/handlers/main.yml index 74b27d8a..86371ba0 100644 --- a/roles/docker-compose/handlers/main.yml +++ b/roles/docker-compose/handlers/main.yml @@ -2,11 +2,11 @@ # It is necessary to shut the projects down, when reset is activated. # Otherwise it can lead to this bug: # https://github.com/ansible/ansible/issues/10244 -- name: shut down docker compose project - command: - cmd: docker-compose -p "{{docker_compose_project_name}}" down - listen: docker compose project setup - when: mode_reset | bool +#- name: shut down docker compose project +# command: +# cmd: docker-compose -p "{{docker_compose_project_name}}" down +# listen: docker compose project setup +# when: mode_reset | bool - name: docker compose project setup command: diff --git a/roles/docker-matrix-compose/README.md b/roles/docker-matrix-compose/README.md index d6a9f63f..a5238e46 100644 --- a/roles/docker-matrix-compose/README.md +++ b/roles/docker-matrix-compose/README.md @@ -43,6 +43,19 @@ for db in matrix mautrix_whatsapp_bridge mautrix_telegram_bridge mautrix_signal_ docker compose down -v ``` +## Bridges + +### General +Contact one of the following bots for more information: + +- @signalbot:yourdomain.tld +- @telegrambot:yourdomain.tld +- @whatsappbot:yourdomain.tld +- @slackbot:yourdomain.tld + +### Slack +For login with Token checkout [this guide](https://docs.mau.fi/bridges/go/slack/authentication.html). + ## Debug: - https://federationtester.matrix.org/ diff --git a/roles/docker-matrix-compose/tasks/main.yml b/roles/docker-matrix-compose/tasks/main.yml index 63786bdb..608dcf75 100644 --- a/roles/docker-matrix-compose/tasks/main.yml +++ b/roles/docker-matrix-compose/tasks/main.yml @@ -96,8 +96,17 @@ dest: "{{docker_compose_instance_directory}}docker-compose.yml" notify: docker compose project setup -- name: flush docker service - meta: flush_handlers +- name: docker compose project setup + command: + cmd: docker-compose -p "{{docker_compose_project_name}}" up -d --force-recreate + chdir: "{{docker_compose_instance_directory}}" + environment: + COMPOSE_HTTP_TIMEOUT: 600 + DOCKER_CLIENT_TIMEOUT: 600 + register: result + until: result is succeeded + retries: 12 + delay: 30 - name: wait for registration files wait_for: diff --git a/roles/docker-matrix-compose/templates/docker-compose.yml.j2 b/roles/docker-matrix-compose/templates/docker-compose.yml.j2 index 2c454373..5ddee783 100644 --- a/roles/docker-matrix-compose/templates/docker-compose.yml.j2 +++ b/roles/docker-matrix-compose/templates/docker-compose.yml.j2 @@ -30,9 +30,7 @@ services: {% include 'templates/docker/container/depends-on-also-database.yml.j2' %} {% for item in bridges %} mautrix-{{item.bridge_name}}: - # The condition service_healthy does not work. - # In practice is does not make a difference anyhow, due to the reason that synapse will restart until it is running - condition: service_started + condition: service_healthy {% endfor %} {% include 'templates/docker/container/networks.yml.j2' %} diff --git a/roles/docker-matrix-compose/templates/nginx.conf.j2 b/roles/docker-matrix-compose/templates/nginx.conf.j2 index 847790c5..65f59957 100644 --- a/roles/docker-matrix-compose/templates/nginx.conf.j2 +++ b/roles/docker-matrix-compose/templates/nginx.conf.j2 @@ -10,20 +10,5 @@ server { {% include 'roles/nginx-matomo-tracking/templates/matomo-tracking.conf.j2' %} {% endif %} - location ~ ^(/_matrix|/_synapse/client) { - # note: do not add a path (even a single /) after the port in `proxy_pass`, - # otherwise nginx will canonicalise the URI and cause signature verification - # errors. - proxy_pass http://127.0.0.1:{{http_port}}; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header Host $host; - - # Nginx by default only allows file uploads up to 1M in size - # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml - client_max_body_size 50M; - - # Synapse responses may be chunked, which is an HTTP/1.1 feature. - proxy_http_version 1.1; - } + {% include 'roles/nginx-docker-reverse-proxy/templates/proxy_pass.conf.j2' %} } \ No newline at end of file diff --git a/roles/docker-matrix-compose/templates/synapse/homeserver.yaml.j2 b/roles/docker-matrix-compose/templates/synapse/homeserver.yaml.j2 index f8573631..40286e19 100644 --- a/roles/docker-matrix-compose/templates/synapse/homeserver.yaml.j2 +++ b/roles/docker-matrix-compose/templates/synapse/homeserver.yaml.j2 @@ -18,7 +18,7 @@ database: cp_min: 5 cp_max: 10 log_config: "/data/{{domain_matrix_synapse}}.log.config" -media_store_path: /data/media_store +media_store_path: "/data/media_store" registration_shared_secret: "{{matrix_registration_shared_secret}}" report_stats: true macaroon_secret_key: "{{matrix_macaroon_secret_key}}"