From ff9488732a1cbbbef37733918777409977a451ff Mon Sep 17 00:00:00 2001 From: Markus <48181660+BackInBash@users.noreply.github.com> Date: Wed, 20 Apr 2022 19:18:04 +0200 Subject: [PATCH] Renaming Vars --- docs/configuring-playbook-synapse.md | 12 ++++----- roles/matrix-synapse/defaults/main.yml | 26 +++++++++---------- .../tasks/synapse/setup_install.yml | 4 +-- .../templates/synapse/homeserver.yaml.j2 | 20 +++++++------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/docs/configuring-playbook-synapse.md b/docs/configuring-playbook-synapse.md index a1d659168..161f661f3 100644 --- a/docs/configuring-playbook-synapse.md +++ b/docs/configuring-playbook-synapse.md @@ -83,21 +83,21 @@ You need to enable it in the config as followed: ```yaml # To enable the Module -matrix_synapse_s3_media_store_enabled: true +matrix_synapse_media_storage_provider_s3_enabled: true # Connection information -matrix_synapse_s3_media_store_bucket: "" -matrix_synapse_s3_media_store_access: "" -matrix_synapse_s3_media_store_key: "" +matrix_synapse_media_storage_provider_s3_bucket: "" +matrix_synapse_media_storage_provider_s3_access_key_id: "" +matrix_synapse_media_storage_provider_s3_secret_access_key: "" ``` For Amazon S3 Users you can set the S3 region with the key: ```yaml # To set the S3 Region. Default value is eu-central-1 -matrix_synapse_s3_media_store_region: "eu-central-1" +matrix_synapse_s3_media_store_region_name: "eu-central-1" ``` The set a custom S3 Endpoint (MinIO): ```yaml # To set the S3 Endpoint URL. Defaults to AmazonS3 -matrix_synapse_s3_media_store_endpoint: "https://..." +matrix_synapse_s3_media_store_endpoint_url: "https://..." ``` \ No newline at end of file diff --git a/roles/matrix-synapse/defaults/main.yml b/roles/matrix-synapse/defaults/main.yml index 58b4dd8c8..f511472d4 100644 --- a/roles/matrix-synapse/defaults/main.yml +++ b/roles/matrix-synapse/defaults/main.yml @@ -577,23 +577,23 @@ matrix_synapse_ext_encryption_config_yaml: | # The S3 Integration requires the installation directly in the Synapse container. # So there is a need to build our own Synapse container. -# So with setting matrix_synapse_s3_media_store_enabled to true the matrix_synapse_container_image_self_build is overwritten. +# So with setting matrix_synapse_media_storage_provider_s3_enabled to true the matrix_synapse_container_image_self_build is overwritten. # All configuration options are avaliable here: https://github.com/matrix-org/synapse-s3-storage-provider -matrix_synapse_s3_media_store_enabled: false +matrix_synapse_media_storage_provider_s3_enabled: false # Save media on local media store -matrix_synapse_s3_media_store_local: false +matrix_synapse_media_storage_provider_s3_store_local: false # Save media on remote media store -matrix_synapse_s3_media_store_remote: true +matrix_synapse_media_storage_provider_s3_store_remote: true # Synchronous upload -matrix_synapse_s3_media_store_sync: false - -matrix_synapse_s3_media_store_bucket: "" -matrix_synapse_s3_media_store_region: "eu-central-1" -matrix_synapse_s3_media_store_endpoint: "https://s3.{{ matrix_synapse_s3_media_store_region }}.amazonaws.com" -matrix_synapse_s3_media_store_access: "" -matrix_synapse_s3_media_store_key: "" -matrix_synapse_s3_media_store_storage_class: "STANDARD" -matrix_synapse_s3_media_store_threads: "20" +matrix_synapse_media_storage_provider_s3_store_synchronous: false + +matrix_synapse_media_storage_provider_s3_bucket: "" +matrix_synapse_media_storage_provider_s3_region_name: "eu-central-1" +matrix_synapse_media_storage_provider_s3_endpoint_url: "https://s3.{{ matrix_synapse_media_storage_provider_s3_region }}.amazonaws.com" +matrix_synapse_media_storage_provider_s3_access_key_id: "" +matrix_synapse_media_storage_provider_s3_secret_access_key: "" +matrix_synapse_media_storage_provider_s3_storage_class: "STANDARD" +matrix_synapse_media_storage_provider_s3_threadpool_size: "20" # Goofys S3 Integration diff --git a/roles/matrix-synapse/tasks/synapse/setup_install.yml b/roles/matrix-synapse/tasks/synapse/setup_install.yml index 79ac2fc25..efd2bf83e 100644 --- a/roles/matrix-synapse/tasks/synapse/setup_install.yml +++ b/roles/matrix-synapse/tasks/synapse/setup_install.yml @@ -40,7 +40,7 @@ path: "{{ matrix_synapse_docker_src_files_path }}/docker/Dockerfile" line: RUN pip install --no-deps --no-warn-script-location synapse-s3-storage-provider boto3 botocore humanize jmespath s3transfer tqdm typing-extensions insertafter: /synapse.* - when: "matrix_synapse_s3_media_store_enabled|bool" + when: "matrix_synapse_media_storage_provider_s3_enabled|bool" # Invoking the `docker build` command here, instead of calling the `docker_image` Ansible module, # because the latter does not support BuildKit. @@ -56,7 +56,7 @@ environment: DOCKER_BUILDKIT: 1 when: "matrix_synapse_git_pull_results.changed|bool or matrix_synapse_docker_image_check_result.stdout == ''" - when: "matrix_synapse_container_image_self_build|bool or matrix_synapse_s3_media_store_enabled|bool" + when: "matrix_synapse_container_image_self_build|bool" - name: Ensure Synapse Docker image is pulled docker_image: diff --git a/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 b/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 index 8f3d70d49..a0f9d24f2 100644 --- a/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 +++ b/roles/matrix-synapse/templates/synapse/homeserver.yaml.j2 @@ -1040,24 +1040,24 @@ media_store_path: "/matrix-media-store-parent/{{ matrix_synapse_media_store_dire # directory: /mnt/some/other/directory # Matrix S3 Storage Provider -{% if matrix_synapse_s3_media_store_enabled %} +{% if matrix_synapse_media_storage_provider_s3_enabled %} media_storage_providers: - module: s3_storage_provider.S3StorageProviderBackend # In the context of this module the local store means the S3 Bucket # and the remote store the local volume ¯\_(ツ)_/¯ (i swaped it for convenience) - store_local: {{ matrix_synapse_s3_media_store_remote }} - store_remote: {{ matrix_synapse_s3_media_store_local }} - store_synchronous: {{ matrix_synapse_s3_media_store_sync }} + store_local: {{ matrix_synapse_media_storage_provider_s3_store_local }} + store_remote: {{ matrix_synapse_media_storage_provider_s3_store_remote }} + store_synchronous: {{ matrix_synapse_media_storage_provider_s3_store_synchronous }} config: - bucket: {{ matrix_synapse_s3_media_store_bucket }} + bucket: {{ matrix_synapse_media_storage_provider_s3_bucket }} # All of the below options are optional, for use with non-AWS S3-like # services, or to specify access tokens here instead of some external method. - region_name: {{ matrix_synapse_s3_media_store_region }} - endpoint_url: {{ matrix_synapse_s3_media_store_endpoint }} - access_key_id: {{ matrix_synapse_s3_media_store_access }} - secret_access_key: {{ matrix_synapse_s3_media_store_key }} + region_name: {{ matrix_synapse_media_storage_provider_s3_region_name }} + endpoint_url: {{ matrix_synapse_media_storage_provider_s3_endpoint_url }} + access_key_id: {{ matrix_synapse_media_storage_provider_s3_access_key_id }} + secret_access_key: {{ matrix_synapse_media_storage_provider_s3_secret_access_key }} storage_class: {{ matrix_synapse_s3_media_store_storage_class }} - threadpool_size: {{ matrix_synapse_s3_media_store_threads }} + threadpool_size: {{ matrix_synapse_media_storage_provider_s3_threadpool_size }} {% endif %} # The largest allowed upload size in bytes