diff --git a/CHANGELOG.md b/CHANGELOG.md index 80367b41..90a6660f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] - YYYY-MM-DD - Add `TZ` env var to change PHP `date.timezone` (#133) -- Update to PHP 8.2 +- Update to PHP 8.2 (#411) +- Add back a `/sessions` volume for sessions persistence (#399) ## [5.2.1] - 2023-02-08 diff --git a/Dockerfile-alpine.template b/Dockerfile-alpine.template index bd75c390..34e0fd7a 100644 --- a/Dockerfile-alpine.template +++ b/Dockerfile-alpine.template @@ -42,6 +42,7 @@ ENV MAX_EXECUTION_TIME 600 ENV MEMORY_LIMIT 512M ENV UPLOAD_LIMIT 2048K ENV TZ UTC +ENV SESSION_SAVE_PATH /sessions RUN set -ex; \ \ { \ @@ -65,6 +66,7 @@ RUN set -ex; \ echo 'post_max_size=${UPLOAD_LIMIT}'; \ echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \ echo 'date.timezone=${TZ}'; \ + echo 'session.save_path=${SESSION_SAVE_PATH}'; \ } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini # Calculate download URL @@ -87,6 +89,9 @@ RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ gnupg \ ; \ + mkdir $SESSION_SAVE_PATH; \ + chmod 1777 $SESSION_SAVE_PATH; \ + chown www-data:www-data $SESSION_SAVE_PATH; \ \ export GNUPGHOME="$(mktemp -d)"; \ export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \ diff --git a/Dockerfile-debian.template b/Dockerfile-debian.template index c09e81ad..bafda382 100644 --- a/Dockerfile-debian.template +++ b/Dockerfile-debian.template @@ -44,6 +44,7 @@ ENV MAX_EXECUTION_TIME 600 ENV MEMORY_LIMIT 512M ENV UPLOAD_LIMIT 2048K ENV TZ UTC +ENV SESSION_SAVE_PATH /sessions RUN set -ex; \ \ { \ @@ -67,6 +68,7 @@ RUN set -ex; \ echo 'post_max_size=${UPLOAD_LIMIT}'; \ echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \ echo 'date.timezone=${TZ}'; \ + echo 'session.save_path=${SESSION_SAVE_PATH}'; \ } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini # Calculate download URL @@ -94,6 +96,9 @@ RUN set -ex; \ gnupg \ dirmngr \ ; \ + mkdir $SESSION_SAVE_PATH; \ + chmod 1777 $SESSION_SAVE_PATH; \ + chown www-data:www-data $SESSION_SAVE_PATH; \ \ export GNUPGHOME="$(mktemp -d)"; \ export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \ diff --git a/README.md b/README.md index 0de3457d..9b1b8efd 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,14 @@ See the following links for config file information: Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma.example.net/``) where the reverse proxy makes phpMyAdmin available. +## Sessions persistence + +In order to keep your sessions active between container updates you will need to mount the `/sessions` folder. + +```sh +-v /some/local/directory/sessions:/sessions:rw +``` + ## Environment variables summary * ``PMA_ARBITRARY`` - when set to 1 connection to the arbitrary server will be allowed diff --git a/apache/Dockerfile b/apache/Dockerfile index 64f40715..f51e02a6 100644 --- a/apache/Dockerfile +++ b/apache/Dockerfile @@ -44,6 +44,7 @@ ENV MAX_EXECUTION_TIME 600 ENV MEMORY_LIMIT 512M ENV UPLOAD_LIMIT 2048K ENV TZ UTC +ENV SESSION_SAVE_PATH /sessions RUN set -ex; \ \ { \ @@ -67,6 +68,7 @@ RUN set -ex; \ echo 'post_max_size=${UPLOAD_LIMIT}'; \ echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \ echo 'date.timezone=${TZ}'; \ + echo 'session.save_path=${SESSION_SAVE_PATH}'; \ } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini # Calculate download URL @@ -94,6 +96,9 @@ RUN set -ex; \ gnupg \ dirmngr \ ; \ + mkdir $SESSION_SAVE_PATH; \ + chmod 1777 $SESSION_SAVE_PATH; \ + chown www-data:www-data $SESSION_SAVE_PATH; \ \ export GNUPGHOME="$(mktemp -d)"; \ export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \ diff --git a/fpm-alpine/Dockerfile b/fpm-alpine/Dockerfile index 1a5ec1e5..1e1c2a87 100644 --- a/fpm-alpine/Dockerfile +++ b/fpm-alpine/Dockerfile @@ -42,6 +42,7 @@ ENV MAX_EXECUTION_TIME 600 ENV MEMORY_LIMIT 512M ENV UPLOAD_LIMIT 2048K ENV TZ UTC +ENV SESSION_SAVE_PATH /sessions RUN set -ex; \ \ { \ @@ -65,6 +66,7 @@ RUN set -ex; \ echo 'post_max_size=${UPLOAD_LIMIT}'; \ echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \ echo 'date.timezone=${TZ}'; \ + echo 'session.save_path=${SESSION_SAVE_PATH}'; \ } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini # Calculate download URL @@ -87,6 +89,9 @@ RUN set -ex; \ apk add --no-cache --virtual .fetch-deps \ gnupg \ ; \ + mkdir $SESSION_SAVE_PATH; \ + chmod 1777 $SESSION_SAVE_PATH; \ + chown www-data:www-data $SESSION_SAVE_PATH; \ \ export GNUPGHOME="$(mktemp -d)"; \ export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \ diff --git a/fpm/Dockerfile b/fpm/Dockerfile index d66c0354..9047cd7c 100644 --- a/fpm/Dockerfile +++ b/fpm/Dockerfile @@ -44,6 +44,7 @@ ENV MAX_EXECUTION_TIME 600 ENV MEMORY_LIMIT 512M ENV UPLOAD_LIMIT 2048K ENV TZ UTC +ENV SESSION_SAVE_PATH /sessions RUN set -ex; \ \ { \ @@ -67,6 +68,7 @@ RUN set -ex; \ echo 'post_max_size=${UPLOAD_LIMIT}'; \ echo 'upload_max_filesize=${UPLOAD_LIMIT}'; \ echo 'date.timezone=${TZ}'; \ + echo 'session.save_path=${SESSION_SAVE_PATH}'; \ } > $PHP_INI_DIR/conf.d/phpmyadmin-misc.ini # Calculate download URL @@ -94,6 +96,9 @@ RUN set -ex; \ gnupg \ dirmngr \ ; \ + mkdir $SESSION_SAVE_PATH; \ + chmod 1777 $SESSION_SAVE_PATH; \ + chown www-data:www-data $SESSION_SAVE_PATH; \ \ export GNUPGHOME="$(mktemp -d)"; \ export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \ diff --git a/testing/phpmyadmin_test.py b/testing/phpmyadmin_test.py index 26436ed4..5b78136e 100755 --- a/testing/phpmyadmin_test.py +++ b/testing/phpmyadmin_test.py @@ -104,6 +104,7 @@ def test_php_ini(url, username, password, server): assert(b'upload_max_filesize' in response) assert(b'post_max_size' in response) assert(b'expose_php' in response) + assert(b'session.save_path' in response) assert(b'