From 80dc6ec803949bbb09a8d40c80daaa9c676c0fb6 Mon Sep 17 00:00:00 2001 From: Quentin Date: Wed, 23 Dec 2020 15:55:17 +0100 Subject: Migrate jitsi --- app/deployment/jitsi.hcl | 116 +++++++++++++++++++++++------------------------ 1 file changed, 56 insertions(+), 60 deletions(-) (limited to 'app/deployment') diff --git a/app/deployment/jitsi.hcl b/app/deployment/jitsi.hcl index 3c8de3a..9c1edd5 100644 --- a/app/deployment/jitsi.hcl +++ b/app/deployment/jitsi.hcl @@ -8,39 +8,50 @@ job "jitsi" { } group "core" { + + network { + port "bosh_port" { } + port "ext_port" { static = 5347 } + port "xmpp_port" { static = 5222 } + port "https_port" { } + port "video1_port" { static = 8080 } + port "video2_port" { static = 10000 } + } + task "xmpp" { driver = "docker" config { - image = "superboum/amd64_jitsi_xmpp:v4" + image = "superboum/amd64_jitsi_xmpp:v8" + ports = [ "bosh_port", "ext_port", "xmpp_port" ] network_mode = "host" } + template { + data = file("../config/configuration/jitsi/global_env.tpl") + destination = "secrets/global_env" + env = true + } + + # --- secrets --- template { data = "{{ key \"secrets/jitsi/auth.jitsi.deuxfleurs.fr.crt\" }}" destination = "secrets/certs/auth.jitsi.deuxfleurs.fr.crt" } + template { data = "{{ key \"secrets/jitsi/auth.jitsi.deuxfleurs.fr.key\" }}" destination = "secrets/certs/auth.jitsi.deuxfleurs.fr.key" } + template { data = "{{ key \"secrets/jitsi/jitsi.deuxfleurs.fr.crt\" }}" destination = "secrets/certs/jitsi.deuxfleurs.fr.crt" } + template { data = "{{ key \"secrets/jitsi/jitsi.deuxfleurs.fr.key\" }}" destination = "secrets/certs/jitsi.deuxfleurs.fr.key" } - artifact { - source = "http://127.0.0.1:8500/v1/kv/secrets/jitsi/global_env?raw" - destination = "secrets/global_env.tpl" - mode = "file" - } - template { - source = "secrets/global_env.tpl" - destination = "secrets/global_env" - env = true - } resources { cpu = 300 @@ -49,13 +60,12 @@ job "jitsi" { service { tags = [ "jitsi", "bosh" ] - port = 5280 - address_mode = "driver" + port = "bosh_port" + address_mode = "host" name = "jitsi-xmpp-bosh" check { type = "tcp" - address_mode = "driver" - port = 5280 + port = "bosh_port" interval = "60s" timeout = "5s" check_restart { @@ -68,15 +78,15 @@ job "jitsi" { service { tags = [ "jitsi", "ext" ] - port = 5347 - address_mode = "driver" + port = "ext_port" + address_mode = "host" name = "jitsi-ext" } service { tags = [ "jitsi", "xmpp" ] - port = 5222 - address_mode = "driver" + port = "xmpp_port" + address_mode = "host" name = "jitsi-xmpp" } } @@ -84,10 +94,18 @@ job "jitsi" { task "front" { driver = "docker" config { - image = "superboum/amd64_jitsi_meet:v1" + image = "superboum/amd64_jitsi_meet:v2" network_mode = "host" + ports = [ "https_port" ] } + template { + data = file("../config/configuration/jitsi/global_env.tpl") + destination = "secrets/global_env" + env = true + } + + # --- secrets --- template { data = "{{ key \"secrets/jitsi/jitsi.deuxfleurs.fr.crt\" }}" destination = "secrets/certs/jitsi.deuxfleurs.fr.crt" @@ -96,16 +114,6 @@ job "jitsi" { data = "{{ key \"secrets/jitsi/jitsi.deuxfleurs.fr.key\" }}" destination = "secrets/certs/jitsi.deuxfleurs.fr.key" } - artifact { - source = "http://127.0.0.1:8500/v1/kv/secrets/jitsi/global_env?raw" - destination = "secrets/global_env.tpl" - mode = "file" - } - template { - source = "secrets/global_env.tpl" - destination = "secrets/global_env" - env = true - } resources { cpu = 300 @@ -120,13 +128,12 @@ job "jitsi" { "traefik.frontend.rule=Host:jitsi.deuxfleurs.fr;PathPrefix:/", "traefik.protocol=https" ] - port = 443 - address_mode = "driver" + port = "https_port" + address_mode = "host" name = "jitsi-front-https" check { type = "tcp" - port = 443 - address_mode = "driver" + port = "https_port" interval = "60s" timeout = "5s" check_restart { @@ -145,24 +152,22 @@ job "jitsi" { network_mode = "host" } + template { + data = file("../config/configuration/jitsi/global_env.tpl") + destination = "secrets/global_env" + env = true + } + + #--- secrets --- template { data = "{{ key \"secrets/jitsi/jitsi.deuxfleurs.fr.crt\" }}" destination = "secrets/certs/jitsi.deuxfleurs.fr.crt" } + template { data = "{{ key \"secrets/jitsi/auth.jitsi.deuxfleurs.fr.crt\" }}" destination = "secrets/certs/auth.jitsi.deuxfleurs.fr.crt" } - artifact { - source = "http://127.0.0.1:8500/v1/kv/secrets/jitsi/global_env?raw" - destination = "secrets/global_env.tpl" - mode = "file" - } - template { - source = "secrets/global_env.tpl" - destination = "secrets/global_env" - env = true - } resources { cpu = 300 @@ -175,7 +180,7 @@ job "jitsi" { config { image = "superboum/amd64_jitsi_videobridge:v15" network_mode = "host" - port_map { video1_port = 8080 } # this is a hack, check secrets/jitsi/global_env to understand why + ports = [ "video1_port", "video2_port" ] ulimit { nofile = "1048576:1048576" nproc = "65536:65536" @@ -188,13 +193,8 @@ job "jitsi" { VIDEOBRIDGE_MAX_MEMORY = "1450m" } - artifact { - source = "http://127.0.0.1:8500/v1/kv/secrets/jitsi/global_env?raw" - destination = "secrets/global_env.tpl" - mode = "file" - } template { - source = "secrets/global_env.tpl" + data = file("../config/configuration/jitsi/global_env.tpl") destination = "secrets/global_env" env = true } @@ -202,20 +202,16 @@ job "jitsi" { resources { cpu = 900 memory = 1500 - network { - port "video1_port" { static = "8080" } # this is a hack - } } service { tags = [ "jitsi", "(diplonat (tcp_port 8080))" ] - port = 8080 - address_mode = "driver" + port = "video1_port" + address_mode = "host" name = "jitsi-videobridge-video1" check { type = "tcp" - port = 8080 - address_mode = "driver" + port = "video1_port" interval = "60s" timeout = "5s" check_restart { @@ -228,8 +224,8 @@ job "jitsi" { service { tags = [ "jitsi", "(diplonat (udp_port 10000))" ] - port = 10000 - address_mode = "driver" + port = "video2_port" + address_mode = "host" name = "jitsi-videobridge-video2" } } -- cgit v1.2.3