diff --git a/roles/matrix-server/tasks/setup/setup_synapse_pre.yml b/roles/matrix-server/tasks/setup/setup_synapse_pre.yml index 8e8adca3..f0599861 100644 --- a/roles/matrix-server/tasks/setup/setup_synapse_pre.yml +++ b/roles/matrix-server/tasks/setup/setup_synapse_pre.yml @@ -5,6 +5,10 @@ msg: "You need to set a secret in the matrix_synapse_macaroon_secret_key variable" when: "matrix_synapse_macaroon_secret_key == ''" +- set_fact: + matrix_synapse_media_store_parent_path: "{{ matrix_synapse_media_store_path|dirname }}" + matrix_synapse_media_store_directory_name: "{{ matrix_synapse_media_store_path|basename }}" + - name: Ensure Matrix Synapse paths exist file: path: "{{ item }}" @@ -15,8 +19,7 @@ with_items: - "{{ matrix_synapse_config_dir_path }}" - "{{ matrix_synapse_run_path }}" - - "{{ matrix_synapse_storage_path }}" - "{{ matrix_synapse_ext_path }}" - # We handle matrix_synapse_media_store_path elsewhere (in setup_synapse.yml), - # because if it's using S3fs and it's already mounted (from before), - # trying to chown/chmod it here will cause trouble. + # We handle matrix_synapse_media_store_path elsewhere (in setup_synapse_main.yml), + # because if it's using Goofys and it's already mounted (from before), + # trying to chown/chmod it here will cause trouble. \ No newline at end of file diff --git a/roles/matrix-server/templates/synapse/homeserver.yaml.j2 b/roles/matrix-server/templates/synapse/homeserver.yaml.j2 index a0e23ab6..7c6afb59 100644 --- a/roles/matrix-server/templates/synapse/homeserver.yaml.j2 +++ b/roles/matrix-server/templates/synapse/homeserver.yaml.j2 @@ -261,7 +261,7 @@ federation_rc_concurrent: 3 # Directory where uploaded images and attachments are stored. -media_store_path: "/matrix-storage/media-store" +media_store_path: "/matrix-media-store-parent/{{ matrix_synapse_media_store_directory_name }}" # Media storage providers allow media to be stored in different # locations. diff --git a/roles/matrix-server/templates/systemd/matrix-synapse.service.j2 b/roles/matrix-server/templates/systemd/matrix-synapse.service.j2 index 78c46694..1e7c7570 100644 --- a/roles/matrix-server/templates/systemd/matrix-synapse.service.j2 +++ b/roles/matrix-server/templates/systemd/matrix-synapse.service.j2 @@ -37,7 +37,7 @@ ExecStart=/usr/bin/docker run --rm --name matrix-synapse \ {% endif %} -v {{ matrix_synapse_config_dir_path }}:/data \ -v {{ matrix_synapse_run_path }}:/matrix-run \ - -v {{ matrix_synapse_storage_path }}:/matrix-storage:slave \ + -v {{ matrix_synapse_base_path }}/storage:/matrix-media-store-parent:slave \ {% for volume in matrix_synapse_container_additional_volumes %} -v {{ volume.src }}:{{ volume.dst }}:{{ volume.options }} \ {% endfor %}