From edecacd0c07e872942e39a425ad84977cd78540a Mon Sep 17 00:00:00 2001 From: Mathieu Brunot Date: Sat, 27 Jun 2020 16:21:31 +0200 Subject: [PATCH] etherpad: add ability to use a external server --- docker-compose.yml | 1 + env.example | 4 +++- examples/traefik-v2/docker-compose.yml | 1 + examples/traefik/docker-compose.yml | 1 + web/rootfs/etc/cont-init.d/10-config | 14 ++++++++++---- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 318f68e..bab3938 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,6 +30,7 @@ services: - XMPP_MUC_DOMAIN - XMPP_RECORDER_DOMAIN - ETHERPAD_URL_BASE + - ETHERPAD_PUBLIC_URL - TZ - JIBRI_BREWERY_MUC - JIBRI_PENDING_TIMEOUT diff --git a/env.example b/env.example index 4200b5b..961822e 100644 --- a/env.example +++ b/env.example @@ -68,9 +68,11 @@ TZ=UTC # Etherpad integration (for document sharing) # -# Set etherpad-lite URL (uncomment to enable) +# Set etherpad-lite URL in docker local network (uncomment to enable) #ETHERPAD_URL_BASE=http://etherpad.meet.jitsi:9001 +# Set etherpad-lite public URL (uncomment to enable) +#ETHERPAD_PUBLIC_URL=https://etherpad.my.domain # # Basic Jigasi configuration options (needed for SIP gateway support) diff --git a/examples/traefik-v2/docker-compose.yml b/examples/traefik-v2/docker-compose.yml index bc420cf..ad87480 100644 --- a/examples/traefik-v2/docker-compose.yml +++ b/examples/traefik-v2/docker-compose.yml @@ -26,6 +26,7 @@ services: - XMPP_MUC_DOMAIN - XMPP_RECORDER_DOMAIN - ETHERPAD_URL_BASE + - ETHERPAD_PUBLIC_URL - TZ - JIBRI_BREWERY_MUC - JIBRI_PENDING_TIMEOUT diff --git a/examples/traefik/docker-compose.yml b/examples/traefik/docker-compose.yml index 75f141a..4848754 100644 --- a/examples/traefik/docker-compose.yml +++ b/examples/traefik/docker-compose.yml @@ -27,6 +27,7 @@ services: - XMPP_MUC_DOMAIN - XMPP_RECORDER_DOMAIN - ETHERPAD_URL_BASE + - ETHERPAD_PUBLIC_URL - TZ - JIBRI_BREWERY_MUC - JIBRI_PENDING_TIMEOUT diff --git a/web/rootfs/etc/cont-init.d/10-config b/web/rootfs/etc/cont-init.d/10-config index 8e9c8a0..3414fe5 100644 --- a/web/rootfs/etc/cont-init.d/10-config +++ b/web/rootfs/etc/cont-init.d/10-config @@ -97,10 +97,16 @@ if [[ ! -f /config/config.js ]]; then /config/config.js fi - if [[ ! -z "${ETHERPAD_URL_BASE}" && -z "$(grep -om1 'etherpad_base:' /config/config.js)" ]]; then - sed -i \ - -e "/enableWelcomePage/a\ etherpad_base: '${PUBLIC_URL}/etherpad/p/'," \ - /config/config.js + if [[ -z "$(grep -om1 'etherpad_base:' /config/config.js)" ]]; then + if [[ ! -z "${ETHERPAD_PUBLIC_URL}" ]]; then + sed -i \ + -e "/enableWelcomePage/a\ etherpad_base: '${ETHERPAD_PUBLIC_URL}/p/'," \ + /config/config.js + elif [[ ! -z "${ETHERPAD_URL_BASE}" ]]; then + sed -i \ + -e "/enableWelcomePage/a\ etherpad_base: '${PUBLIC_URL}/etherpad/p/'," \ + /config/config.js + fi fi if [[ $ENABLE_TRANSCRIPTIONS -eq 1 || "$ENABLE_TRANSCRIPTIONS" == "true" ]]; then