From 045ca52d7908f0cf8254b7c7e94d53a98d17d492 Mon Sep 17 00:00:00 2001 From: Felix Bartels <1257835+fbartels@users.noreply.github.com> Date: Tue, 15 Sep 2020 11:29:41 +0200 Subject: [PATCH] fallback to a hardcoded value in case FQDNCLEANED is not set (#443) * fallback to a hardcoded value in case FQDNCLEANED is not set * strip ports in kweb startup script --- docker-compose.yml | 4 ++-- examples/apache-proxy.md | 2 +- examples/meet/docker-compose.yml | 4 ++-- web/README.md | 2 +- web/wrapper.sh | 3 +++ 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 642349a..3c68c08 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: environment: - DEFAULTREDIRECT=${DEFAULTREDIRECT:-/webapp} - EMAIL=${EMAIL:-off} - - FQDN=${FQDNCLEANED?err} + - FQDN=${FQDN} - TLS_MODE=tls_auto volumes: - /etc/machine-id:/etc/machine-id @@ -17,7 +17,7 @@ services: networks: web-net: aliases: - - ${FQDNCLEANED?err} + - ${FQDNCLEANED:-domain.invalid} kopano_ssl: image: ${docker_repo:-zokradonh}/kopano_ssl:${SSL_VERSION:-latest} diff --git a/examples/apache-proxy.md b/examples/apache-proxy.md index c10e9f5..6f4ffe2 100644 --- a/examples/apache-proxy.md +++ b/examples/apache-proxy.md @@ -2,7 +2,7 @@ Example provided by [ronnybremer](https://github.com/ronnybremer) in [Add reverse proxy example for Apache](https://github.com/zokradonh/kopano-docker/issues/372). -To be able to use a different proxy, than the bundled kweb the env variable `FQDNCLEANED` needs to be set to an invalid value (to not route traffic through it, but the external proxy). Additionally `EMAIL` needs to be set to `off`. +To be able to use a different proxy, than the bundled kweb the env variable `FQDNCLEANED` needs to be unset (to not route traffic through it, but the external proxy). Additionally `EMAIL` needs to be set to `off`. ```bash diff --git a/examples/meet/docker-compose.yml b/examples/meet/docker-compose.yml index eea2065..2d2461c 100644 --- a/examples/meet/docker-compose.yml +++ b/examples/meet/docker-compose.yml @@ -11,7 +11,7 @@ services: environment: - DEFAULTREDIRECT=/meet - EMAIL=${EMAIL:-off} - - FQDN=${FQDNCLEANED?err} + - FQDN=${FQDN} command: wrapper.sh volumes: - /etc/machine-id:/etc/machine-id @@ -20,7 +20,7 @@ services: networks: web-net: aliases: - - ${FQDNCLEANED?err} + - ${FQDNCLEANED:-domain.invalid} ldap: image: ${docker_repo:-kopano}/${LDAP_CONTAINER:-kopano_ldap_demo}:${LDAP_VERSION:-latest} diff --git a/web/README.md b/web/README.md index 89682a8..61aee5c 100644 --- a/web/README.md +++ b/web/README.md @@ -42,7 +42,7 @@ TLS_MODE=tls_off In case there is already an ssl terminating proxy in the network this container can be switched to plain http by either setting `EMAIL=off` or `TLS_MODE=tls_off`. -In addition to this the default docker-compose.yml has a tweak to [route all traffic for the configured domain through this container](https://github.com/zokradonh/kopano-docker/blob/3572fc74e7054c9774985e69aeed745f9e5d1a4f/docker-compose.yml#L19-L20). This route needs to be changed when this container is only offering http access by either putting another domain in `FQDNCLEANED` or removing this section altogether. +In addition to this the default docker-compose.yml has a tweak to [route all traffic for the configured domain through this container](https://github.com/zokradonh/kopano-docker/blob/3572fc74e7054c9774985e69aeed745f9e5d1a4f/docker-compose.yml#L19-L20). This route needs to be changed when this container is only offering http access by removing `FQDNCLEANED` from `.env`. When using an external reverse proxy it is recommended to proxy connections to port 2015 of this container. Additionally connections to `/api/kwm/v2/rtm/websocket` need to be upgraded to websocket connections. diff --git a/web/wrapper.sh b/web/wrapper.sh index 05ba2eb..89a767c 100755 --- a/web/wrapper.sh +++ b/web/wrapper.sh @@ -10,6 +10,9 @@ fi export CADDYPATH="$KOPANO_KWEB_ASSETS_PATH" +# remove ports from FQDN +export FQDN=${FQDN%:*} + # services need to be aware of the machine-id if [ "$AUTOCONFIGURE" = true ]; then dockerize \