diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 9c87509f..2a7b13c0 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -48,6 +48,16 @@ http { # Actual logic location / { + if ($webmail != none) { + return 301 $scheme://$host/webmail/; + } + + if ($webmail = none) { + return 403; + } + } + + location /webmail { if ($webmail != none) { proxy_pass http://webmail; } diff --git a/rainloop/Dockerfile b/rainloop/Dockerfile index 46ba63fa..40174a6f 100644 --- a/rainloop/Dockerfile +++ b/rainloop/Dockerfile @@ -7,8 +7,9 @@ ENV RAINLOOP_URL https://github.com/RainLoop/rainloop-webmail/releases/download/ RUN echo date.timezone=UTC > /usr/local/etc/php/conf.d/timezone.ini -RUN cd /var/www/html \ - && rm -rf ./* \ +RUN rm -rf /var/www/html/ \ + && mkdir -p /var/www/html/webmail \ + && cd /var/www/html/webmail \ && curl -L -O ${RAINLOOP_URL} \ && unzip *.zip \ && rm -f *.zip \ @@ -17,7 +18,7 @@ RUN cd /var/www/html \ && find . -type f -exec chmod 644 {} \; \ && chown -R www-data: * -COPY include.php /var/www/html/include.php +COPY include.php /var/www/html/webmail/include.php COPY config.ini /config.ini COPY default.ini /default.ini diff --git a/roundcube/Dockerfile b/roundcube/Dockerfile index 1e41483a..cb7a3b21 100644 --- a/roundcube/Dockerfile +++ b/roundcube/Dockerfile @@ -11,17 +11,18 @@ ENV ROUNDCUBE_URL https://github.com/roundcube/roundcubemail/releases/download/1 RUN echo date.timezone=UTC > /usr/local/etc/php/conf.d/timezone.ini -RUN cd /tmp \ +RUN rm -rf /var/www/html/ \ + && mkdir /var/www/html \ + && cd /var/www/html \ && curl -L -O ${ROUNDCUBE_URL} \ && tar -xf *.tar.gz \ && rm -f *.tar.gz \ - && rm -rf /var/www/html \ - && mv roundcubemail-* /var/www/html \ - && cd /var/www/html \ + && mv roundcubemail-* webmail \ + && cd webmail \ && rm -rf CHANGELOG INSTALL LICENSE README.md UPGRADING composer.json-dist installer \ && chown -R www-data: logs -COPY config.inc.php /var/www/html/config/ +COPY config.inc.php /var/www/html/webmail/config/ COPY start.sh /start.sh