diff --git a/webmails/rainloop/Dockerfile b/webmails/rainloop/Dockerfile index 95cf9b4a..e6c3d63c 100644 --- a/webmails/rainloop/Dockerfile +++ b/webmails/rainloop/Dockerfile @@ -1,12 +1,14 @@ -ARG DISTRO=nginx:1.21-alpine -FROM $DISTRO +ARG ARCH="" + +# NOTE: only add file if building for arm +FROM ${ARCH}alpine:3.14 +ONBUILD COPY --from=balenalib/rpi-alpine:3.14 /usr/bin/qemu-arm-static /usr/bin/qemu-arm-static # Shared later between dovecot postfix nginx rspamd rainloop and roundloop RUN apk add --no-cache \ python3 py3-pip \ && pip3 install socrate==0.2.0 -# Shared layer between rainloop and roundcube # https://www.rainloop.net/docs/system-requirements/ # Rainloop: # cURL Builtin @@ -24,12 +26,15 @@ RUN apk add --no-cache \ # php7-pdo Accessing databases in PHP # php7-pdo_sqlite Access to SQLite 3 databases RUN apk add --no-cache \ - && apk add php7 php7-fpm php7-curl php7-iconv php7-json php7-xml php7-dom php7-openssl \ - && rm /etc/nginx/conf.d/default.conf \ - && rm /etc/php7/php-fpm.d/www.conf + nginx \ + php7 php7-fpm php7-curl php7-iconv php7-json php7-xml php7-dom php7-openssl \ + && rm /etc/nginx/http.d/default.conf \ + && rm /etc/php7/php-fpm.d/www.conf \ + && mkdir -p /run/nginx \ + && mkdir -p /var/www/rainloop # nginx / PHP config files -COPY config/nginx-rainloop.conf /etc/nginx/conf.d/rainloop.conf +COPY config/nginx-rainloop.conf /etc/nginx/http.d/rainloop.conf COPY config/php-rainloop.conf /etc/php7/php-fpm.d/rainloop.conf # Rainloop login @@ -45,8 +50,7 @@ COPY defaults/default.ini /defaults/default.ini ENV RAINLOOP_URL https://github.com/RainLoop/rainloop-webmail/releases/download/v1.16.0/rainloop-community-1.16.0.zip RUN apk add --no-cache \ - unzip py3-jinja2 \ - && mkdir -p /var/www/rainloop \ + curl unzip \ && cd /var/www/rainloop \ && curl -L -O ${RAINLOOP_URL} \ && unzip -q *.zip \ @@ -55,7 +59,7 @@ RUN apk add --no-cache \ && find . -type d -exec chmod 755 {} \; \ && find . -type f -exec chmod 644 {} \; \ && chown -R nginx:nginx /var/www/rainloop \ - && apk del unzip + && apk del curl unzip COPY start.py /start.py diff --git a/webmails/rainloop/config/nginx-rainloop.conf b/webmails/rainloop/config/nginx-rainloop.conf index 3a0ff7fd..0f9f3122 100644 --- a/webmails/rainloop/config/nginx-rainloop.conf +++ b/webmails/rainloop/config/nginx-rainloop.conf @@ -13,7 +13,7 @@ server { index index.php; location / { - try_files $uri $uri/ /index.php?$query_string; + try_files $uri /index.php?$query_string; } location ~ \.php$ { diff --git a/webmails/roundcube/config.inc.php b/webmails/roundcube/config.inc.php deleted file mode 100644 index 797f229c..00000000 --- a/webmails/roundcube/config.inc.php +++ /dev/null @@ -1,66 +0,0 @@ - array( - 'verify_peer' => false, - 'verify_peer_name' => false, - ), -); -$config['imap_conn_options'] = $ssl_no_check; -$config['smtp_conn_options'] = $ssl_no_check; -$config['managesieve_conn_options'] = $ssl_no_check; - -// skin name: folder from skins/ -$config['skin'] = 'elastic'; - -// Enigma gpg plugin -$config['enigma_pgp_homedir'] = '/data/gpg'; - -// Set From header for DKIM signed message delivery reports -$config['mdn_use_from'] = true; diff --git a/webmails/roundcube/mailu.php b/webmails/roundcube/mailu.php deleted file mode 100644 index bb4d65e9..00000000 --- a/webmails/roundcube/mailu.php +++ /dev/null @@ -1,59 +0,0 @@ -add_hook('startup', array($this, 'startup')); - $this->add_hook('authenticate', array($this, 'authenticate')); - $this->add_hook('login_after', array($this, 'login')); - $this->add_hook('login_failed', array($this, 'login_failed')); - $this->add_hook('logout_after', array($this, 'logout')); - } - - function startup($args) - { - if (empty($_SESSION['user_id'])) { - $args['action'] = 'login'; - } - - return $args; - } - - function authenticate($args) - { - if (!in_array('HTTP_X_REMOTE_USER', $_SERVER) || !in_array('HTTP_X_REMOTE_USER_TOKEN', $_SERVER)) { - header('HTTP/1.0 403 Forbidden'); - die(); - } - $args['user'] = $_SERVER['HTTP_X_REMOTE_USER']; - $args['pass'] = $_SERVER['HTTP_X_REMOTE_USER_TOKEN']; - - $args['cookiecheck'] = false; - $args['valid'] = true; - - return $args; - } - - function logout($args) { - // Redirect to global SSO logout path. - $this->load_config(); - - $sso_logout_url = rcmail::get_instance()->config->get('sso_logout_url'); - header("Location: " . $sso_logout_url, true); - exit; - } - - function login($args) - { - header('Location: index.php'); - exit(); - } - function login_failed($args) - { - header('Location: sso.php'); - exit(); - } - -}