From b31731ebf843fb3e873a4599f19791b4c5685349 Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Sun, 4 Dec 2022 01:14:20 -0500 Subject: [PATCH 1/2] fix s3 storage provider not ensuring data dir This path is accessed by the s3 storage provider stuff and needs to be ensured. Broken by 7c5c3aedc --- roles/custom/matrix-synapse/defaults/main.yml | 1 + roles/custom/matrix-synapse/tasks/setup_install.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/roles/custom/matrix-synapse/defaults/main.yml b/roles/custom/matrix-synapse/defaults/main.yml index 1a9b18a7..ca8a095c 100644 --- a/roles/custom/matrix-synapse/defaults/main.yml +++ b/roles/custom/matrix-synapse/defaults/main.yml @@ -61,6 +61,7 @@ matrix_synapse_ext_path: "{{ matrix_synapse_base_path }}/ext" matrix_synapse_ext_s3_storage_provider_base_path: "{{ matrix_synapse_base_path }}/ext/s3-storage-provider" matrix_synapse_ext_s3_storage_provider_bin_path: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}/bin" +matrix_synapse_ext_s3_storage_provider_data_path: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}/data" matrix_synapse_container_client_api_port: 8008 diff --git a/roles/custom/matrix-synapse/tasks/setup_install.yml b/roles/custom/matrix-synapse/tasks/setup_install.yml index d1ef7ed4..921df753 100644 --- a/roles/custom/matrix-synapse/tasks/setup_install.yml +++ b/roles/custom/matrix-synapse/tasks/setup_install.yml @@ -16,6 +16,7 @@ - {path: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}", when: "{{ matrix_synapse_ext_synapse_s3_storage_provider_enabled }}"} - {path: "{{ matrix_synapse_ext_s3_storage_provider_bin_path }}", when: "{{ matrix_synapse_ext_synapse_s3_storage_provider_enabled }}"} + - {path: "{{ matrix_synapse_ext_s3_storage_provider_data_path }}", when: "{{ matrix_synapse_ext_synapse_s3_storage_provider_enabled }}"} # We handle matrix_synapse_media_store_path elsewhere (in ./synapse/setup_install.yml), # because if it's using Goofys and it's already mounted (from before), From 7464604ddd119aa72be7b17f51bf226b7aca166e Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Sun, 4 Dec 2022 10:17:55 +0200 Subject: [PATCH 2/2] Make use of matrix_synapse_ext_s3_storage_provider_data_path in a few more places --- .../tasks/ext/s3-storage-provider/setup_install.yml | 2 +- .../templates/synapse/ext/s3-storage-provider/bin/migrate.j2 | 2 +- .../templates/synapse/ext/s3-storage-provider/bin/shell.j2 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_install.yml b/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_install.yml index 11958f45..c892e0b6 100644 --- a/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_install.yml +++ b/roles/custom/matrix-synapse/tasks/ext/s3-storage-provider/setup_install.yml @@ -27,7 +27,7 @@ - name: Ensure s3-storage-provider database.yaml file installed ansible.builtin.template: src: "{{ role_path }}/templates/synapse/ext/s3-storage-provider/database.yaml.j2" - dest: "{{ matrix_synapse_ext_s3_storage_provider_base_path }}/data/database.yaml" + dest: "{{ matrix_synapse_ext_s3_storage_provider_data_path }}/database.yaml" mode: 0640 - name: Ensure s3-storage-provider scripts installed diff --git a/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/bin/migrate.j2 b/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/bin/migrate.j2 index 70518eb4..6ce085f2 100644 --- a/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/bin/migrate.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/bin/migrate.j2 @@ -5,7 +5,7 @@ --rm \ --env-file={{ matrix_synapse_ext_s3_storage_provider_base_path }}/env \ --mount type=bind,src={{ matrix_synapse_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \ - --mount type=bind,src={{ matrix_synapse_ext_s3_storage_provider_base_path }}/data,dst=/data \ + --mount type=bind,src={{ matrix_synapse_ext_s3_storage_provider_data_path }},dst=/data \ --workdir=/data \ --network={{ matrix_docker_network }} \ --entrypoint=/bin/bash \ diff --git a/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/bin/shell.j2 b/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/bin/shell.j2 index 00717705..a5494882 100644 --- a/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/bin/shell.j2 +++ b/roles/custom/matrix-synapse/templates/synapse/ext/s3-storage-provider/bin/shell.j2 @@ -6,7 +6,7 @@ --rm \ --env-file={{ matrix_synapse_ext_s3_storage_provider_base_path }}/env \ --mount type=bind,src={{ matrix_synapse_storage_path }},dst=/matrix-media-store-parent,bind-propagation=slave \ - --mount type=bind,src={{ matrix_synapse_ext_s3_storage_provider_base_path }}/data,dst=/data \ + --mount type=bind,src={{ matrix_synapse_ext_s3_storage_provider_data_path }},dst=/data \ --workdir=/data \ --network={{ matrix_docker_network }} \ --entrypoint=/bin/bash \