Commit 4d8610d3 authored by ale's avatar ale

Do not perform privileged operations at runtime

Allow all user-owned directories to be bind-mounted by docker (so we
don't have to know which user we'll be running as at runtime).
parent b479d65c
Pipeline #1184 failed with stages
in 2 minutes and 23 seconds
# Which Roundcube version to install.
RC_VERSION = 1.3.6
RC_VERSION = 1.3.7
TARGET = ./build
......@@ -64,18 +64,32 @@ rsync -a /tmp/conf/ /etc/
# Setup Apache.
# Fix runtime permissions for the Roundcube data directories.
for d in temp logs ; do
chown www-data:www-data /var/www/webmail/$d
chmod 700 /var/www/webmail/$d
# Ensure that the startup script is executable.
chmod 755 /
# Create config mountpoint
mkdir -p /etc/roundcube
# Link all plugin configuration files back to /etc/roundcube, so we
# can provide the entire configuration by bind-mounting a single
# directory.
ln -sf /etc/roundcube/ /var/www/webmail/config/
for plugin in $(cd /var/www/webmail/plugins && echo *); do
test -d /var/www/webmail/plugins/${plugin} || continue
rm -f /var/www/webmail/plugins/${plugin}/
ln -sf /etc/roundcube/${plugin} \
# Create writable storage mountpoint
mkdir -p /data
# Fix runtime permissions for the Roundcube data directories.
for d in temp logs ; do
rm -f /var/www/webmail/$d
ln -sf /data/$d /var/www/webmail/$d
# Remove packages used for installation.
apt-get remove -y --purge ${BUILD_PACKAGES}
apt-get autoremove -y
......@@ -31,19 +31,9 @@ test -n "${DOMAIN}" \
test -n "${SHARD_ID}" \
|| die "the 'SHARD_ID' environment variable is not defined"
# Install the main Roundcube configuration to TARGET_DIR/config.
# Verify that the main Roundcube configuration is in place.
test -e ${CONFIG_DIR}/ \
|| die "${CONFIG_DIR}/ is missing"
install -o root -g root -m 644 ${CONFIG_DIR}/ ${TARGET_DIR}/config/
# For each known plugin, look for a file in
# the config directory: if found, copy it to the plugin directory
# as plugins/NAME/
for p in $(cd ${TARGET_DIR}/plugins && echo *) ; do
test -e "${CONFIG_DIR}/${p}" \
&& install -o root -g root -m 644 ${CONFIG_DIR}/${p} \
# Now set up the MySQL database for Roundcube. The current Roundcube
# version is stored in the database.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment