1
0
mirror of https://github.com/zokradonh/kopano-docker.git synced 2026-08-22 22:03:03 +00:00

Run all containers read-only (#314)

* switch containers in compose file to read-only
related to https://github.com/zokradonh/kopano-docker/issues/310
* make scheduler container read-only
* make meet container read-only
* fix konnect for read-only
* make core mostly read-only
* add custom location for ldap.cfg to default config
* sort config option for readability
* update makefile pull workaround
* make kdav read-only
* remove locale generation code from core startup
* fix commander tests
* fix store language tests
* add test for a dutch mailbox
* make it possible to run webapp read-only
* add locale hint to the compose file
* finish read-only mode for z-push
This commit is contained in:
Felix Bartels
2020-01-14 14:31:53 +01:00
committed by GitHub
parent 5a4335998d
commit 70e9940b38
26 changed files with 220 additions and 147 deletions
+5
View File
@@ -81,6 +81,11 @@ RUN \
COPY --from=builder /usr/share/kdav /usr/share/kdav
# tweaks to make the container read-only
RUN \
mv /usr/share/kdav/config.php /usr/share/kdav/config.php.dist && \
ln -s /tmp/config.php /usr/share/kdav/config.php
EXPOSE 80/tcp
COPY start.sh /kopano/start.sh
+8 -5
View File
@@ -8,6 +8,7 @@ ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""}
set -eu # unset variables are errors & non-zero return values exit the whole script
[ "$DEBUG" ] && set -x
# TODO this is not compatible with a read-only container
ADDITIONAL_KOPANO_PACKAGES=$(echo "$ADDITIONAL_KOPANO_PACKAGES" | tr -d '"')
[ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && apt update
[ -n "${ADDITIONAL_KOPANO_PACKAGES// }" ] && for installpkg in $ADDITIONAL_KOPANO_PACKAGES; do
@@ -20,16 +21,20 @@ done
echo "Ensure directories"
mkdir -p /run/sessions
CONFIG_PHP=/tmp/config.php
# copy latest config template. This should be the mount point for preexisting config files.
cp /usr/share/kdav/config.php.dist $CONFIG_PHP
if [ "$KCCONF_SERVERHOSTNAME" == "127.0.0.1" ]; then
echo "kDAV is using the default: connection"
else
echo "kDAV is using an ip connection"
sed -e "s#define([\"']MAPI_SERVER[\"'],\s*[\"']default:[\"'])#define('MAPI_SERVER', 'https://${KCCONF_SERVERHOSTNAME}:${KCCONF_SERVERPORT}/kopano')#" \
-i /usr/share/kdav/config.php
-i $CONFIG_PHP
fi
# change root uri to /kdav
sed -e "s#define('DAV_ROOT_URI', '/');#define('DAV_ROOT_URI', '/kdav/');#" -i /usr/share/kdav/config.php
sed -e "s#define('DAV_ROOT_URI', '/');#define('DAV_ROOT_URI', '/kdav/');#" -i $CONFIG_PHP
echo "Ensure config ownership"
chown -R www-data:www-data /run/sessions
@@ -40,10 +45,8 @@ dockerize \
-wait file:///var/lib/dbus/machine-id
touch /var/log/kdav/kdav.log
touch /var/log/kdav/kdav-error.log
chown www-data:www-data /var/log/kdav/kdav.log /var/log/kdav/kdav-error.log
chown www-data:www-data /var/log/kdav/kdav.log
tail --pid=$$ -F --lines=0 -q /var/log/kdav/kdav.log &
tail --pid=$$ -F --lines=0 -q /var/log/kdav/kdav-error.log &
echo "Starting Apache"
rm -f /run/apache2/apache2.pid