2020-07-01 16:44:27 +00:00
|
|
|
job "im" {
|
2019-06-01 14:02:49 +00:00
|
|
|
datacenters = ["dc1"]
|
|
|
|
type = "service"
|
2020-12-18 09:32:44 +00:00
|
|
|
priority = 60
|
2019-06-01 14:02:49 +00:00
|
|
|
|
|
|
|
group "matrix" {
|
|
|
|
count = 1
|
2020-12-22 17:24:33 +00:00
|
|
|
|
|
|
|
network {
|
|
|
|
port "client_port" { static = 8008 }
|
|
|
|
port "federation_port" { static = 8448 }
|
|
|
|
}
|
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
task "synapse" {
|
|
|
|
driver = "docker"
|
|
|
|
|
|
|
|
config {
|
2021-06-04 17:48:50 +00:00
|
|
|
image = "superboum/amd64_synapse:v45"
|
2020-10-28 15:55:11 +00:00
|
|
|
network_mode = "host"
|
2019-06-01 14:02:49 +00:00
|
|
|
readonly_rootfs = true
|
2020-12-22 17:24:33 +00:00
|
|
|
ports = [ "client_port", "federation_port" ]
|
2019-06-01 14:02:49 +00:00
|
|
|
command = "python"
|
|
|
|
args = [
|
|
|
|
"-m", "synapse.app.homeserver",
|
|
|
|
"-n",
|
|
|
|
"-c", "/etc/matrix-synapse/homeserver.yaml"
|
|
|
|
]
|
|
|
|
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-logs:/var/log/matrix-synapse",
|
|
|
|
"/tmp/synapse:/tmp"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/synapse/homeserver.yaml")
|
2019-06-01 14:02:49 +00:00
|
|
|
destination = "secrets/conf/homeserver.yaml"
|
|
|
|
}
|
2019-10-27 14:26:21 +00:00
|
|
|
|
2020-02-28 19:08:37 +00:00
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/easybridge/registration.yaml.tpl")
|
2020-02-28 19:08:37 +00:00
|
|
|
destination = "secrets/conf/easybridge_registration.yaml"
|
|
|
|
}
|
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/synapse/log.yaml")
|
2019-06-01 14:02:49 +00:00
|
|
|
destination = "secrets/conf/log.yaml"
|
|
|
|
}
|
2020-12-22 17:24:33 +00:00
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/synapse/conf.d/server_name.yaml")
|
2019-06-01 14:02:49 +00:00
|
|
|
destination = "secrets/conf/server_name.yaml"
|
|
|
|
}
|
2020-12-22 17:24:33 +00:00
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/synapse/conf.d/report_stats.yaml")
|
2019-06-01 14:02:49 +00:00
|
|
|
destination = "secrets/conf/report_stats.yaml"
|
|
|
|
}
|
2020-12-22 17:24:33 +00:00
|
|
|
|
|
|
|
# --- secrets ---
|
2019-06-01 14:02:49 +00:00
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/chat/synapse/homeserver.tls.crt\" }}"
|
|
|
|
destination = "secrets/conf/homeserver.tls.crt"
|
|
|
|
}
|
2020-12-22 17:24:33 +00:00
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/chat/synapse/homeserver.tls.dh\" }}"
|
|
|
|
destination = "secrets/conf/homeserver.tls.dh"
|
|
|
|
}
|
2020-12-22 17:24:33 +00:00
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/chat/synapse/homeserver.tls.key\" }}"
|
|
|
|
destination = "secrets/conf/homeserver.tls.key"
|
|
|
|
}
|
2020-12-22 17:24:33 +00:00
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
template {
|
|
|
|
data = "{{ key \"secrets/chat/synapse/homeserver.signing.key\" }}"
|
|
|
|
destination = "secrets/conf/homeserver.signing.key"
|
|
|
|
}
|
|
|
|
|
|
|
|
env {
|
|
|
|
SYNAPSE_CACHE_FACTOR = 1
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 1000
|
2021-07-01 21:48:11 +00:00
|
|
|
memory = 2000
|
2019-06-01 14:02:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
2020-03-09 13:11:24 +00:00
|
|
|
name = "synapse-client"
|
2020-12-22 17:24:33 +00:00
|
|
|
port = "client_port"
|
2020-12-24 09:01:42 +00:00
|
|
|
address_mode = "host"
|
2019-06-01 14:02:49 +00:00
|
|
|
tags = [
|
|
|
|
"matrix",
|
|
|
|
"traefik.enable=true",
|
|
|
|
"traefik.frontend.entryPoints=https",
|
2021-06-30 14:24:03 +00:00
|
|
|
"traefik.frontend.rule=Host:im.deuxfleurs.fr;PathPrefix:/_matrix,/_synapse",
|
2020-05-05 14:14:01 +00:00
|
|
|
"traefik.frontend.headers.customResponseHeaders=Access-Control-Allow-Origin: *",
|
2020-03-09 13:11:24 +00:00
|
|
|
"traefik.frontend.priority=100"
|
2019-06-01 14:02:49 +00:00
|
|
|
]
|
|
|
|
check {
|
|
|
|
type = "tcp"
|
2020-12-22 17:24:33 +00:00
|
|
|
port = "client_port"
|
2019-06-01 14:02:49 +00:00
|
|
|
interval = "60s"
|
|
|
|
timeout = "5s"
|
|
|
|
check_restart {
|
|
|
|
limit = 3
|
|
|
|
grace = "90s"
|
|
|
|
ignore_warnings = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-03-09 13:11:24 +00:00
|
|
|
|
|
|
|
service {
|
|
|
|
name = "synapse-federation"
|
2020-12-22 17:24:33 +00:00
|
|
|
port = "federation_port"
|
2020-12-24 09:01:42 +00:00
|
|
|
address_mode = "host"
|
2020-03-09 13:11:24 +00:00
|
|
|
tags = [
|
|
|
|
"matrix",
|
|
|
|
"traefik.enable=true",
|
|
|
|
"traefik.frontend.entryPoints=https",
|
|
|
|
"traefik.frontend.rule=Host:deuxfleurs.fr;PathPrefix:/_matrix",
|
|
|
|
"traefik.frontend.priority=100"
|
|
|
|
]
|
|
|
|
}
|
2019-06-01 14:02:49 +00:00
|
|
|
}
|
|
|
|
}
|
2020-02-28 19:08:37 +00:00
|
|
|
|
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
group "riotweb" {
|
|
|
|
count = 1
|
|
|
|
|
2020-12-22 17:24:33 +00:00
|
|
|
network {
|
|
|
|
port "web_port" { to = 8043 }
|
|
|
|
}
|
|
|
|
|
2019-06-01 14:02:49 +00:00
|
|
|
task "server" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
2021-05-18 13:26:41 +00:00
|
|
|
image = "superboum/amd64_riotweb:v23"
|
2020-12-22 17:24:33 +00:00
|
|
|
ports = [ "web_port" ]
|
2019-06-01 14:02:49 +00:00
|
|
|
volumes = [
|
2020-12-22 17:24:33 +00:00
|
|
|
"secrets/config.json:/srv/http/config.json"
|
2019-06-01 14:02:49 +00:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
2021-01-16 16:07:01 +00:00
|
|
|
data = file("../config/riot_web/config.json")
|
2019-06-01 14:02:49 +00:00
|
|
|
destination = "secrets/config.json"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
memory = 21
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
tags = [
|
|
|
|
"webstatic",
|
|
|
|
"traefik.enable=true",
|
|
|
|
"traefik.frontend.entryPoints=https",
|
2020-03-09 13:14:54 +00:00
|
|
|
"traefik.frontend.rule=Host:im.deuxfleurs.fr,riot.deuxfleurs.fr;PathPrefix:/",
|
|
|
|
"traefik.frontend.priority=10"
|
2019-06-01 14:02:49 +00:00
|
|
|
]
|
|
|
|
port = "web_port"
|
|
|
|
address_mode = "host"
|
|
|
|
name = "webstatic"
|
|
|
|
check {
|
|
|
|
type = "tcp"
|
|
|
|
port = "web_port"
|
|
|
|
interval = "60s"
|
|
|
|
timeout = "5s"
|
|
|
|
check_restart {
|
|
|
|
limit = 3
|
|
|
|
grace = "90s"
|
|
|
|
ignore_warnings = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|