Markus 3 лет назад
Родитель
Сommit
ff9488732a
4 измененных файлов: 31 добавлений и 31 удалений
  1. +6
    -6
      docs/configuring-playbook-synapse.md
  2. +13
    -13
      roles/matrix-synapse/defaults/main.yml
  3. +2
    -2
      roles/matrix-synapse/tasks/synapse/setup_install.yml
  4. +10
    -10
      roles/matrix-synapse/templates/synapse/homeserver.yaml.j2

+ 6
- 6
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://..."
```

+ 13
- 13
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


+ 2
- 2
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:


+ 10
- 10
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


Загрузка…
Отмена
Сохранить