diff options
author | Alex Auvolat <alex@adnab.me> | 2023-10-04 11:51:04 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2023-10-04 11:51:04 +0200 |
commit | e94cb54661e60aaaa7386560c282710e89d71198 (patch) | |
tree | d7d1a87580748e0cd960afec51abf714c2f55c62 /cluster/prod/app/matrix | |
parent | 525f04515efbe8bb4c6d99c035b9e883c5544091 (diff) | |
download | nixcfg-e94cb54661e60aaaa7386560c282710e89d71198.tar.gz nixcfg-e94cb54661e60aaaa7386560c282710e89d71198.zip |
prod: add matrix syncv3 daemon
Diffstat (limited to 'cluster/prod/app/matrix')
-rw-r--r-- | cluster/prod/app/matrix/deploy/im.hcl | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/cluster/prod/app/matrix/deploy/im.hcl b/cluster/prod/app/matrix/deploy/im.hcl index e373da4..a6c4fe5 100644 --- a/cluster/prod/app/matrix/deploy/im.hcl +++ b/cluster/prod/app/matrix/deploy/im.hcl @@ -176,5 +176,70 @@ EOH } } } + + group "syncv3" { + count = 1 + + network { + port "syncv3_api" { to = 8009 } + port "syncv3_metrics" { to = 2112 } + } + + task "syncv3" { + driver = "docker" + + config { + image = "ghcr.io/matrix-org/sliding-sync:v0.99.10" + ports = [ "syncv3_api", "syncv3_metrics" ] + } + + resources { + cpu = 1000 + memory = 500 + memory_max = 1000 + } + + template { + data = <<EOH +SYNCV3_SERVER=http://synapse.service.prod.consul:8008 +SYNCV3_DB=postgresql://{{ key "secrets/chat/syncv3/postgres_user"|trimSpace }}:{{ key "secrets/chat/syncv3/postgres_pwd"|trimSpace }}@{{ env "meta.site" }}.psql-proxy.service.prod.consul/{{ key "secrets/chat/syncv3/postgres_db"|trimSpace }}?sslmode=disable +SYNCV3_SECRET={{ key "secrets/chat/syncv3/secret"|trimSpace }} +SYNCV3_BINDADDR=0.0.0.0:8009 +SYNCV3_PROM=0.0.0.0:2112 +EOH + destination = "secrets/env" + env = true + } + + service { + name = "matrix-syncv3" + port = "syncv3_api" + address_mode = "host" + tags = [ + "matrix", + "tricot im-syncv3.deuxfleurs.fr 100", + "tricot-add-header Access-Control-Allow-Origin *", + "d53-cname im-syncv3.deuxfleurs.fr", + ] + check { + type = "tcp" + port = "syncv3_api" + interval = "60s" + timeout = "5s" + check_restart { + limit = 3 + grace = "90s" + ignore_warnings = false + } + } + } + + service { + name = "matrix-syncv3-metrics" + port = "syncv3_metrics" + address_mode = "host" + } + } + } } |