Merge #399 - Add back a /sessions volume for sessions persistence

This commit is contained in:
William Desportes
2023-06-29 13:11:48 +02:00
8 changed files with 37 additions and 2 deletions
+2 -1
View File
@@ -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
+5
View File
@@ -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"; \
+5
View File
@@ -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"; \
+8
View File
@@ -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
+5
View File
@@ -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"; \
+5
View File
@@ -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"; \
+5
View File
@@ -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"; \
+2 -1
View File
@@ -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'<tr><td class="e">max_execution_time</td><td class="v">125</td><td class="v">125</td></tr>' in response)
@@ -111,7 +112,7 @@ def test_php_ini(url, username, password, server):
assert(b'<tr><td class="e">post_max_size</td><td class="v">123M</td><td class="v">123M</td></tr>' in response)
assert(b'<tr><td class="e">expose_php</td><td class="v">Off</td><td class="v">Off</td></tr>' in response)
assert(b'<tr><td class="e">session.save_path</td><td class="v">/sessions</td><td class="v">/sessions</td></tr>' in response)
def test_import_from_folder(url, username, password, server, sqlfile):
upload_dir = os.environ.get('PMA_UPLOADDIR');