Page MenuHomePhorge

No OneTemporary

Authored By
Unknown
Size
12 KB
Referenced Files
None
Subscribers
None
diff --git a/docker/roundcube/Dockerfile b/docker/roundcube/Dockerfile
index ea08dea6..bc6eed20 100644
--- a/docker/roundcube/Dockerfile
+++ b/docker/roundcube/Dockerfile
@@ -1,133 +1,135 @@
FROM apheleia/almalinux9
ENV HOME=/opt/app-root/src
# Add kolab
RUN rpm --import https://mirror.apheleia-it.ch/repos/Kolab:/16/key.asc && \
rpm -Uvh https://mirror.apheleia-it.ch/repos/Kolab:/16/kolab-16-for-el9.rpm
# Install php modules
RUN sed -i -e '/^ssl/d' /etc/yum.repos.d/kolab*.repo && \
dnf config-manager --enable kolab-16 &&\
dnf -y --setopt=install_weak_deps=False --setopt tsflags= install php-kolab php-kolabformat \
composer \
diffutils \
file \
git \
make \
unzip \
curl-minimal \
mariadb \
which \
rsync \
openssl \
httpd \
patch \
php-cli \
php-common \
php-ldap \
php-opcache \
php-pecl-apcu \
php-mysqlnd \
php-gd \
php-fpm \
php-pear \
php-redis \
ImageMagick \
re2c \
npm \
wget && \
dnf clean all
RUN npm install -g less less-plugin-clean-css
WORKDIR ${HOME}
COPY rootfs/opt/app-root/src/build.sh /opt/app-root/src/
COPY rootfs/opt/app-root/src/update.sh /opt/app-root/src/
COPY rootfs/opt/app-root/src/composer.json /opt/app-root/src/
COPY rootfs/opt/app-root/src/roundcubemail-config-templates /opt/app-root/src/roundcubemail-config-templates
ARG GIT_REF_ROUNDCUBEMAIL=dev/kolab-1.5
ARG GIT_REMOTE_ROUNDCUBEMAIL=https://git.kolab.org/source/roundcubemail.git
ARG GIT_REF_ROUNDCUBEMAIL_PLUGINS=master
ARG GIT_REMOTE_ROUNDCUBEMAIL_PLUGINS=https://git.kolab.org/diffusion/RPK/roundcubemail-plugins-kolab.git
ARG GIT_REF_CHWALA=master
ARG GIT_REMOTE_CHWALA=https://git.kolab.org/diffusion/C/chwala.git
ARG GIT_REF_SYNCROTON=master
ARG GIT_REMOTE_SYNCROTON=https://git.kolab.org/diffusion/S/syncroton.git
ARG GIT_REF_AUTOCONF=master
ARG GIT_REMOTE_AUTOCONF=https://git.kolab.org/diffusion/AC/autoconf.git
ARG GIT_REF_IRONY=master
ARG GIT_REMOTE_IRONY=https://git.kolab.org/source/iRony.git
ARG GIT_REF_FREEBUSY=master
ARG GIT_REMOTE_FREEBUSY=https://git.kolab.org/diffusion/F/freebusy.git
ARG GIT_REMOTE_SKIN_ELASTIC=""
ARG GIT_REF_SKIN_ELASTIC=master
ARG SKINS=kolab
RUN /opt/app-root/src/build.sh && \
for PATH in /run/php-fpm /run/httpd /var/log/httpd /var/lib/httpd /data /opt/app-root; \
do \
/usr/bin/mkdir -p $PATH; \
/usr/bin/chmod -R 777 $PATH; \
/usr/bin/chown -R 1001:0 $PATH; \
/usr/bin/chmod -R g=u $PATH; \
done
COPY /rootfs /
RUN chmod 777 /opt/app-root/src
RUN chmod -R 777 /etc/php.ini /etc/httpd /opt/app-root/src/*.sh
VOLUME /data
ENV RUN_MIGRATIONS=true
ENV KOLABOBJECTS_COMPAT_MODE=false
ENV LOGDRIVER=logfmt
ENV SKIN=kolab
ENV PRODUCT_NAME="Kolab Groupware"
# ENV SUPPORT_URL=
# ENV FILEAPI_KOLABFILES_BASEURI=
# ENV FILEAPI_WOPI_OFFICE=
# ENV FILE_API_URL=
# ENV FILE_API_SERVER_URL=
# ENV CALENDAR_CALDAV_SERVER=
# ENV TASKLIST_CALDAV_SERVER=
# ENV KOLAB_ADDRESSBOOK_CARDDAV_SERVER=
# ENV KOLAB_FILES_URL=
# ENV KOLAB_FILES_SERVER_URL=
# ENV IMAP_HOST=
# ENV IMAP_PORT=
# ENV IMAP_TLS=
# ENV IMAP_PROXY_PROTOCOL=
# ENV IMAP_ADMIN_LOGIN=
# ENV IMAP_ADMIN_PASSWORD=
# ENV DB_RC_USERNAME=
# ENV DB_RC_PASSWORD=
# ENV DB_RC_DATABASE=
# ENV DB_HOST=
# ENV DES_KEY=
# ENV APP_DOMAIN=
# ENV PROXY_WHITELIST=
# ENV SUBMISSION_HOST=
# ENV SUBMISSION_PORT=
# ENV SUBMISSION_ENCRYPTION=
# ENV DISABLED_PLUGINS=
# ENV EXTRA_PLUGINS=
# ENV SQL_DEBUG=
# ENV MEMCACHE_DEBUG=
# ENV IMAP_DEBUG=
# ENV SMTP_DEBUG=
# ENV DAV_DEBUG=
# ENV ACTIVESYNC_DEBUG=
# ENV REDIS_HOST=
# ENV REDIS_PASSWORD=
+ENV CALDAV_WELLKNOWN_REDIRECT_PATH="/dav/calendars/user"
+ENV CARDDAV_WELLKNOWN_REDIRECT_PATH="/dav/addressbooks/user"
USER 1001
EXPOSE 8080
# https://httpd.apache.org/docs/2.4/stopping.html#gracefulstop
STOPSIGNAL SIGWINCH
CMD [ "/opt/app-root/src/init.sh" ]
diff --git a/docker/roundcube/rootfs/etc/httpd/conf.d/well-known.conf b/docker/roundcube/rootfs/etc/httpd/conf.d/well-known.conf
index b5dcd744..acf0d6ef 100644
--- a/docker/roundcube/rootfs/etc/httpd/conf.d/well-known.conf
+++ b/docker/roundcube/rootfs/etc/httpd/conf.d/well-known.conf
@@ -1,4 +1,4 @@
RewriteEngine On
RewriteCond %{REQUEST_URI} (/.well-known/caldav|/.well-known/carddav)
-RewriteRule /.well-known/caldav(.*) https://%{HTTP_HOST}/dav/calendars/user$1 [R=301,L]
-RewriteRule /.well-known/carddav(.*) https://%{HTTP_HOST}/dav/addressbooks/user$1 [R=301,L]
+RewriteRule /.well-known/caldav(.*) https://%{HTTP_HOST}CALDAV_WELLKNOWN_REDIRECT_PATH$1 [R=301,L]
+RewriteRule /.well-known/carddav(.*) https://%{HTTP_HOST}CARDDAV_WELLKNOWN_REDIRECT_PATH$1 [R=301,L]
diff --git a/docker/roundcube/rootfs/opt/app-root/src/init.sh b/docker/roundcube/rootfs/opt/app-root/src/init.sh
index 012ac7f7..b8f32886 100755
--- a/docker/roundcube/rootfs/opt/app-root/src/init.sh
+++ b/docker/roundcube/rootfs/opt/app-root/src/init.sh
@@ -1,223 +1,227 @@
#!/bin/bash
echo "Starting"
set -e
set -x
mkdir -p /data/pgp-home
chmod 777 /data/pgp-home
pushd /opt/app-root/src/
if [[ $1 == "" ]]; then
if [ -d /src.orig/ ]; then
echo "----> Updating source"
./update.sh
fi
fi
## Copy our configs over the default ones
cp /opt/app-root/src/roundcubemail-config-templates/* roundcubemail/config/
if [[ "$RUN_MIGRATIONS" == "true" ]]; then
# Initialize the db
if [[ "$DB_ROOT_PASSWORD" == "" ]]; then
echo "Not using password"
cat > /tmp/kolab-setup-my.cnf << EOF
[client]
host=${DB_HOST}
user=root
EOF
else
cat > /tmp/kolab-setup-my.cnf << EOF
[client]
host=${DB_HOST}
user=root
password=${DB_ROOT_PASSWORD}
EOF
fi
mysql --defaults-file=/tmp/kolab-setup-my.cnf <<EOF
CREATE DATABASE IF NOT EXISTS $DB_RC_DATABASE CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER IF NOT EXISTS $DB_RC_USERNAME@'%' IDENTIFIED BY '$DB_RC_PASSWORD';
CREATE USER IF NOT EXISTS $DB_RC_USERNAME@'127.0.0.1' IDENTIFIED BY '$DB_RC_PASSWORD';
ALTER USER $DB_RC_USERNAME@'%' IDENTIFIED BY '$DB_RC_PASSWORD';
ALTER USER $DB_RC_USERNAME@'127.0.0.1' IDENTIFIED BY '$DB_RC_PASSWORD';
GRANT ALL PRIVILEGES ON $DB_RC_DATABASE.* TO $DB_RC_USERNAME@'%';
FLUSH PRIVILEGES;
EOF
pushd roundcubemail
# Run roundcube and plugin database initializations
echo "Initializing tables..."
bin/initdb.sh --dir SQL/ || :
for plugin in $(find plugins -mindepth 1 -maxdepth 1 -type d | sort); do
if [ ! -z "$(find ${plugin} -type d -name SQL)" ]; then
for dir in $(find plugins/$(basename ${plugin})/ -type d -name SQL); do
# Skip plugins with multiple drivers and no kolab driver
if [ ! -z "$(echo $dir | grep driver)" ]; then
if [ -z "$(echo $dir | grep kolab)" ]; then
continue
fi
fi
bin/initdb.sh \
--dir $dir \
--package $(basename ${plugin}) \
>/dev/null 2>&1 || :
done
fi
done
popd
roundcubemail/bin/initdb.sh --dir syncroton/docs/SQL/ || :
roundcubemail/bin/initdb.sh --dir chwala/doc/SQL/ || :
echo "Updating tables..."
roundcubemail/bin/updatedb.sh --dir syncroton/docs/SQL/ --package syncroton || :
roundcubemail/bin/updatedb.sh --dir roundcubemail/SQL/ --package roundcube || :
roundcubemail/bin/updatedb.sh --dir roundcubemail/plugins/libkolab/SQL/ --package libkolab || :
roundcubemail/bin/updatedb.sh --dir roundcubemail/plugins/calendar/drivers/kolab/SQL/ --package calendar-kolab || :
fi
echo ""
echo "Done, starting httpd..."
if [ "$1" == "syncroton" ]; then
./update-from-source.sh || :
roundcubemail/bin/initdb.sh --dir syncroton/docs/SQL/ || :
roundcubemail/bin/updatedb.sh --dir syncroton/docs/SQL/ --package syncroton
sed -i "s/?>/\$config['activesync_test_username'] = 'john@kolab.org';\n?>/" roundcubemail/config/config.inc.php
sed -i "s/?>/\$config['activesync_test_password'] = 'simple123';\n?>/" roundcubemail/config/config.inc.php
sed -i "s/?>/\$config['activesync_test_host'] = 'http:\/\/localhost:8001';\n?>/" roundcubemail/config/config.inc.php
sed -i -r -e "s/config\['activesync_init_subscriptions'\] =.*$/config['activesync_init_subscriptions'] = 0;/g" roundcubemail/config/kolab_syncroton.inc.php
sed -i -r -e "s/config\['activesync_multifolder_blacklist_event'\] =.*$/config['activesync_multifolder_blacklist_event'] = array('windowsoutlook');/g" roundcubemail/config/kolab_syncroton.inc.php
sed -i -r -e "s/config\['activesync_multifolder_blacklist_task'\] =.*$/config['activesync_multifolder_blacklist_task'] = array('windowsoutlook');/g" roundcubemail/config/kolab_syncroton.inc.php
sed -i -r -e "s/config\['activesync_multifolder_blacklist_contact'\] =.*$/config['activesync_multifolder_blacklist_contact'] = array('windowsoutlook');/g" roundcubemail/config/kolab_syncroton.inc.php
pushd syncroton
for user in $DEBUG_USERS; do
mkdir logs/$user
chmod 777 logs/$user
done
php -S localhost:8001 &
pushd tests
if [ "$2" == "testsuite" ]; then
php \
-dmemory_limit=-1 \
../vendor/bin/phpunit \
--verbose \
--testsuite Unit
php \
-dmemory_limit=-1 \
../vendor/bin/phpunit \
--verbose \
--testsuite Sync
elif [ "$2" == "quicktest" ]; then
php \
-dmemory_limit=-1 \
../vendor/bin/phpunit \
--verbose \
--testsuite Unit
elif [ "$2" == "lint" ]; then
popd
cp ../syncroton.phpstan.neon phpstan.neon
php -dmemory_limit=-1 vendor/bin/phpstan
elif [ "$2" == "shell" ]; then
exec /bin/bash
else
php \
-dmemory_limit=-1 \
../vendor/bin/phpunit \
--verbose \
--stop-on-defect \
--stop-on-error \
--stop-on-failure \
"$2"
fi
elif [ "$1" == "irony" ]; then
./update-from-source.sh || :
pushd iRony
pushd test
if [ "$2" == "testsuite" ]; then
php \
-dmemory_limit=-1 \
../vendor/bin/phpunit \
--verbose
elif [ "$2" == "shell" ]; then
exec /bin/bash
else
php \
-dmemory_limit=-1 \
../vendor/bin/phpunit \
--verbose \
--stop-on-defect \
--stop-on-error \
--stop-on-failure \
"$2"
fi
elif [ "$1" == "roundcubemail-plugins-kolab" ]; then
./update-from-source.sh || :
# We run the tests from the plugins directory, which we don't normally update
if [ -d /src.orig/roundcubemail-plugins-kolab ]; then
rsync -av \
--no-links \
--exclude=vendor \
--exclude=temp \
--exclude=config \
--exclude=logs \
--exclude=.git \
--exclude=config.inc.php \
--exclude=composer.json \
--exclude=composer.lock \
/src.orig/roundcubemail-plugins-kolab/ /opt/app-root/src/roundcubemail-plugins-kolab
fi
pushd roundcubemail-plugins-kolab
ln -s ../roundcubemail/tests tests
ln -s ../roundcubemail/program program
if [ "$2" == "testsuite" ]; then
#FIXME this doesn't currently work:
#* set logging to stdout
#* add test configuration
#* there's some error about serializing a libcalendaring object to a string?
php \
-dmemory_limit=-1 \
../roundcubemail/vendor/bin/phpunit \
--verbose
elif [ "$2" == "lint" ]; then
cp ../roundcubemail-plugins-kolab.phpstan.neon phpstan.neon
php -dmemory_limit=-1 ../roundcubemail/vendor/bin/phpstan
php ../roundcubemail/vendor/bin/php-cs-fixer fix --dry-run --using-cache=no --diff --verbose
elif [ "$2" == "shell" ]; then
exec /bin/bash
else
php \
-dmemory_limit=-1 \
../roundcubemail/vendor/bin/phpunit \
--verbose \
--stop-on-defect \
--stop-on-error \
--stop-on-failure \
"$2"
fi
elif [ "$1" == "phpstan" ]; then
./update-from-source.sh || :
pushd roundcubemail
cp /src.orig/roundcubemail-plugins-kolab/phpstan.neon .
cp /src.orig/roundcubemail-plugins-kolab/phpstan.bootstrap.php .
php -dmemory_limit=-1 vendor/bin/phpstan analyse
elif [ "$1" == "shell" ]; then
exec /bin/bash
else
+ sed -i \
+ -e "s|CALDAV_WELLKNOWN_REDIRECT_PATH|$CALDAV_WELLKNOWN_REDIRECT_PATH|" \
+ -e "s|CARDDAV_WELLKNOWN_REDIRECT_PATH|$CARDDAV_WELLKNOWN_REDIRECT_PATH|" \
+ /etc/httpd/conf.d/well-known.conf
/usr/sbin/php-fpm
exec httpd -DFOREGROUND
fi

File Metadata

Mime Type
text/x-diff
Expires
Sun, Apr 5, 9:19 PM (4 w, 1 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18768045
Default Alt Text
(12 KB)

Event Timeline