aboutsummaryrefslogtreecommitdiff
path: root/app/im
diff options
context:
space:
mode:
Diffstat (limited to 'app/im')
-rw-r--r--app/im/build/matrix-synapse/Dockerfile5
-rw-r--r--app/im/config/synapse/homeserver.yaml23
-rw-r--r--app/im/deploy/im.hcl2
-rw-r--r--app/im/secrets/chat/synapse/s3_access_key1
-rw-r--r--app/im/secrets/chat/synapse/s3_secret_key1
5 files changed, 30 insertions, 2 deletions
diff --git a/app/im/build/matrix-synapse/Dockerfile b/app/im/build/matrix-synapse/Dockerfile
index b8480d5..20650d0 100644
--- a/app/im/build/matrix-synapse/Dockerfile
+++ b/app/im/build/matrix-synapse/Dockerfile
@@ -1,6 +1,7 @@
FROM amd64/debian:buster as builder
ARG VERSION
+ARG S3_VERSION
RUN apt-get update && \
apt-get -qq -y full-upgrade && \
apt-get install -y \
@@ -22,7 +23,9 @@ RUN apt-get update && \
virtualenv /root/matrix-env -p /usr/bin/python3 && \
. /root/matrix-env/bin/activate && \
pip3 install \
- https://github.com/matrix-org/synapse/archive/v${VERSION}.tar.gz#egg=matrix-synapse[matrix-synapse-ldap3,postgres,resources.consent,saml2,url_preview]
+ https://github.com/matrix-org/synapse/archive/v${VERSION}.tar.gz#egg=matrix-synapse[matrix-synapse-ldap3,postgres,resources.consent,saml2,url_preview] && \
+ pip3 install \
+ git+https://github.com/matrix-org/synapse-s3-storage-provider.git@${S3_VERSION}
FROM amd64/debian:buster
diff --git a/app/im/config/synapse/homeserver.yaml b/app/im/config/synapse/homeserver.yaml
index eacf509..c68bc49 100644
--- a/app/im/config/synapse/homeserver.yaml
+++ b/app/im/config/synapse/homeserver.yaml
@@ -137,6 +137,29 @@ federation_rc_concurrent: 3
media_store_path: "/var/lib/matrix-synapse/media"
uploads_path: "/var/lib/matrix-synapse/uploads"
+media_storage_providers:
+- module: s3_storage_provider.S3StorageProviderBackend
+ store_local: True
+ store_remote: True
+ store_synchronous: True
+ config:
+ bucket: matrix
+ # 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: garage
+ endpoint_url: https://garagehq.deuxfleurs.fr
+ access_key_id: {{ key "secrets/chat/synapse/s3_access_key" | trimSpace }}
+ secret_access_key: {{ key "secrets/chat/synapse/s3_secret_key" | trimSpace }}
+
+ # The object storage class used when uploading files to the bucket.
+ # Default is STANDARD.
+ #storage_class: "STANDARD_IA"
+
+ # The maximum number of concurrent threads which will be used to connect
+ # to S3. Each thread manages a single connection. Default is 40.
+ #
+ #threadpool_size: 20
+
# The largest allowed upload size in bytes
max_upload_size: "100M"
diff --git a/app/im/deploy/im.hcl b/app/im/deploy/im.hcl
index d3cad7c..b53645c 100644
--- a/app/im/deploy/im.hcl
+++ b/app/im/deploy/im.hcl
@@ -15,7 +15,7 @@ job "im" {
driver = "docker"
config {
- image = "superboum/amd64_synapse:v44"
+ image = "superboum/amd64_synapse:v45"
network_mode = "host"
readonly_rootfs = true
ports = [ "client_port", "federation_port" ]
diff --git a/app/im/secrets/chat/synapse/s3_access_key b/app/im/secrets/chat/synapse/s3_access_key
new file mode 100644
index 0000000..ab09a8e
--- /dev/null
+++ b/app/im/secrets/chat/synapse/s3_access_key
@@ -0,0 +1 @@
+USER matrix
diff --git a/app/im/secrets/chat/synapse/s3_secret_key b/app/im/secrets/chat/synapse/s3_secret_key
new file mode 100644
index 0000000..ab09a8e
--- /dev/null
+++ b/app/im/secrets/chat/synapse/s3_secret_key
@@ -0,0 +1 @@
+USER matrix