Switch to own build from upstream roundcube

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-09-11 15:04:12 +02:00
parent c177022433
commit c5d3eade69
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E
5 changed files with 65 additions and 3 deletions

View File

@ -1,3 +1,36 @@
FROM robbertkl/roundcube FROM luzifer/alpine-nginx-php
COPY config.inc.php config/ ENV ROUNDCUBE_VERSION=1.3.7 \
RCMCARDDAV_VERSION=3.0.2
RUN set -ex \
&& apk --no-cache add \
gnupg \
php7-curl \
php7-dom \
php7-exif \
php7-fileinfo \
php7-iconv \
php7-imagick \
php7-intl \
php7-json \
php7-ldap \
php7-mbstring \
php7-mysqli \
php7-openssl \
php7-pdo \
php7-pdo_mysql \
php7-pdo_sqlite \
php7-session \
php7-sockets \
php7-sqlite3 \
php7-zip \
&& curl -sSfL "https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBE_VERSION}/roundcubemail-${ROUNDCUBE_VERSION}-complete.tar.gz" | \
tar -xz --strip-components=1 -C /var/www \
&& curl -sSfL "https://github.com/blind-coder/rcmcarddav/releases/download/v${RCMCARDDAV_VERSION}/carddav-${RCMCARDDAV_VERSION}.tar.bz2" | \
tar -xj -C /var/www/plugins \
&& cp /var/www/plugins/carddav/config.inc.php.dist /var/www/plugins/carddav/config.inc.php
COPY rootfs /
VOLUME ["/var/www/db"]

View File

@ -0,0 +1,8 @@
#!/bin/bash
cd /var/www
for subdir in db db/enigma logs temp; do
mkdir -p "${subdir}"
chown nobody: "${subdir}"
done

View File

@ -24,5 +24,5 @@ $config['smtp_pass'] = '%p';
$config['enigma_pgp_homedir'] = '/var/www/db/enigma'; $config['enigma_pgp_homedir'] = '/var/www/db/enigma';
$config['plugins'] = array('enigma'); $config['plugins'] = array('carddav', 'enigma');
if(getenv('ROUNDCUBE_USER_FILE')) $config['plugins'][] = 'password'; if(getenv('ROUNDCUBE_USER_FILE')) $config['plugins'][] = 'password';

View File

@ -0,0 +1,3 @@
<?php
$rcmail_config['password_driver'] = 'file';
$rcmail_config['password_confirm_current'] = true;

View File

@ -0,0 +1,18 @@
<?php
class rcube_file_password
{
function save($curpass, $passwd)
{
$userfile = getenv('ROUNDCUBE_USER_FILE');
$user = $_SESSION['username'];
$salt = sha1(rand());
$salt = substr($salt, 0, 4);
$hash = '{SSHA}' . base64_encode(sha1($passwd . $salt, true) . $salt);
$content = file_get_contents($userfile);
$content = preg_replace('/^' . preg_quote($user, '/') . ':.*$/m', "{$user}:{$hash}", $content, 1, $count);
if($count != 1)
return PASSWORD_ERROR;
$result = file_put_contents($userfile, $content);
return $result === false ? PASSWORD_ERROR : PASSWORD_SUCCESS;
}
}