From 48fba4dac5f2dfb4ac6fc760c6fc2b04f7bc28e4 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Sun, 20 Feb 2022 13:08:02 +0100 Subject: [PATCH] Revert "Jitsi : migration vers un volume pour la conf, utilisation de la variable nonpersistent_volumes pour le nettoyage" This reverts commit 005f5bf5a095dc23e7501b90320ed59ccf2e670b. --- podman-jitsi/.gitlab-ci.yml | 2 +- podman-jitsi/05_freshinstall.sh | 31 +++++++++++++++++++++++++++++++ podman-jitsi/10_install.sh | 21 ++------------------- podman-jitsi/90_prune.sh | 11 ++++++++++- podman-jitsi/vars.sh | 3 +-- 5 files changed, 45 insertions(+), 23 deletions(-) create mode 100755 podman-jitsi/05_freshinstall.sh mode change 120000 => 100755 podman-jitsi/90_prune.sh diff --git a/podman-jitsi/.gitlab-ci.yml b/podman-jitsi/.gitlab-ci.yml index b944b27..fc8e728 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 ./10_freshinstall.sh + - GARBAYE_JITSI_ENV_LISTENPORT=18085 ./05_freshinstall.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 new file mode 100755 index 0000000..bcf3815 --- /dev/null +++ b/podman-jitsi/05_freshinstall.sh @@ -0,0 +1,31 @@ +#!/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 2809024..c987c23 100755 --- a/podman-jitsi/10_install.sh +++ b/podman-jitsi/10_install.sh @@ -9,28 +9,11 @@ ensure_not_root ensure_pod_not_exists ${pod_name} -if podman volume exists ${conf_volume} ; then - echo "Error : conf volume ${conf_volume} already exists. Consider running 80_destroy.sh first." +if [[ ! -d ~/${confvolume} ]]; then + echo "Error : conf volume ~/${confvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install." exit 1 fi -podman volume create ${conf_volume} -podman unshare mkdir -p `get_podman_volume_path ${conf_volume}`/{web/letsencrypt,web/crontabs,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri} - -# Patch config.js -podman unshare echo " -config.enableInsecureRoomNameWarning = true; - -config.disableThirdPartyRequests = true; -" > `get_podman_volume_path ${conf_volume}`/web/custom-config.js - -# Patch `get_podman_volume_path ${conf_volume}`/web/interface_config.js -podman unshare echo " -interfaceConfig.APP_NAME = 'Jitsi Garbaye'; -interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME = 'Participant'; -interfaceConfig.JITSI_WATERMARK_LINK = '${GARBAYE_JITSI_URL}'; -" > `get_podman_volume_path ${conf_volume}`/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/90_prune.sh b/podman-jitsi/90_prune.sh deleted file mode 120000 index 5fed91e..0000000 --- a/podman-jitsi/90_prune.sh +++ /dev/null @@ -1 +0,0 @@ -../_podman-common/90_prune_pod.sh \ No newline at end of file diff --git a/podman-jitsi/90_prune.sh b/podman-jitsi/90_prune.sh new file mode 100755 index 0000000..ede4c89 --- /dev/null +++ b/podman-jitsi/90_prune.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/90_prune_pod.sh && +# Remove configuration volume +podman unshare rm -rf ~/${confvolume}/ diff --git a/podman-jitsi/vars.sh b/podman-jitsi/vars.sh index 8bfd41b..d609435 100644 --- a/podman-jitsi/vars.sh +++ b/podman-jitsi/vars.sh @@ -4,8 +4,7 @@ pod_name='podman-jitsi' service_name="pod-${pod_name}.service" upstream_images="docker.io/jitsi/jvb docker.io/jitsi/jicofo docker.io/jitsi/prosody docker.io/jitsi/web" version='stable-6865' -conf_volume='jitsi-meet-cfg' -nonpersistent_volumes="${conf_volume}" +confvolume='.jitsi-meet-cfg' listen_if="${GARBAYE_JITSI_ENV_LISTENIF:-127.0.0.1}" listen_port="${GARBAYE_JITSI_ENV_LISTENPORT:-8085}" GARBAYE_JITSI_URL="${GARBAYE_JITSI_ENV_URL:-https://jitsi.garbaye.fr}"