From 44c41311ba4b86b119d1e926276036e379079863 Mon Sep 17 00:00:00 2001 From: Administrator Date: Thu, 23 Oct 2025 13:51:01 +0000 Subject: [PATCH] Update 2 files - /roles/matrix/templates/docker-compose.yml.j2 - /roles/matrix/files/homeserver.yaml --- roles/matrix/files/homeserver.yaml | 49 ++++++++++++ roles/matrix/templates/docker-compose.yml.j2 | 81 ++++++++------------ 2 files changed, 81 insertions(+), 49 deletions(-) create mode 100644 roles/matrix/files/homeserver.yaml diff --git a/roles/matrix/files/homeserver.yaml b/roles/matrix/files/homeserver.yaml new file mode 100644 index 0000000..09140bc --- /dev/null +++ b/roles/matrix/files/homeserver.yaml @@ -0,0 +1,49 @@ +server_name: "{{ matrix_server_name }}" +pid_file: /data/homeserver.pid +public_baseurl: "https://{{ matrix_domain }}/" +listeners: + - port: 8008 + tls: false + type: http + x_forwarded: true + resources: + - names: [client, federation] + compress: false +database: + name: psycopg2 + args: + user: synapse + password: "{{ vault_matrix_postgres_password }}" + database: synapse + host: matrix-postgres + cp_min: 5 + cp_max: 10 +log_config: "/data/log.config" +media_store_path: /data/media_store +uploads_path: /data/uploads +enable_registration: {{ matrix_registration_enabled | bool | lower }} +enable_registration_without_verification: false +registration_shared_secret: "{{ vault_matrix_synapse_secret }}" +macaroon_secret_key: "{{ vault_matrix_macaroon_secret }}" +form_secret: "{{ vault_matrix_form_secret }}" +report_stats: {{ matrix_report_stats | bool | lower }} +retention: + enabled: true + default_policy: + min_lifetime: 1d + max_lifetime: 30d +url_preview_enabled: true +url_preview_ip_range_blacklist: + - '127.0.0.0/8' + - '10.0.0.0/8' + - '172.16.0.0/12' + - '192.168.0.0/16' + - '100.64.0.0/10' + - '169.254.0.0/16' + - '::1/128' + - 'fe80::/64' + - 'fc00::/7' +max_upload_size: "50M" +# Federation +federation_domain_whitelist: ~ +allow_public_rooms_over_federation: true \ No newline at end of file diff --git a/roles/matrix/templates/docker-compose.yml.j2 b/roles/matrix/templates/docker-compose.yml.j2 index 09140bc..5284ac1 100644 --- a/roles/matrix/templates/docker-compose.yml.j2 +++ b/roles/matrix/templates/docker-compose.yml.j2 @@ -1,49 +1,32 @@ -server_name: "{{ matrix_server_name }}" -pid_file: /data/homeserver.pid -public_baseurl: "https://{{ matrix_domain }}/" -listeners: - - port: 8008 - tls: false - type: http - x_forwarded: true - resources: - - names: [client, federation] - compress: false -database: - name: psycopg2 - args: - user: synapse - password: "{{ vault_matrix_postgres_password }}" - database: synapse - host: matrix-postgres - cp_min: 5 - cp_max: 10 -log_config: "/data/log.config" -media_store_path: /data/media_store -uploads_path: /data/uploads -enable_registration: {{ matrix_registration_enabled | bool | lower }} -enable_registration_without_verification: false -registration_shared_secret: "{{ vault_matrix_synapse_secret }}" -macaroon_secret_key: "{{ vault_matrix_macaroon_secret }}" -form_secret: "{{ vault_matrix_form_secret }}" -report_stats: {{ matrix_report_stats | bool | lower }} -retention: - enabled: true - default_policy: - min_lifetime: 1d - max_lifetime: 30d -url_preview_enabled: true -url_preview_ip_range_blacklist: - - '127.0.0.0/8' - - '10.0.0.0/8' - - '172.16.0.0/12' - - '192.168.0.0/16' - - '100.64.0.0/10' - - '169.254.0.0/16' - - '::1/128' - - 'fe80::/64' - - 'fc00::/7' -max_upload_size: "50M" -# Federation -federation_domain_whitelist: ~ -allow_public_rooms_over_federation: true \ No newline at end of file +version: '3.8' +services: + matrix-postgres: + image: postgres:15 + restart: unless-stopped + environment: + POSTGRES_USER: {{ matrix_postgres_user }} + POSTGRES_PASSWORD: "{{ vault_matrix_postgres_password }}" + POSTGRES_DB: {{ matrix_postgres_db }} + volumes: + - {{ matrix_postgres_dir }}:/var/lib/postgresql/data + networks: + - matrix + + matrix-synapse: + image: matrixdotorg/synapse:latest + restart: unless-stopped + depends_on: + - matrix-postgres + environment: + - SYNAPSE_SERVER_NAME={{ matrix_server_name }} + - SYNAPSE_REPORT_STATS={{ matrix_report_stats | bool | lower }} + volumes: + - {{ matrix_config_dir }}:/data + ports: + - "{{ matrix_port }}:8008" + networks: + - matrix + +networks: + matrix: + driver: bridge \ No newline at end of file