Skip to content

Commit 71d54ac

Browse files
committed
Merge #384 - Add ENV PMA_UPLOADDIR and PMA_SAVEDIR ENVs
Pull-request: #384
2 parents c3e03b7 + 7e5dd3b commit 71d54ac

File tree

5 files changed

+38
-8
lines changed

5 files changed

+38
-8
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma
165165
* ``UPLOAD_LIMIT`` - if set, this option will override the default value for apache and php-fpm (format as `[0-9+](K,M,G)` default value is 2048K, this will change ``upload_max_filesize`` and ``post_max_size`` values)
166166
* ``HIDE_PHP_VERSION`` - if defined, this option will hide the PHP version (`expose_php = Off`). Set to any value (such as `HIDE_PHP_VERSION=true`).
167167
* ``APACHE_PORT`` - if defined, this option will change the default Apache port from `80` in case you want it to run on a different port like an unprivileged port. Set to any port value (such as `APACHE_PORT=8090`)
168+
* ``PMA_UPLOADDIR`` - if defined, this option will set the path where imported files can be saved to be available to import ([$cfg['UploadDir']](https://docs.phpmyadmin.net/en/latest/config.html#cfg_UploadDir))
169+
* ``PMA_SAVEDIR`` - if defined, this option will set the path where exported files will be saved ([$cfg['SaveDir']](https://docs.phpmyadmin.net/en/latest/config.html#cfg_SaveDir))
168170

169171
For usage with Docker secrets, appending ``_FILE`` to the ``PMA_PASSWORD`` environment variable is allowed (it overrides ``PMA_PASSWORD`` if it is set):
170172

apache/config.inc.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
'PMA_QUERYHISTORYMAX',
2626
'MAX_EXECUTION_TIME',
2727
'MEMORY_LIMIT',
28+
'PMA_UPLOADDIR',
29+
'PMA_SAVEDIR',
2830
];
2931

3032
foreach ($vars as $var) {
@@ -137,8 +139,13 @@
137139
$i--;
138140

139141
/* Uploads setup */
140-
$cfg['UploadDir'] = '';
141-
$cfg['SaveDir'] = '';
142+
if (isset($_ENV['PMA_UPLOADDIR'])) {
143+
$cfg['UploadDir'] = $_ENV['PMA_UPLOADDIR'];
144+
}
145+
146+
if (isset($_ENV['PMA_SAVEDIR'])) {
147+
$cfg['SaveDir'] = $_ENV['PMA_SAVEDIR'];
148+
}
142149

143150
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
144151
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];

config.inc.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
'PMA_QUERYHISTORYMAX',
2626
'MAX_EXECUTION_TIME',
2727
'MEMORY_LIMIT',
28+
'PMA_UPLOADDIR',
29+
'PMA_SAVEDIR',
2830
];
2931

3032
foreach ($vars as $var) {
@@ -137,8 +139,13 @@
137139
$i--;
138140

139141
/* Uploads setup */
140-
$cfg['UploadDir'] = '';
141-
$cfg['SaveDir'] = '';
142+
if (isset($_ENV['PMA_UPLOADDIR'])) {
143+
$cfg['UploadDir'] = $_ENV['PMA_UPLOADDIR'];
144+
}
145+
146+
if (isset($_ENV['PMA_SAVEDIR'])) {
147+
$cfg['SaveDir'] = $_ENV['PMA_SAVEDIR'];
148+
}
142149

143150
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
144151
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];

fpm-alpine/config.inc.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
'PMA_QUERYHISTORYMAX',
2626
'MAX_EXECUTION_TIME',
2727
'MEMORY_LIMIT',
28+
'PMA_UPLOADDIR',
29+
'PMA_SAVEDIR',
2830
];
2931

3032
foreach ($vars as $var) {
@@ -137,8 +139,13 @@
137139
$i--;
138140

139141
/* Uploads setup */
140-
$cfg['UploadDir'] = '';
141-
$cfg['SaveDir'] = '';
142+
if (isset($_ENV['PMA_UPLOADDIR'])) {
143+
$cfg['UploadDir'] = $_ENV['PMA_UPLOADDIR'];
144+
}
145+
146+
if (isset($_ENV['PMA_SAVEDIR'])) {
147+
$cfg['SaveDir'] = $_ENV['PMA_SAVEDIR'];
148+
}
142149

143150
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
144151
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];

fpm/config.inc.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
'PMA_QUERYHISTORYMAX',
2626
'MAX_EXECUTION_TIME',
2727
'MEMORY_LIMIT',
28+
'PMA_UPLOADDIR',
29+
'PMA_SAVEDIR',
2830
];
2931

3032
foreach ($vars as $var) {
@@ -137,8 +139,13 @@
137139
$i--;
138140

139141
/* Uploads setup */
140-
$cfg['UploadDir'] = '';
141-
$cfg['SaveDir'] = '';
142+
if (isset($_ENV['PMA_UPLOADDIR'])) {
143+
$cfg['UploadDir'] = $_ENV['PMA_UPLOADDIR'];
144+
}
145+
146+
if (isset($_ENV['PMA_SAVEDIR'])) {
147+
$cfg['SaveDir'] = $_ENV['PMA_SAVEDIR'];
148+
}
142149

143150
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
144151
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];

0 commit comments

Comments
 (0)