2024-01-13 16:58:33 +00:00
|
|
|
// Fichier de configuration pour exposer le service Matrix
|
|
|
|
// avec une version TLS compatible avec Android 7
|
|
|
|
// Voir https://git.deuxfleurs.fr/Deuxfleurs/nixcfg/src/branch/main/cluster/prod/app/email/integration
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
job "im-android7" {
|
|
|
|
datacenters = ["scorpio", "neptune"]
|
|
|
|
type = "service"
|
|
|
|
priority = 100
|
|
|
|
|
|
|
|
group "rsa-ecc-proxy" {
|
|
|
|
network {
|
2024-01-22 19:24:46 +00:00
|
|
|
port "api_port" { static = 18008 }
|
2024-01-13 16:58:33 +00:00
|
|
|
// port "web_port" { to = 8043 }
|
|
|
|
}
|
|
|
|
|
|
|
|
task "api-proxy" {
|
|
|
|
driver = "docker"
|
|
|
|
config {
|
|
|
|
image = "alpine/socat:1.8.0.0"
|
|
|
|
readonly_rootfs = true
|
|
|
|
ports = [ "api_port" ]
|
|
|
|
network_mode = "host"
|
|
|
|
args = [
|
2024-01-22 19:24:46 +00:00
|
|
|
"openssl-listen:18008,reuseaddr,fork,verify=0,bind=0.0.0.0,cert=/var/secrets/rsa.crt,key=/var/secrets/rsa.key",
|
|
|
|
"tcp:synapse.service.prod.consul:8008",
|
2024-01-13 16:58:33 +00:00
|
|
|
]
|
|
|
|
volumes = [
|
|
|
|
"secrets/certs:/var/secrets"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
template {
|
2024-01-22 17:31:09 +00:00
|
|
|
data = "{{ key \"secrets/chat/tls-tls-proxy/rsa.crt\" }}"
|
2024-01-13 16:58:33 +00:00
|
|
|
destination = "secrets/certs/rsa.crt"
|
|
|
|
}
|
|
|
|
template {
|
2024-01-22 17:31:09 +00:00
|
|
|
data = "{{ key \"secrets/chat/tls-tls-proxy/rsa.key\" }}"
|
2024-01-13 16:58:33 +00:00
|
|
|
destination = "secrets/certs/rsa.key"
|
|
|
|
}
|
|
|
|
|
|
|
|
resources {
|
|
|
|
cpu = 50
|
|
|
|
memory = 50
|
|
|
|
}
|
|
|
|
|
|
|
|
service {
|
|
|
|
name = "im-android7"
|
|
|
|
port = "api_port"
|
|
|
|
address_mode = "host"
|
|
|
|
tags = [
|
|
|
|
"rsa-ecc-proxy",
|
2024-01-22 19:24:46 +00:00
|
|
|
"(diplonat (tcp_port 18008))",
|
2024-01-13 16:58:33 +00:00
|
|
|
"d53-a im-android7.deuxfleurs.fr",
|
|
|
|
# ipv6 is commented for now as socat does not listen on ipv6 now
|
|
|
|
# "d53-aaaa im-android7.deuxfleurs.fr"
|
|
|
|
]
|
|
|
|
check {
|
|
|
|
type = "tcp"
|
|
|
|
port = "api_port"
|
|
|
|
interval = "60s"
|
|
|
|
timeout = "5s"
|
|
|
|
check_restart {
|
|
|
|
limit = 3
|
|
|
|
grace = "90s"
|
|
|
|
ignore_warnings = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|