From cb6c86fd817e39a9403856d3a52239e0a527f3f7 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sun, 20 Feb 2022 13:14:26 +0100 Subject: [PATCH] =?UTF-8?q?Jitsi=20:=20creation=20et=20suppression=20des?= =?UTF-8?q?=20configs=20=C3=A0=20chaque=20installation/suppression.=20Ce?= =?UTF-8?q?=20ne=20sont=20pas=20des=20donn=C3=A9es=20persistantes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- podman-jitsi/.gitlab-ci.yml | 2 +- podman-jitsi/05_freshinstall.sh | 31 ------------------------------- podman-jitsi/10_install.sh | 20 ++++++++++++++++++-- podman-jitsi/80_destroy.sh | 11 ++++++++++- podman-jitsi/90_prune.sh | 11 +---------- 5 files changed, 30 insertions(+), 45 deletions(-) delete mode 100755 podman-jitsi/05_freshinstall.sh mode change 120000 => 100755 podman-jitsi/80_destroy.sh mode change 100755 => 120000 podman-jitsi/90_prune.sh diff --git a/podman-jitsi/.gitlab-ci.yml b/podman-jitsi/.gitlab-ci.yml index fc8e728..e256eea 100644 --- a/podman-jitsi/.gitlab-ci.yml +++ b/podman-jitsi/.gitlab-ci.yml @@ -7,7 +7,7 @@ jitsi: stage: test script: - cd podman-jitsi - - GARBAYE_JITSI_ENV_LISTENPORT=18085 ./05_freshinstall.sh + - GARBAYE_JITSI_ENV_LISTENPORT=18085 ./10_install.sh - ./20_enable.sh - ./30_start.sh && sleep 10 - ./40_stop.sh diff --git a/podman-jitsi/05_freshinstall.sh b/podman-jitsi/05_freshinstall.sh deleted file mode 100755 index bcf3815..0000000 --- a/podman-jitsi/05_freshinstall.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/env bash - -ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh - -ensure_pwd_is_scriptdir -ensure_not_root - -if [[ -d ~/${confvolume} ]]; then - echo "Error : conf volume ~/${confvolume} already exists. Please remove it first (prune?)." - exit 1 -fi - -mkdir -p ~/${confvolume}/{web/letsencrypt,web/crontabs,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri} - -# Patch config.js -echo " -config.enableInsecureRoomNameWarning = true; - -config.disableThirdPartyRequests = true; -" > ~/${confvolume}/web/custom-config.js - -# Patch ~/${confvolume}/web/interface_config.js -echo " -interfaceConfig.APP_NAME = 'Jitsi Garbaye'; -interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME = 'Participant'; -interfaceConfig.JITSI_WATERMARK_LINK = '${GARBAYE_JITSI_URL}'; -" > ~/${confvolume}/web/custom-interface_config.js - -${ABSDIR}/10_install.sh diff --git a/podman-jitsi/10_install.sh b/podman-jitsi/10_install.sh index c987c23..f4bfecc 100755 --- a/podman-jitsi/10_install.sh +++ b/podman-jitsi/10_install.sh @@ -9,11 +9,27 @@ ensure_not_root ensure_pod_not_exists ${pod_name} -if [[ ! -d ~/${confvolume} ]]; then - echo "Error : conf volume ~/${confvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install." +if [[ -d ~/${confvolume} ]]; then + echo "Error : conf volume ~/${confvolume} already exists. Please consider running 80_destroy.sh." exit 1 fi +mkdir -p ~/${confvolume}/{web/letsencrypt,web/crontabs,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri} + +# Patch config.js +echo " +config.enableInsecureRoomNameWarning = true; + +config.disableThirdPartyRequests = true; +" > ~/${confvolume}/web/custom-config.js + +# Patch ~/${confvolume}/web/interface_config.js +echo " +interfaceConfig.APP_NAME = 'Jitsi Garbaye'; +interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME = 'Participant'; +interfaceConfig.JITSI_WATERMARK_LINK = '${GARBAYE_JITSI_URL}'; +" > ~/${confvolume}/web/custom-interface_config.js + curl -s -- "https://codeload.github.com/jitsi/docker-jitsi-meet/tar.gz/refs/tags/${version}" | tar xzv --strip-components 1 docker-jitsi-meet-${version}/docker-compose.yml docker-jitsi-meet-${version}/env.example docker-jitsi-meet-${version}/gen-passwords.sh cp env.example .env ./gen-passwords.sh diff --git a/podman-jitsi/80_destroy.sh b/podman-jitsi/80_destroy.sh deleted file mode 120000 index 1b8a370..0000000 --- a/podman-jitsi/80_destroy.sh +++ /dev/null @@ -1 +0,0 @@ -../_podman-common/80_destroy_pod.sh \ No newline at end of file diff --git a/podman-jitsi/80_destroy.sh b/podman-jitsi/80_destroy.sh new file mode 100755 index 0000000..a329a71 --- /dev/null +++ b/podman-jitsi/80_destroy.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +ABSDIR="$( dirname "$(readlink -f -- "$0")" )" +source ${ABSDIR}/../functions.sh +source ${ABSDIR}/vars.sh + +# Run regular prune script for pods +source ${ABSDIR}/../_podman-common/80_destroy_pod.sh && +# Remove configuration volume +podman unshare rm -rf ~/${confvolume}/ diff --git a/podman-jitsi/90_prune.sh b/podman-jitsi/90_prune.sh deleted file mode 100755 index ede4c89..0000000 --- a/podman-jitsi/90_prune.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/usr/bin/env bash - -ABSDIR="$( dirname "$(readlink -f -- "$0")" )" -source ${ABSDIR}/../functions.sh -source ${ABSDIR}/vars.sh - -# Run regular prune script for pods -source ${ABSDIR}/../_podman-common/90_prune_pod.sh && -# Remove configuration volume -podman unshare rm -rf ~/${confvolume}/ diff --git a/podman-jitsi/90_prune.sh b/podman-jitsi/90_prune.sh new file mode 120000 index 0000000..5fed91e --- /dev/null +++ b/podman-jitsi/90_prune.sh @@ -0,0 +1 @@ +../_podman-common/90_prune_pod.sh \ No newline at end of file