Roundcube 1.5.2 Complete - Sindominio

master
siroco 7 months ago
commit 8cee98b4ff
Signed by: siroco
GPG Key ID: 1324098302A514B0
  1. 43
      Dockerfile
  2. 39
      README.md
  3. 33
      conf/composer.json
  4. 78
      conf/config.php.inc.sample
  5. 160
      conf/config.php.inc.sample.orig
  6. 58
      conf/nginx.conf.sample
  7. 38
      conf/roundcube.nginx.conf
  8. 138
      conf/roundcube.php.ini
  9. 59
      docker-compose.yml
  10. 30
      entrypoint.sh
  11. 10
      init-database.sh

@ -0,0 +1,43 @@
FROM registry.sindominio.net/php-fpm
ENV SHA256 "f03968381156fe790d858af7e069c5550a8577fb964f96624434895272053838"
ENV ROUNDCUBEMAIL_VERSION 1.5.2
RUN dpkg -s php-fpm | grep Version | cut -f2 -d" " | cut -d":" -f2 | cut -d"+" -f1 > /tmp/php-fpm.version
COPY conf/roundcube.php.ini /tmp/php.ini
RUN PHP_VERSION=$(cat /tmp/php-fpm.version) && \
cp /tmp/php.ini /etc/php/$PHP_VERSION/fpm/php.ini
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl ca-certificates
RUN curl -o roundcubemail.tar.gz -fSL https://github.com/roundcube/roundcubemail/releases/download/${ROUNDCUBEMAIL_VERSION}/roundcubemail-${ROUNDCUBEMAIL_VERSION}-complete.tar.gz; \
echo "${SHA256} roundcubemail.tar.gz" > roundcubemail.tar.gz.asc && \
sha256sum -c roundcubemail.tar.gz.asc && \
mkdir /roundcubemail && \
tar xf roundcubemail.tar.gz -C /roundcubemail --strip-components=1 --no-same-owner && \
rm -rf *.tar.gz *.asc;
RUN apt-get install -y --no-install-recommends \
php-exif php-gd php-intl php-ldap php-mysql php-zip php-pspell php-mbstring php-xml php-curl php-imagick php-sqlite3 \
git mariadb-client
WORKDIR /roundcubemail
RUN curl -s https://getcomposer.org/installer | php
COPY conf/composer.json composer.json
RUN php composer.phar install
# Plugins
RUN git clone https://github.com/johndoh/roundcube-contextmenu.git plugins/contextmenu
COPY entrypoint.sh /entrypoint.sh
COPY init-database.sh /init-database.sh
ENTRYPOINT ["/bin/sh","/entrypoint.sh"]
CMD ["/usr/sbin/php-fpm","--nodaemonize"]
# expose these volumes
VOLUME /roundcubemail

@ -0,0 +1,39 @@
# Roundcube
Roundcube Complete Version
Current: 1.5.2 stable
Sindominio
## Configure
Copy .env.sample to .env
cp .env.sample .env
Edit variables
vim .env
Create volume directory
mkdir data
## Build
Build a local image
docker-compose build
## Run
docker-compose up -d
If first time, you need to initialize MySQL database
docker-compose exec roundcubephp /bin/sh /init-database.sh
## Read PHP Logs
docker-compose exec roundcubephp /bin/sh tail -f /tmp/php-fpm.log

@ -0,0 +1,33 @@
{
"name": "roundcube/roundcubemail",
"description": "The Roundcube Webmail suite",
"license": "GPL-3.0-or-later",
"repositories": [
{
"type": "composer",
"url": "https://plugins.roundcube.net"
}
],
"require": {
"php": ">=5.5.0",
"pear/pear-core-minimal": "~1.10.1",
"pear/auth_sasl": "~1.1.0",
"pear/mail_mime": "~1.10.0",
"pear/net_smtp": "~1.10.0",
"pear/crypt_gpg": "~1.6.3",
"pear/net_sieve": "~1.4.5",
"roundcube/plugin-installer": "~0.3.0",
"roundcube/rtf-html-php": "~2.1",
"masterminds/html5": "~2.7.0",
"endroid/qr-code": "~1.6.5",
"guzzlehttp/guzzle": "^6.5.5",
"kolab/net_ldap3": "~1.1.1",
"johndoh/contextmenu": ">=3.0.0"
},
"require-dev": {
"phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6 || ^7"
},
"suggest": {
"bjeavons/zxcvbn-php": "^1.0 required for Zxcvbn password strength driver"
}
}

@ -0,0 +1,78 @@
<?php
/** DATABASE **/
$dbuser='roundcube';
$dbpass='secret';
$basepath='';
$dbname='roundcube';
$dbserver='db';
$dbport='3306';
$dbtype='mysql';
switch ($dbtype) {
case "sqlite":
case "sqlite3":
$config['db_dsnw'] = 'sqlite:////roundcubemail/db/roundcube.sqlite?mode=0777';
break;
default:
if ($dbport != '') $dbport=":$dbport";
if ($dbserver == '') $dbserver='db';
$config['db_dsnw'] = "$dbtype://$dbuser:$dbpass@$dbserver$dbport/$dbname?verify_server_cert=false";
break;
}
/** IMAP **/
$imaphost='ssl://lesnaus.sindominio.net';
$imapport='993';
$config['default_host'] = "$imaphost";
$config['imap_conn_options'] = array(
'ssl' => array(
'verify_peer' => false,
'allow_self_signed' => true,
),
);
/** SMTP **/
$smtphost='tls://lesnaus.sindominio.net';
$smtpport='587';
$config['smtp_server'] = "$smtphost";
$config['smtp_port'] = $smtpport;
$config['smtp_user'] = '%u';
$config['smtp_pass'] = '%p';
$config['smtp_conn_options'] = array(
'ssl' => array(
'verify_peer' => false,
'allow_self_signed' => true,
),
);
/** OPTIONS **/
$rcsupporturl='https://sindominio.net/portada/ayuda';
$rcproductname='';
$rcmaildomain='sindominio.net';
$rcskin='elastic';
$config['support_url'] = "$rcsupporturl";
$config['ip_check'] = true;
$config['des_key'] = '$24Za_?A3JTvjGF+poiTDu3j';
$config['product_name'] = "$rcproductname";
$config['logout_redirect_url'] = 'http://%d/';
$config['language'] = 'es_ES';
$config['force_https'] = false;
$config['mail_domain'] = "$rcmaildomain";
$config['debug_level'] = 5;
$config['spellcheck_engine'] = 'pspell';
$config['skin'] = "$rcskin";
$config['plugins'] = array(
'managesieve',
'contextmenu',
'newmail_notifier',
'mobile',
);

@ -0,0 +1,160 @@
<?php
/* Local configuration for Roundcube Webmail */
// ----------------------------------
// SQL DATABASE
// ----------------------------------
// Database connection string (DSN) for read+write operations
// Format (compatible with PEAR MDB2): db_provider://user:password@host/database
// Currently supported db_providers: mysql, pgsql, sqlite, mssql, sqlsrv, oracle
// For examples see http://pear.php.net/manual/en/package.database.mdb2.intro-dsn.php
// Note: for SQLite use absolute path (Linux): 'sqlite:////full/path/to/sqlite.db?mode=0646'
// or (Windows): 'sqlite:///C:/full/path/to/sqlite.db'
// Note: Various drivers support various additional arguments for connection,
// for Mysql: key, cipher, cert, capath, ca, verify_server_cert,
// for Postgres: application_name, sslmode, sslcert, sslkey, sslrootcert, sslcrl, sslcompression, service.
// e.g. 'mysql://roundcube:@localhost/roundcubemail?verify_server_cert=false'
// $config['db_dsnw'] = 'sqlite:////roundcubemail/db/roundcube.sqlite?mode=0777';
$dbuser='roundcube';
$dbpass='F7jVGKARoAsigGkRjB805Gpi8pv5';
$basepath='';
$dbname='roundcube';
$dbserver='euskaljai.sindominio.net';
$dbport='3306';
$dbtype='mysql';
switch ($dbtype) {
case "sqlite":
case "sqlite3":
$config['db_dsnw'] = 'sqlite:////roundcubemail/db/roundcube.sqlite?mode=0777';
break;
default:
if ($dbport != '') $dbport=":$dbport";
if ($dbserver == '') $dbserver="localhost";
$config['db_dsnw'] = "$dbtype://$dbuser:$dbpass@$dbserver$dbport/$dbname?verify_server_cert=false";
break;
}
// ----------------------------------
// IMAP
// ----------------------------------
// The IMAP host chosen to perform the log-in.
// Leave blank to show a textbox at login, give a list of hosts
// to display a pulldown menu or set one host as string.
// Enter hostname with prefix ssl:// to use Implicit TLS, or use
// prefix tls:// to use STARTTLS.
// Supported replacement variables:
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %s - domain name after the '@' from e-mail address provided at login screen
// For example %n = mail.domain.tld, %t = domain.tld
// WARNING: After hostname change update of mail_host column in users table is
// required to match old user data records with the new host.
$config['default_host'] = 'localhost';
// provide an URL where a user can get support for this Roundcube installation
// PLEASE DO NOT LINK TO THE ROUNDCUBE.NET WEBSITE HERE!
$config['support_url'] = '';
// This key is used for encrypting purposes, like storing of imap password
// in the session. For historical reasons it's called DES_key, but it's used
// with any configured cipher_method (see below).
// For the default cipher_method a required key length is 24 characters.
$config['des_key'] = 'Bb8MpAW1rUSDfJtE8JZOKCPd';
// Automatically add this domain to user names for login
// Only for IMAP servers that require full e-mail addresses for login
// Specify an array with 'host' => 'domain' values to support multiple hosts
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - hostname ($_SERVER['SERVER_NAME'])
// %t - hostname without the first part
// %d - domain (http hostname $_SERVER['HTTP_HOST'] without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['username_domain'] = 'sindominio.net';
// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
// $config['plugins'] = ['password'];
$config['plugins'] = array(
'managesieve',
'contextmenu',
'newmail_notifier',
'mobile',
);
// Set the spell checking engine. Possible values:
// - 'googie' - the default (also used for connecting to Nox Spell Server, see 'spellcheck_uri' setting)
// - 'pspell' - requires the PHP Pspell module and aspell installed
// - 'enchant' - requires the PHP Enchant module
// - 'atd' - install your own After the Deadline server or check with the people at http://www.afterthedeadline.com before using their API
// Since Google shut down their public spell checking service, the default settings
// connect to http://spell.roundcube.net which is a hosted service provided by Roundcube.
// You can connect to any other googie-compliant service by setting 'spellcheck_uri' accordingly.
$config['spellcheck_engine'] = 'pspell';

@ -0,0 +1,58 @@
worker_processes auto;
pid /run/nginx/nginx.pid;
error_log stderr info;
daemon off;
master_process off;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
server_names_hash_bucket_size 128;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /dev/stdout;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}

@ -0,0 +1,38 @@
upstream roundcube {
server roundcubephp:9000;
}
server {
listen 8080;
server_name _;
root /roundcubemail;
index index.php index.html index.htm;
client_max_body_size 50M;
location / {
try_files $uri $uri/ =404;
}
location ~ ^/(README|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ {
deny all;
}
location ~ ^/(bin|SQL|config|temp|logs)/ {
deny all;
}
location ~* \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_pass roundcube;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
}
access_log /tmp/roundcube.access.log;
error_log /tmp/roundcube.error.log;
}

@ -0,0 +1,138 @@
[PHP]
engine = On
short_open_tag = Off
precision = 14
output_buffering = 4096
zlib.output_compression = Off
implicit_flush = Off
unserialize_callback_func =
serialize_precision = -1
disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
disable_classes =
zend.enable_gc = On
zend.exception_ignore_args = On
expose_php = Off
max_execution_time = 30
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
display_errors = Off
display_startup_errors = Off
log_errors = On
log_errors_max_len = 1024
ignore_repeated_errors = Off
ignore_repeated_source = Off
report_memleaks = On
error_log = syslog
cgi.fix_pathinfo=0
variables_order = "GPCS"
request_order = "GP"
register_argc_argv = Off
auto_globals_jit = On
post_max_size = 50M
auto_prepend_file =
auto_append_file =
default_mimetype = "text/html"
default_charset = "UTF-8"
doc_root =
user_dir =
enable_dl = Off
file_uploads = On
upload_max_filesize = 50M
max_file_uploads = 20
allow_url_fopen = On
allow_url_include = Off
default_socket_timeout = 60
[CLI Server]
cli_server.color = On
[Date]
date.timezone = Europe/Paris
[filter]
[iconv]
[imap]
[intl]
[sqlite3]
[Pcre]
[Pdo]
[Pdo_mysql]
pdo_mysql.default_socket=
[Phar]
[mail function]
SMTP = localhost
smtp_port = 25
mail.add_x_header = Off
[ODBC]
odbc.allow_persistent = On
odbc.check_persistent = On
odbc.max_persistent = -1
odbc.max_links = -1
odbc.defaultlrl = 4096
odbc.defaultbinmode = 1
[MySQLi]
mysqli.max_persistent = -1
mysqli.allow_persistent = On
mysqli.max_links = -1
mysqli.default_port = 3306
mysqli.default_socket =
mysqli.default_host =
mysqli.default_user =
mysqli.default_pw =
mysqli.reconnect = Off
[mysqlnd]
mysqlnd.collect_statistics = On
mysqlnd.collect_memory_statistics = Off
[OCI8]
[PostgreSQL]
pgsql.allow_persistent = On
pgsql.auto_reset_persistent = Off
pgsql.max_persistent = -1
pgsql.max_links = -1
pgsql.ignore_notice = 0
pgsql.log_notice = 0
[bcmath]
bcmath.scale = 0
[browscap]
[Session]
session.save_handler = files
session.use_strict_mode = 0
session.use_cookies = 1
session.use_only_cookies = 1
session.name = PHPSESSID
session.auto_start = 0
session.cookie_lifetime = 0
session.cookie_path = /
session.cookie_domain =
session.cookie_httponly =
session.cookie_samesite =
session.serialize_handler = php
session.gc_probability = 0
session.gc_divisor = 1000
session.gc_maxlifetime = 1440
session.referer_check =
session.cache_limiter = nocache
session.cache_expire = 180
session.use_trans_sid = 0
session.sid_length = 26
session.trans_sid_tags = "a=href,area=href,frame=src,form="
session.sid_bits_per_character = 5
[Assertion]
zend.assertions = -1
[COM]
[mbstring]
[gd]
[exif]
[Tidy]
tidy.clean_output = Off
[soap]
soap.wsdl_cache_enabled=1
soap.wsdl_cache_dir="/tmp"
soap.wsdl_cache_ttl=86400
soap.wsdl_cache_limit = 5
[sysvshm]
[ldap]
ldap.max_links = -1
[dba]
[opcache]
[curl]
[openssl]
[ffi]

@ -0,0 +1,59 @@
version: '3'
volumes:
roundcubemail:
services:
roundcubephp:
user: ${USER_GROUP}
image: roundcube
build: .
restart: always
volumes:
- roundcubemail:/roundcubemail
- ./conf/config.php.inc.sample:/roundcubemail/config/config.inc.php
#- ./data/logs:/roundcubemail/logs
#- ./data/temp:/roundcubemail/temp
#- ./data/db:/roundcubemail/db
environment:
- RC_DB_TYPE
- RC_DB_HOST
- RC_DB_NAME
- RC_DB_USER
- RC_DB_PASSWORD
# IMAP
- RC_DEFAULT_HOST
- RC_DEFAULT_PORT
# SMTP
- RC_SMTP_SERVER
- RC_SMTP_PORT
- RC_SMTP_USER
- RC_SMTP_PASS
# OPTIONS
- RC_SUPPORT_URL
- RC_PRODUCT_NAME
- RC_MAIL_DOMAIN
- RC_SKIN
nginx:
user: ${USER_GROUP}
image: registry.sindominio.net/nginx
restart: always
links:
- roundcubephp
ports:
- "0.0.0.0:${WWW_PORT}:8080"
volumes:
- ./conf/roundcube.nginx.conf:/etc/nginx/sites-enabled/default:ro
- ./conf/nginx.conf.sample:/etc/nginx/nginx.conf:ro
- roundcubemail:/roundcubemail
db:
image: mariadb
user: ${USER_GROUP}
restart: always
volumes:
- ./data/db:/var/lib/mysql
environment:
MYSQL_DATABASE: ${RC_DB_NAME}
MYSQL_USER: ${RC_DB_USER}
MYSQL_PASSWORD: ${RC_DB_PASSWORD}
MYSQL_RANDOM_ROOT_PASSWORD: '1'

@ -0,0 +1,30 @@
set -e;
cp config/config.inc.php /tmp/config.inc.php
## Configure
## DATABASE
[ -n $RC_DB_TYPE ] && sed -i "s:dbtype=.*:dbtype='$RC_DB_TYPE';:" /tmp/config.inc.php
[ -n $RC_DB_HOST ] && sed -i "s:dbserver=.*:dbserver='$RC_DB_HOST';:" /tmp/config.inc.php
[ -n $RC_DB_USER ] && sed -i "s:dbuser=.*:dbuser='$RC_DB_USER';:" /tmp/config.inc.php
[ -n $RC_DB_NAME ] && sed -i "s:dbname=.*:dbname='$RC_DB_NAME';:" /tmp/config.inc.php
[ -n $RC_DB_PASSWORD ] && sed -i "s:dbpass=.*:dbpass='$RC_DB_PASSWORD';:" /tmp/config.inc.php
## IMAP
[ -n $RC_DEFAULT_HOST ] && sed -i "s#imaphost=.*#imaphost='$RC_DEFAULT_HOST';#" /tmp/config.inc.php
[ -n $RC_DEFAULT_PORT ] && sed -i "s:imapport=.*:imapport='$RC_DEFAULT_PORT';:" /tmp/config.inc.php
## SMTP
[ -n $RC_SMTP_SERVER ] && sed -i "s#smtphost=.*#smtphost='$RC_SMTP_SERVER';#" /tmp/config.inc.php
[ -n $RC_SMTP_PORT ] && sed -i "s:smtpport=.*:smtpport='$RC_SMTP_PORT';:" /tmp/config.inc.php
## OPTIONS
[ -n $RC_SUPPORT_URL ] && sed -i "s#rcsupporturl=.*#rcsupporturl='$RC_SUPPORT_URL';#" /tmp/config.inc.php
[ -n $RC_PRODUCT_NAME ] && sed -i "s#rcproductname=.*#rcproductname='$RC_PRODUCT_NAME';#" /tmp/config.inc.php
[ -n $RC_MAIL_DOMAIN ] && sed -i "s#rcmaildomain=.*#rcmaildomain='$RC_MAIL_DOMAIN';#" /tmp/config.inc.php
[ -n $RC_SKIN ] && sed -i "s:rcskin=.*:rcskin='$RC_SKIN';:" /tmp/config.inc.php
cp /tmp/config.inc.php config/config.inc.php
## INSTALL INITAL TABLES
#mysql -h $RC_DB_HOST -u $RC_DB_USER -p$RC_DB_PASSWORD $RC_DB_NAME < SQL/mysql.initial.sql; exit
exec $@

@ -0,0 +1,10 @@
set -e
echo "Init Mysql Database"
cd /roundcubemail
mysql -h $RC_DB_HOST -u $RC_DB_USER -p$RC_DB_PASSWORD $RC_DB_NAME < SQL/mysql.initial.sql
exit 0
Loading…
Cancel
Save