diff --git a/web/Dockerfile b/web/Dockerfile index 2f1d8659..bb603537 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -6,6 +6,21 @@ ARG CODE_VERSION ENV CODE_VERSION="${CODE_VERSION}" ENV DEFAULTREDIRECT="/webapp" +# Workaround to not break backwards compatibility, +# since an underscore is not a valid char in a hostname. +# This causes issues when using kweb in kubernetes. +# Related issue https://github.com/docker/compose/issues/229 +ENV KWEBD_DNS_KONNECT="kopano_konnect" +ENV KWEBD_DNS_MEET="kopano_meet" +ENV KWEBD_DNS_KAPI="kopano_kapi" +ENV KWEBD_DNS_PLAYGROUND="kopano_playground" +ENV KWEBD_DNS_KWMSERVER="kopano_kwmserver" +ENV KWEBD_DNS_WEBAPP="kopano_webapp" +ENV KWEBD_DNS_ZPUSH="kopano_zpush" +ENV KWEBD_DNS_ICAL="kopano_ical" +ENV KWEBD_DNS_KDAV="kopano_kdav" +ENV KWEBD_DNS_GRAPI="kopano_grapi" +ENV KWEBD_DNS_ICAL="kopano_ical" COPY wrapper.sh /usr/local/bin COPY kweb.cfg /etc/kweb.cfg diff --git a/web/kweb.cfg b/web/kweb.cfg index 1a347b14..c4c00327 100644 --- a/web/kweb.cfg +++ b/web/kweb.cfg @@ -1,7 +1,6 @@ {%FQDN%}:80, *:80 { log stdout errors stdout - redir / https://{host}{uri} } @@ -26,7 +25,7 @@ } # Config - proxy /api/config/v1/kopano/meet/ http://kopano_meet:9080/ { + proxy /api/config/v1/kopano/meet/ http://{%KWEBD_DNS_MEET%}:9080/ { fail_timeout 10s try_duration 30s transparent @@ -36,7 +35,7 @@ # Konnect proxy /upstreams/konnect/ { without /upstreams/konnect/ - upstream kopano_konnect:8777 + upstream {%KWEBD_DNS_KONNECT%}:8777 policy least_conn health_check /health-check fail_timeout 10s @@ -65,7 +64,7 @@ # Kapi proxy /upstreams/kapi/ { without /upstreams/kapi/ - upstream kopano_kapi:8039 + upstream {%KWEBD_DNS_KAPI%}:8039 policy least_conn health_check /health-check fail_timeout 10s @@ -89,7 +88,7 @@ } # playground for oidc - proxy /oidc-playground/ http://kopano_playground:8888/ { + proxy /oidc-playground/ http://{%KWEBD_DNS_PLAYGROUND%}:8888/ { fail_timeout 10s try_duration 30s transparent @@ -98,7 +97,7 @@ folderish /oidc-playground # playground for Kapi - proxy /kapi-playground/ http://kopano_playground:8888/ { + proxy /kapi-playground/ http://{%KWEBD_DNS_PLAYGROUND%}:8888/ { fail_timeout 10s try_duration 30s transparent @@ -109,7 +108,7 @@ # Kwmserver proxy /upstreams/kwmserver/ { without /upstreams/kwmserver/ - upstream kopano_kwmserver:8778 + upstream {%KWEBD_DNS_KWMSERVER%}:8778 policy least_conn health_check /health-check fail_timeout 10s @@ -126,7 +125,7 @@ to /upstreams/kwmserver/{path} } - proxy /meet/ kopano_meet:9080 { + proxy /meet/ {%KWEBD_DNS_MEET%}:9080 { fail_timeout 10s try_duration 30s transparent @@ -134,7 +133,7 @@ } folderish /meet - proxy /webapp/ kopano_webapp:9080 { + proxy /webapp/ {%KWEBD_DNS_WEBAPP%}:9080 { fail_timeout 10s try_duration 30s transparent @@ -142,41 +141,41 @@ } folderish /webapp - proxy /Microsoft-Server-ActiveSync kopano_zpush:80 { + proxy /Microsoft-Server-ActiveSync {%KWEBD_DNS_ZPUSH%}:80 { transparent keepalive 0 timeout 3540s } - proxy /AutoDiscover/AutoDiscover.xml kopano_zpush:80 { + proxy /AutoDiscover/AutoDiscover.xml {%KWEBD_DNS_ZPUSH%}:80 { transparent keepalive 0 fail_timeout 10s try_duration 30s } - proxy /Autodiscover/Autodiscover.xml kopano_zpush:80 { + proxy /Autodiscover/Autodiscover.xml {%KWEBD_DNS_ZPUSH%}:80 { transparent keepalive 0 fail_timeout 10s try_duration 30s } - proxy /autodiscover/autodiscover.xml kopano_zpush:80 { + proxy /autodiscover/autodiscover.xml {%KWEBD_DNS_ZPUSH%}:80 { transparent keepalive 0 fail_timeout 10s try_duration 30s } - proxy /caldav/ kopano_ical:8080 { + proxy /caldav/ {%KWEBD_DNS_ICAL%}:8080 { fail_timeout 10s try_duration 30s transparent } folderish /caldav - proxy /kdav/ kopano_kdav:80 { + proxy /kdav/ {%KWEBD_DNS_KDAV%}:80 { transparent keepalive 0 fail_timeout 10s @@ -200,7 +199,7 @@ } redir /password-reset /password-reset/ - proxy /grapi-explorer/ http://kopano_grapi-explorer:3000/ { + proxy /grapi-explorer/ http://{%KWEBD_DNS_GRAPI%}-explorer:3000/ { fail_timeout 10s try_duration 30s transparent