2021-06-04 17:36:50 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
|
|
|
|
source ${ABSDIR}/../functions.sh
|
|
|
|
source ${ABSDIR}/vars.sh
|
|
|
|
|
|
|
|
ensure_pwd_is_scriptdir
|
|
|
|
ensure_not_root
|
|
|
|
|
2022-01-28 20:15:15 +00:00
|
|
|
ensure_pod_not_exists ${pod_name}
|
2023-05-03 16:55:21 +00:00
|
|
|
ensure_variables_are_defined "$envvars"
|
2022-01-28 20:15:15 +00:00
|
|
|
|
2022-09-03 13:08:06 +00:00
|
|
|
if [[ -d ${confvolume} ]]; then
|
|
|
|
echo "Error : conf volume ${confvolume} already exists. Please consider running 80_destroy.sh."
|
2021-06-06 12:17:26 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2022-08-12 19:01:57 +00:00
|
|
|
for image in ${upstream_images}; do
|
2022-11-13 13:07:31 +00:00
|
|
|
if ! podman image exists ${image}:${version}; then
|
|
|
|
podman image pull ${image}:${version} || exit 1
|
|
|
|
fi
|
2022-08-12 19:01:57 +00:00
|
|
|
done &&
|
2022-02-24 21:45:31 +00:00
|
|
|
|
2022-09-03 13:08:06 +00:00
|
|
|
mkdir -p ${confvolume}/{web/letsencrypt,web/crontabs,transcripts,prosody/config,prosody/prosody-plugins-custom,jicofo,jvb,jigasi,jibri}
|
2022-02-20 12:14:26 +00:00
|
|
|
|
|
|
|
# Patch config.js
|
|
|
|
echo "
|
2023-11-17 12:02:21 +00:00
|
|
|
config.enableInsecureRoomNameWarning = false;
|
2022-02-20 12:14:26 +00:00
|
|
|
|
|
|
|
config.disableThirdPartyRequests = true;
|
2022-09-03 13:08:06 +00:00
|
|
|
" > ${confvolume}/web/custom-config.js
|
2022-02-20 12:14:26 +00:00
|
|
|
|
2022-09-03 13:08:06 +00:00
|
|
|
# Patch ${confvolume}/web/interface_config.js
|
2022-02-20 12:14:26 +00:00
|
|
|
echo "
|
|
|
|
interfaceConfig.APP_NAME = 'Jitsi Garbaye';
|
|
|
|
interfaceConfig.DEFAULT_REMOTE_DISPLAY_NAME = 'Participant';
|
|
|
|
interfaceConfig.JITSI_WATERMARK_LINK = '${GARBAYE_JITSI_URL}';
|
2022-09-03 13:08:06 +00:00
|
|
|
" > ${confvolume}/web/custom-interface_config.js
|
2022-02-20 12:14:26 +00:00
|
|
|
|
2021-06-04 17:36:50 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
# Patch docker-compose.yml
|
2022-08-12 19:08:18 +00:00
|
|
|
sed_in_place "image: jitsi/" "image: git.garbaye.fr/garbaye/jitsi-" docker-compose.yml
|
2022-02-11 13:29:04 +00:00
|
|
|
sed_in_place "^ - '\${HTTP_PORT}:80'" " - '\${listen_if}:\${HTTP_PORT}:80'" docker-compose.yml
|
2021-06-04 17:36:50 +00:00
|
|
|
sed_in_place "^ - '\${HTTPS_PORT}:443'" "# - '\${HTTPS_PORT}:443'" docker-compose.yml
|
|
|
|
|
|
|
|
# Patch env file
|
2022-02-11 13:29:04 +00:00
|
|
|
sed_in_place "^HTTP_PORT=8000" "HTTP_PORT=${listen_port}" .env
|
2021-06-04 17:36:50 +00:00
|
|
|
sed_in_place "^HTTPS_PORT=8443" "#HTTPS_PORT=8443" .env
|
|
|
|
sed_in_place "^TZ=UTC" "TZ=Europe/Paris" .env
|
2021-06-06 12:28:20 +00:00
|
|
|
sed_in_place "^#PUBLIC_URL=https://meet.example.com" "PUBLIC_URL=${GARBAYE_JITSI_URL}" .env
|
2022-11-15 18:35:12 +00:00
|
|
|
sed_in_place "^#JVB_ADVERTISE_IPS=192.168.1.1,1.2.3.4" "JVB_ADVERTISE_IPS=${GARBAYE_JITSI_PRIV_IP}" .env
|
2021-06-04 17:36:50 +00:00
|
|
|
sed_in_place "^#ENABLE_LETSENCRYPT=1" "ENABLE_LETSENCRYPT=0" .env
|
|
|
|
|
2021-09-18 21:44:27 +00:00
|
|
|
echo "ENABLE_P2P=false" >> .env
|
2022-06-20 19:40:37 +00:00
|
|
|
echo "XMPP_SERVER=prosody" >> .env
|
2022-06-20 19:43:04 +00:00
|
|
|
echo "XMPP_BOSH_URL_BASE=http://prosody:5280" >> .env
|
2022-06-20 19:49:29 +00:00
|
|
|
echo "JVB_PORT=${listen_port}" >> .env
|
2024-02-17 17:01:01 +00:00
|
|
|
echo "JICOFO_REST_PORT=${jicofo_port}" >> .env
|
2024-02-17 17:36:29 +00:00
|
|
|
echo "JVB_COLIBRI_PORT=${colibri_port}" >> .env
|
2022-06-20 19:49:29 +00:00
|
|
|
echo "DISABLE_HTTPS=1" >> .env
|
|
|
|
echo "ENABLE_IPV6=0" >> .env
|
2024-02-17 17:36:29 +00:00
|
|
|
echo "COLIBRI_REST_ENABLED=1" >> .env
|
2021-09-18 21:44:27 +00:00
|
|
|
|
2022-02-11 13:29:04 +00:00
|
|
|
export listen_if
|
|
|
|
export listen_port
|
|
|
|
|
2024-06-11 20:04:14 +00:00
|
|
|
${my_podman_compose} --pod-args "--infra=true --infra-name=${project_name}_infra --share=" --podman-run-args "--requires=${project_name}_infra --env-file .env" up -d &&
|
2022-11-04 12:07:13 +00:00
|
|
|
|
2022-02-12 12:37:59 +00:00
|
|
|
# Wait for web to be up
|
2023-04-21 11:53:55 +00:00
|
|
|
( podman container logs --tail=3 -f ${project_name}_web_1 2>&1 & ) | grep -q '^\[services.d\] done.$' &&
|
|
|
|
podman container cp assets/welcome-background.png ${project_name}_web_1:/usr/share/jitsi-meet/images/welcome-background.png &&
|
|
|
|
podman container exec -t ${project_name}_web_1 chmod 444 /usr/share/jitsi-meet/images/welcome-background.png &&
|
2022-02-12 12:37:59 +00:00
|
|
|
podman pod stop ${pod_name} && echo Pod built and stopped.
|
2021-06-04 17:36:50 +00:00
|
|
|
|
|
|
|
# cleanup
|
2022-01-15 19:32:22 +00:00
|
|
|
shred -u .env .env.bak env.example gen-passwords.sh docker-compose.yml
|