mirror of
https://github.com/luzifer-docker/gmail-roundcube.git
synced 2024-12-20 18:01:21 +00:00
Switch to own build from upstream roundcube
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c177022433
commit
c5d3eade69
5 changed files with 65 additions and 3 deletions
37
Dockerfile
37
Dockerfile
|
@ -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"]
|
||||||
|
|
8
rootfs/etc/cont-init.d/99-roundcube
Normal file
8
rootfs/etc/cont-init.d/99-roundcube
Normal 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
|
|
@ -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';
|
3
rootfs/var/www/plugins/password/config.inc.php
Normal file
3
rootfs/var/www/plugins/password/config.inc.php
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
<?php
|
||||||
|
$rcmail_config['password_driver'] = 'file';
|
||||||
|
$rcmail_config['password_confirm_current'] = true;
|
18
rootfs/var/www/plugins/password/drivers/file.php
Normal file
18
rootfs/var/www/plugins/password/drivers/file.php
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue