Merge branch 'master' of github.com:roundcube/roundcubemail

pull/6085/head
Aleksander Machniak 7 years ago
commit 608e23c9c0

@ -28,14 +28,15 @@ this option should not be used for production environments.
The recommended way to run Roundcube is connected to a MySQL database. Specify the following env variables to do so:
`MYSQL_ENV_MYSQL_HOST` - Host (or Docker instance) name of the MySQL service; defaults to `mysql`
`ROUNDCUBEMAIL_DB_TYPE` - Database provider; currently supported: `mysql`, `pgsql`, `sqlite`
`MYSQL_ENV_MYSQL_USER` - The database username for Roundcube; defaults to `root`
`ROUNDCUBEMAIL_DB_HOST` - Host (or Docker instance) name of the database service; defaults to `mysql` or `postgres` depending on linked containers.
`MYSQL_ENV_MYSQL_PASSWORD` - The password for the database connection or
`MYSQL_ENV_MYSQL_ROOT_PASSWORD` - if the database username is `root`
`ROUNDCUBEMAIL_DB_USER` - The database username for Roundcube; defaults to `root` on `mysql`
`MYSQL_ENV_MYSQL_DATABASE` - The database name for Roundcube to use; defaults to `roundcubemail`
`ROUNDCUBEMAIL_DB_PASSWORD` - The password for the database connection
`ROUNDCUBEMAIL_DB_NAME` - The database name for Roundcube to use; defaults to `roundcubemail`
Before starting the container, please make sure that the supplied database exists and the given database user
has privileges to create tables.
@ -43,7 +44,7 @@ has privileges to create tables.
Run it with a link to the MySQL host and the username/password variables:
```
docker run -e MYSQL_ENV_MYSQL_ROOT_PASSWORD=my-secret-password --link=mysql:mysql -d roundcube/roundcubemail
docker run --link=mysql:mysql -d roundcube/roundcubemail
```
## Building a Docker image

@ -15,9 +15,16 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
echo >&2 "Complete! ROUNDCUBEMAIL has been successfully copied to $PWD"
fi
if [ ! -z "${!MYSQL_ENV_MYSQL_*}" ]; then
if [ ! -z "${!POSTGRES_ENV_POSTGRES_*}" ]; then
: "${ROUNDCUBEMAIL_DB_TYPE:=pgsql}"
: "${ROUNDCUBEMAIL_DB_HOST:=postgres}"
: "${ROUNDCUBEMAIL_DB_USER:=${POSTGRES_ENV_POSTGRES_USER}}"
: "${ROUNDCUBEMAIL_DB_PASSWORD:=${POSTGRES_ENV_POSTGRES_PASSWORD}}"
: "${ROUNDCUBEMAIL_DB_NAME:=${POSTGRES_ENV_POSTGRES_DB:-roundcubemail}}"
: "${ROUNDCUBEMAIL_DSNW:=${ROUNDCUBEMAIL_DB_TYPE}://${ROUNDCUBEMAIL_DB_USER}:${ROUNDCUBEMAIL_DB_PASSWORD}@${ROUNDCUBEMAIL_DB_HOST}/${ROUNDCUBEMAIL_DB_NAME}}"
elif [ ! -z "${!MYSQL_ENV_MYSQL_*}" ]; then
: "${ROUNDCUBEMAIL_DB_TYPE:=mysql}"
: "${ROUNDCUBEMAIL_DB_HOST:=${MYSQL_ENV_MYSQL_HOST:-mysql}}"
: "${ROUNDCUBEMAIL_DB_HOST:=mysql}"
: "${ROUNDCUBEMAIL_DB_USER:=${MYSQL_ENV_MYSQL_USER:-root}}"
if [ "$ROUNDCUBEMAIL_DB_USER" = 'root' ]; then
: "${ROUNDCUBEMAIL_DB_PASSWORD:=${MYSQL_ENV_MYSQL_ROOT_PASSWORD}}"
@ -28,8 +35,10 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
: "${ROUNDCUBEMAIL_DSNW:=${ROUNDCUBEMAIL_DB_TYPE}://${ROUNDCUBEMAIL_DB_USER}:${ROUNDCUBEMAIL_DB_PASSWORD}@${ROUNDCUBEMAIL_DB_HOST}/${ROUNDCUBEMAIL_DB_NAME}}"
else
# use local SQLite DB in /var/www/html/db
: "${ROUNDCUBEMAIL_DB_TYPE:=sqlite}"
: "${ROUNDCUBEMAIL_DB_DIR:=$PWD/db}"
: "${ROUNDCUBEMAIL_DSNW:=sqlite:///$ROUNDCUBEMAIL_DB_DIR/sqlite.db?mode=0646}"
: "${ROUNDCUBEMAIL_DB_NAME:=sqlite}"
: "${ROUNDCUBEMAIL_DSNW:=${ROUNDCUBEMAIL_DB_TYPE}:///$ROUNDCUBEMAIL_DB_DIR/${ROUNDCUBEMAIL_DB_NAME}.db?mode=0646}"
mkdir -p $ROUNDCUBEMAIL_DB_DIR
chown www-data:www-data $ROUNDCUBEMAIL_DB_DIR
@ -70,4 +79,4 @@ if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
fi
fi
exec "$@"
exec "$@"

@ -7868,8 +7868,8 @@ function rcube_webmail()
width = popup.width(),
height = options.height || (popup[0].scrollHeight + 20),
dialog = popup.parent(),
titlebar_height = $('.ui-dialog-titlebar', dialog).outerHeight(),
buttonpane_height = $('.ui-dialog-buttonpane', dialog).outerHeight(),
titlebar_height = $('.ui-dialog-titlebar', dialog).outerHeight() || 0,
buttonpane_height = $('.ui-dialog-buttonpane', dialog).outerHeight() || 0,
padding = (parseInt(dialog.css('padding-top')) + parseInt(popup.css('padding-top'))) * 2;
popup.dialog('option', {

@ -547,7 +547,7 @@ class rcube
/**
* Garbage collector function for temp files.
* Remove temp files older than two days
* Removes temporary files older than temp_dir_ttl.
*/
public function gc_temp()
{
@ -556,8 +556,9 @@ class rcube
// expire in 48 hours by default
$temp_dir_ttl = $this->config->get('temp_dir_ttl', '48h');
$temp_dir_ttl = get_offset_sec($temp_dir_ttl);
if ($temp_dir_ttl < 6*3600)
if ($temp_dir_ttl < 6*3600) {
$temp_dir_ttl = 6*3600; // 6 hours sensible lower bound.
}
$expire = time() - $temp_dir_ttl;
@ -567,8 +568,8 @@ class rcube
continue;
}
if (@filemtime($tmp.'/'.$fname) < $expire) {
@unlink($tmp.'/'.$fname);
if (@filemtime("$tmp/$fname") < $expire) {
@unlink("$tmp/$fname");
}
}

Loading…
Cancel
Save