Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Make HTTP daemons use public_html/ as document root #321

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ LABEL org.opencontainers.image.source="https://github.com/roundcube/roundcubemai
RUN apt-get update && apt-get -y upgrade && apt-get clean

RUN set -ex; \
if [ "apache" = "apache" ]; then a2enmod rewrite; fi; \
if [ "apache" = "apache" ]; then \
a2enmod rewrite; \
# Make Apache use public_html/ as document root to protect files outside of it \
# against unauthorized access. \
# This is possible and recommended since a while, and will be required for Roundcubemail v1.7. \
sed -i -e 's|\(DocumentRoot /var/www/html\)$|\1/public_html|' /etc/apache2/sites-available/000-default.conf; \
fi; \
apt-get update; \
\
savedAptMark="$(apt-mark showmanual)"; \
Expand Down
2 changes: 1 addition & 1 deletion examples/nginx/templates/default.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ server {
server_name php-docker.local;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /var/www/html;
root /var/www/html/public_html;

location ~ /(temp|logs)/ {
deny all;
Expand Down
8 changes: 7 additions & 1 deletion fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ LABEL org.opencontainers.image.source="https://github.com/roundcube/roundcubemai
RUN apt-get update && apt-get -y upgrade && apt-get clean

RUN set -ex; \
if [ "fpm" = "apache" ]; then a2enmod rewrite; fi; \
if [ "fpm" = "apache" ]; then \
a2enmod rewrite; \
# Make Apache use public_html/ as document root to protect files outside of it \
# against unauthorized access. \
# This is possible and recommended since a while, and will be required for Roundcubemail v1.7. \
sed -i -e 's|\(DocumentRoot /var/www/html\)$|\1/public_html|' /etc/apache2/sites-available/000-default.conf; \
fi; \
apt-get update; \
\
savedAptMark="$(apt-mark showmanual)"; \
Expand Down
3 changes: 2 additions & 1 deletion nightly/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ RUN set -ex; \
rm roundcubemail.tar.gz; \
mv /usr/src/roundcubemail-master /usr/src/roundcubemail; \
cd /usr/src/roundcubemail; \
rm -rf installer tests public_html .ci .github .gitignore .editorconfig .tx .travis.yml; \
rm -rf installer tests .ci .github .gitignore .editorconfig .tx .travis.yml; \
[ -f public_html/installer.php ] && rm -f public_html/installer.php; \
make css-elastic; \
composer require kolab/net_ldap3 --no-install; \
composer require bjeavons/zxcvbn-php --no-install; \
Expand Down
8 changes: 7 additions & 1 deletion templates/Dockerfile-debian.templ
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,13 @@ LABEL org.opencontainers.image.source="https://github.com/roundcube/roundcubemai
RUN apt-get update && apt-get -y upgrade && apt-get clean

RUN set -ex; \
if [ "%%VARIANT%%" = "apache" ]; then a2enmod rewrite; fi; \
if [ "%%VARIANT%%" = "apache" ]; then \
a2enmod rewrite; \
# Make Apache use public_html/ as document root to protect files outside of it \
# against unauthorized access. \
# This is possible and recommended since a while, and will be required for Roundcubemail v1.7. \
sed -i -e 's|\(DocumentRoot /var/www/html\)$|\1/public_html|' /etc/apache2/sites-available/000-default.conf; \
fi; \
apt-get update; \
\
savedAptMark="$(apt-mark showmanual)"; \
Expand Down
Loading