forked from Deuxfleurs/infrastructure
Synapse does not use GlusterFS anymore
This commit is contained in:
parent
2a0610658d
commit
136d176176
4 changed files with 59 additions and 5 deletions
|
@ -18,7 +18,7 @@ services:
|
|||
VERSION: 1.42.0
|
||||
# https://github.com/matrix-org/synapse-s3-storage-provider/commits/main
|
||||
S3_VERSION: 3c3fafd6a2624f05fd396d9e003501bf8bef7b2e
|
||||
image: superboum/amd64_synapse:v46
|
||||
image: superboum/amd64_synapse:v47
|
||||
|
||||
# Email
|
||||
sogo:
|
||||
|
|
|
@ -46,6 +46,7 @@ RUN apt-get update && \
|
|||
|
||||
ENV LD_PRELOAD /usr/lib/x86_64-linux-gnu/libjemalloc.so.2
|
||||
COPY --from=builder /root/matrix-env /root/matrix-env
|
||||
COPY matrix-s3-async /usr/local/bin/matrix-s3-async
|
||||
COPY entrypoint.sh /usr/local/bin/entrypoint
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint"]
|
||||
|
|
16
app/im/build/matrix-synapse/matrix-s3-async
Executable file
16
app/im/build/matrix-synapse/matrix-s3-async
Executable file
|
@ -0,0 +1,16 @@
|
|||
#!/bin/bash
|
||||
|
||||
cat > database.yaml <<EOF
|
||||
user: $PG_USER
|
||||
password: $PG_PASS
|
||||
database: $PG_DB
|
||||
host: $PG_HOST
|
||||
port: $PG_PORT
|
||||
EOF
|
||||
|
||||
while true; do
|
||||
/root/matrix-env/bin/s3_media_upload update-db 0d
|
||||
/root/matrix-env/bin/s3_media_upload --no-progress check-deleted /var/lib/matrix-synapse/media
|
||||
/root/matrix-env/bin/s3_media_upload --no-progress upload /var/lib/matrix-synapse/media matrix --delete --endpoint-url https://garage.deuxfleurs.fr
|
||||
sleep 600
|
||||
done
|
|
@ -15,7 +15,7 @@ job "im" {
|
|||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "superboum/amd64_synapse:v46"
|
||||
image = "superboum/amd64_synapse:v47"
|
||||
network_mode = "host"
|
||||
readonly_rootfs = true
|
||||
ports = [ "client_port", "federation_port" ]
|
||||
|
@ -27,8 +27,8 @@ job "im" {
|
|||
]
|
||||
volumes = [
|
||||
"secrets/conf:/etc/matrix-synapse",
|
||||
"/mnt/glusterfs/chat/matrix/synapse/media:/var/lib/matrix-synapse/media",
|
||||
"/mnt/glusterfs/chat/matrix/synapse/uploads:/var/lib/matrix-synapse/uploads",
|
||||
"/tmp/synapse-media:/var/lib/matrix-synapse/media",
|
||||
"/tmp/synapse-uploads:/var/lib/matrix-synapse/uploads",
|
||||
"/tmp/synapse-logs:/var/log/matrix-synapse",
|
||||
"/tmp/synapse:/tmp"
|
||||
]
|
||||
|
@ -130,6 +130,43 @@ job "im" {
|
|||
}
|
||||
|
||||
|
||||
task "media-async-upload" {
|
||||
driver = "docker"
|
||||
|
||||
config {
|
||||
image = "superboum/amd64_synapse:v47"
|
||||
readonly_rootfs = true
|
||||
command = "/usr/local/bin/matrix-s3-async"
|
||||
work_dir = "/tmp"
|
||||
volumes = [
|
||||
"/tmp/synapse-media:/var/lib/matrix-synapse/media",
|
||||
"/tmp/synapse-uploads:/var/lib/matrix-synapse/uploads",
|
||||
"/tmp/synapse:/tmp"
|
||||
]
|
||||
}
|
||||
|
||||
resources {
|
||||
cpu = 100
|
||||
memory = 200
|
||||
}
|
||||
|
||||
template {
|
||||
data = <<EOH
|
||||
AWS_ACCESS_KEY_ID={{ key "secrets/chat/synapse/s3_access_key" | trimSpace }}
|
||||
AWS_SECRET_ACCESS_KEY={{ key "secrets/chat/synapse/s3_secret_key" | trimSpace }}
|
||||
AWS_DEFAULT_REGION=garage
|
||||
PG_USER={{ key "secrets/chat/synapse/postgres_user" | trimSpace }}
|
||||
PG_PASS={{ key "secrets/chat/synapse/postgres_pwd" | trimSpace }}
|
||||
PG_DB={{ key "secrets/chat/synapse/postgres_db" | trimSpace }}
|
||||
PG_HOST=psql-proxy.service.2.cluster.deuxfleurs.fr
|
||||
PG_PORT=5432
|
||||
EOH
|
||||
destination = "secrets/env"
|
||||
env = true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
group "riotweb" {
|
||||
count = 1
|
||||
|
||||
|
|
Loading…
Reference in a new issue