Compare commits

..
544 Commits
Author SHA1 Message Date
William Desportes 452a995fe6 Install the extension from the folder directly
Ref: https://github.com/docker-library/official-images/pull/20045

As advised on https://github.com/docker-library/official-images/pull/20045
2025-10-08 22:49:29 +02:00
Isaac Bennetch 5a80b52270 CHANGELOG for 5.2.3.1 (issue #465)
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2025-10-08 12:37:25 -04:00
Daniel RudolfandIsaac Bennetch 4bce58ddab Remove superfluous uploadprogress.tar.gz
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2025-10-08 12:35:01 -04:00
William Desportes fc38d23ff1 Enable the uploadprogress extension
Fixes #437
Ref: 6bfaf085b4

Missing copying that

Signed-off-by: William Desportes <williamdes@wdes.fr>
2025-10-08 10:28:34 +02:00
William Desportes 739bbbbe8c Add CHANGELOG entries 2025-10-08 10:27:31 +02:00
William Desportes 6bfaf085b4 Enable the uploadprogress extension
Fixes #437

Signed-off-by: William Desportes <williamdes@wdes.fr>
2025-10-08 10:24:52 +02:00
William Desportes 04b3786429 Update to 5.2.3 release
Signed-off-by: William Desportes <williamdes@wdes.fr>
2025-10-08 10:01:07 +02:00
William Desportes 5e91d468ca Update to PHP 8.3
Fixes #464
2025-10-08 10:01:02 +02:00
William Desportes 0c64340e5d Update generate-stackbrew-library.sh to understand the new ENV separator
Ref: 24c2f1f855
2025-08-28 20:41:58 +02:00
Isaac Bennetch 24c2f1f855 Update ENV statements to use = to match Docker standards
Sometimes the old way generates warnings when building

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2025-02-01 15:29:24 -05:00
William Desportes 6515c2bd9c Add MariaDB 11.4 to testing and MySQL 8.4, and exclude MySQL from the SSL test 2025-01-24 11:12:17 +01:00
William Desportes 7d51494097 Remove not needed audit plugin for SSL test 2025-01-24 10:44:31 +01:00
William Desportes 188a0e3542 Do not remove manually marked dependencies of php extensions 2025-01-24 09:52:08 +01:00
William Desportes 5d89c078f2 Edit the CHANGELOG for 5.2.2, even if all the changes got to 5.2.1 updates 2025-01-21 21:50:49 +01:00
Isaac Bennetch 216be795f7 Update to 5.2.2 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2025-01-21 15:44:12 -05:00
William Desportes 5043535036 Import some Docker Hub formatting for easier merges
Ref: https://github.com/docker-library/docs/pull/2527
2025-01-15 00:53:38 +01:00
William Desportes 22f2d4a373 Generate test keys for the SSL connection (#441) 2025-01-15 00:19:00 +01:00
William Desportes ab37078704 Test the SSL connection (#441) 2025-01-15 00:05:15 +01:00
William Desportes 9fca4e0022 Fix the Makefile run-tests target 2025-01-14 21:53:49 +01:00
William Desportes 240506356c Skip SSL for tests 2025-01-14 21:53:35 +01:00
William Desportes 04de4ca2ba Use a sticky bit for tmp/ 2025-01-14 14:39:35 +01:00
William Desportes ea2d5dc8fd Update testing to 3.21 2025-01-14 14:28:44 +01:00
William Desportes bb0fd043c3 Make all files read only, except tmp 2025-01-14 14:20:47 +01:00
William Desportes 812039a7de Make containers contents run on www-data 2025-01-14 14:06:04 +01:00
William Desportes 577a94fda6 Remove PMA_SSL and PMA_SSLS from _FILE support (#441) 2025-01-14 13:46:02 +01:00
William Desportes ec0d6a5c3a Use chown from Docker directly 2025-01-11 00:43:20 +01:00
lordrobincbzandWilliam Desportes 788475217f Fix Dockerfile templates: add helpers.php 2025-01-11 00:37:16 +01:00
William Desportes 2b712de361 Add CHANGELOG entries for #448 2025-01-07 22:36:51 +01:00
William Desportes 9c06d07727 Add a CHANGELOG entry for #186
Ref: 12b0f347cb
2025-01-07 22:29:24 +01:00
William Desportes a0e0282c91 Fix $i could be affected by the socket settings not being of the same length
Sync all variants
Ref: 12b0f347cb

"Looping through $sockets using the same index variable $i interferes with $i--; on the following line. PMA_HOSTS & PMA_SOCKETS may not be of equal length."
2025-01-07 22:29:19 +01:00
e1fe998378 Add mutual TLS (mTLS) support for remote database connections in PhpMyAdmin (#448)
Add mutual TLS (mTLS) support for remote database connections in PhpMyAdmin

Pull-request: #448

Signed-off-by: lordrobincbz <robincrombez.pro@gmail.com>
Co-authored-by: William Desportes <williamdes@wdes.fr>
2025-01-07 21:27:08 +00:00
William Desportes 12b0f347cb Fix $i could be affected by the socket settings not being of the same length
"Looping through $sockets using the same index variable $i interferes with $i--; on the following line. PMA_HOSTS & PMA_SOCKETS may not be of equal length."
2025-01-03 23:56:43 +01:00
William Desportes f79c7073ab Ref #187 - Make the rootless test fully using rootless and allow to skip the expose_php assertion
The HIDE_PHP_VERSION is not usable with rootless
2024-08-20 20:33:27 +02:00
William Desportes 0109a4fbdd Revert "Ref #187 - Make custom ini files writable in rootless mode"
This reverts commit 2335c3151b.
2024-08-20 20:11:24 +02:00
William Desportes a0e2d0f499 Bump testing to Alpine 3.20
Ref: #439
2024-08-20 20:09:38 +02:00
William Desportes 4cbf9ef735 Merge #432 - Fix Permissions of config.secret.inc.php
Pull-request: #432
Signed-off-by: William Desportes <williamdes@wdes.fr>
2024-08-20 20:05:49 +02:00
William Desportes 6a4843e99d Delete the old stalebot config 2024-08-20 20:03:42 +02:00
William Desportes 998a6d85ab Update CHANGELOG.md 2024-08-20 20:02:57 +02:00
William Desportes 8831312555 Merge #441 - Enable SSL for all server
Pull-request: #441
Signed-off-by: William Desportes <williamdes@wdes.fr>
2024-08-20 19:59:49 +02:00
TasdidurRahman 928a52ebcb update README.md
Signed-off-by: TasdidurRahman <tasdid@appscode.com>
2024-08-19 17:45:37 +06:00
TasdidurRahman 752da8f2d9 update README.md for PMA_SSL
Signed-off-by: TasdidurRahman <tasdid@appscode.com>
2024-08-19 16:49:04 +06:00
TasdidurRahman 88b594a77f enable server specific ssl
Signed-off-by: TasdidurRahman <tasdid@appscode.com>
2024-08-19 15:45:28 +06:00
TasdidurRahman 2d6be82ec6 enable server specific ssl
Signed-off-by: TasdidurRahman <tasdid@appscode.com>
2024-08-01 18:34:36 +06:00
TasdidurRahman e3f29d8d2e enable ssl for all server
Signed-off-by: TasdidurRahman <tasdid@appscode.com>
2024-08-01 15:20:01 +06:00
William Desportes 2335c3151b Ref #187 - Make custom ini files writable in rootless mode 2024-04-02 22:20:35 +02:00
William Desportes 6a687794c6 Ref #187 - Also test with another user 2024-04-02 22:00:45 +02:00
William Desportes 6d69b7796b Ref #187 - Make all the data www-data:www-data 2024-04-02 21:42:14 +02:00
William Desportes 6070d87f73 Use Alpine 3.19 for testing 2024-04-02 20:07:04 +02:00
William Desportes 50b7203dbf Merge #434 - Enable remoteip mod for Apache 2024-04-02 20:02:07 +02:00
William Desportes aa656af9c5 Bump GitHub actions 2024-04-02 20:00:29 +02:00
William Desportes 79a51154c1 Use docker compose plugin instead of the old binary 2024-04-02 19:56:17 +02:00
MelleandWilliam Desportes 215f36692f Enable remoteip for Apache
Co-Authored-by: William Desportes <williamdes@wdes.fr>
2024-04-02 19:52:10 +02:00
Daniel PätzoldandGitHub 3e0bcce10e Fix Permissions og config.secret.inc.php
For Docker in rootless-mode having the default umask of Docker set to 0007, the file will get created readable only to root.

Changed the ownership of that file to be readable by www-data.
2023-12-29 16:51:44 +01:00
William Desportes 272944cc5a Fix #287 - Verify the version syntax in *.sh to avoid command injection 2023-08-03 16:14:42 +02:00
William Desportes 6517adbfe3 Fix #421 - Document PMA_SOCKET and PMA_SOCKETS 2023-08-03 15:52:13 +02:00
William Desportes 30db079919 Merge #418 - improve the fix made in #417
Ref: 87bbb8dd8f
2023-07-04 18:14:25 +02:00
Eric de Ruiter da4b8f273a Better fix for #416
This applies the fixes suggested in https://github.com/docker-library/official-images/pull/14960
2023-07-04 14:39:51 +02:00
William Desportes 692333aa2d Update generate-stackbrew-library.sh from upstream build pack
To reduce further diffs when it will be updated to use versions.json if this happens

Ref: https://github.com/docker-library/buildpack-deps/blob/master/generate-stackbrew-library.sh
2023-06-30 14:21:33 +02:00
William Desportes 8674356a6d Merge #408 - Refactor update.sh 2023-06-30 13:51:41 +02:00
William Desportes a5b42082a8 Update CHANGELOG.md
Ref: 271a3e6a3e

[ci skip]
2023-06-30 13:48:41 +02:00
William Desportes 3c0561bd6e Run update.sh 2023-06-30 13:47:04 +02:00
William Desportes 636af2024a Revert "Auxiliary commit to revert individual files from d10b78cde45c4b6e081e4e5e38f354347838fb6f"
This reverts commit f5606d330139fca0dcb6ab97ac4826c5cbed1803.
2023-06-30 13:46:40 +02:00
William Desportes 1c138c510c Revert "Auxiliary commit to revert individual files from f650628a767be59159f10b9f9c18821235fb2d12"
This reverts commit 25b588cca10026c25bb856f6fb8bba2767e7af9a.
2023-06-30 13:45:42 +02:00
William Desportes 813fcf8410 Revert "Auxiliary commit to revert individual files from 5239485cfc6ed1099b15d634dc9431ddabb938ab"
This reverts commit bc440d32df7d8a2eea760fd85ae81564f7b77be8.
2023-06-30 13:42:08 +02:00
William Desportes d10b78cde4 Revert "Auxiliary commit to revert individual files from e68cbb87af581149bf433be6b94600c0288aa452"
This reverts commit 5d0a2c22adbb918ceb11d84eaddeff0750df759d.
2023-06-30 13:38:42 +02:00
William Desportes 644a36f7a0 Revert "Run update.sh"
This reverts commit 6d73dc8728.
2023-06-30 13:37:41 +02:00
William Desportes 2d43a62d20 Add a CHANGELOG entry for #415
Pull-request: #415

[ci skip]
2023-06-30 11:28:46 +02:00
William Desportes 328b498f51 Merge #415 - add extension bcmath for 2nd factor authentication 2023-06-30 11:27:18 +02:00
William Desportes b3cb5de98e Make GitHub actions sed back the config to MySQL mode if needed 2023-06-29 19:58:50 +02:00
William Desportes 87e2c6a325 Fix mysqladmin and MYSQL_ROOT_PASSWORD not existing anymore on MariaDB 11 2023-06-29 19:50:18 +02:00
William Desportes 87bbb8dd8f Merge #417 - Fix #416 - for debian 12 issue that caused libraries for extensions to be uninstalled
Fixes: #416
2023-06-29 19:26:54 +02:00
Eric de Ruiter ab6a09ad9f Added extra sanity check + better output in case of failure 2023-06-29 18:34:21 +02:00
Eric de Ruiter 37b7cff908 Fix for debian 12 issue (#416) that caused libraries for extensions to be uninstalled 2023-06-29 16:08:56 +02:00
William Desportes adf9118a38 Merge #401 - Add back a /sessions volume for sessions persistence 2023-06-29 13:44:41 +02:00
William Desportes a6c091bd8c Add a test for #401 - /etc/phpmyadmin/conf.d/ 2023-06-29 13:22:07 +02:00
William Desportes d455a71d95 Merge #399 - Add back a /sessions volume for sessions persistence 2023-06-29 13:11:48 +02:00
William Desportes 948bf2d147 Merge #411 - Update to PHP 8.2 2023-06-29 13:08:10 +02:00
William Desportes e1da7554b4 Use MariaDB LTS and test on each MariaDB LTS 2023-06-29 12:59:06 +02:00
y.kandGitHub a31c702cd5 Update Dockerfile-alpine.template
add extension bcmath for 2-factor authentication
2023-06-25 13:17:41 +08:00
y.kandGitHub 7432be89e0 Update Dockerfile-debian.template
add extension bcmath for 2-factor authentication
2023-06-25 13:16:17 +08:00
Benedikt Franke 67f9b75357 Update to PHP 8.2 2023-06-14 09:38:34 +02:00
William Desportes 9a7991c3f2 Merge #407 - Add no-network option on alpine Dockerfile
Pull-request: #407
2023-06-01 19:27:22 +02:00
Daniel Rudolf 271a3e6a3e Update CHANGELOG.md
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-06-01 16:51:17 +02:00
Daniel Rudolf 6d73dc8728 Run update.sh
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-06-01 16:48:07 +02:00
Daniel Rudolf e68cbb87af Add versions.json
'versions.json' contains information about the latest branches (currently phpMyAdmin 5.2 only) and variants. It was inspired by PHP's official Docker image and is managed by `update.sh`. There's no need to edit this file manually, just run `update.sh`.

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-06-01 16:45:29 +02:00
Daniel Rudolf 5ee9a9ced5 update.sh: Add 'DO NOT EDIT' note to generated Dockerfiles
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-06-01 16:41:20 +02:00
Daniel Rudolf 2cb9a6214e update.sh: Add some comments and code cleanup
This commit includes no functional changes.

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-06-01 16:36:36 +02:00
Daniel Rudolf 4a5875f495 update.sh: Add 'php_version' variable
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-06-01 16:26:05 +02:00
Daniel Rudolf 5239485cfc update.sh: Bake GPG key, sha256 and version directly into Dockerfiles
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-06-01 16:22:09 +02:00
Daniel Rudolf f650628a76 update.sh: Bake download URLs directly into Dockerfiles
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-06-01 16:19:53 +02:00
Daniel Rudolf dbfffe50c7 update.sh: Add 'create_variant' function
This commit includes no functional changes besides a new debug info.

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-06-01 16:12:18 +02:00
Daniel Rudolf fb5c1a2104 update.sh: Increase error verbosity
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-06-01 16:06:58 +02:00
J0WI 7967e63883 Add no-network option 2023-05-31 14:36:01 +02:00
PigoandGitHub 0730e5188e Adding Custom Configuration in /etc/phpmyadmin/conf.d 2023-03-29 19:56:08 +08:00
PigoandGitHub 47a3db45ad Adding Custom Configuration in /etc/phpmyadmin/conf.d 2023-03-29 19:55:13 +08:00
PigoandGitHub f8edb1ca87 check /etc/phpmyadmin/conf.d exists
/etc/phpmyadmin/conf.d need to check whether  /etc/phpmyadmin/conf.d exists
2023-03-29 17:30:57 +08:00
PigoandGitHub a03d55e76a Support additional configurations
#319
2023-03-29 11:15:30 +08:00
William Desportes 0006406e35 Add a CHANGELOG entry for #133
Pull-request: #394
2023-03-11 17:09:52 +01:00
William Desportes 7f5a48b7c3 Merge #394 - Fix #133 - Add TZ env var to change PHP date.timezone
Pull-request: #394
Fixes: #133
2023-03-11 17:07:23 +01:00
William Desportes bb70a46858 Add back a /sessions volume for sessions persistence
Ref: #274
Ref: #198
2023-03-11 17:00:11 +01:00
William Desportes 88f6d787d0 Update CHANGELOG.md
[ci skip]
2023-02-14 17:21:27 +01:00
Isaac Bennetch a1772debe4 Releasing 5.2.1 again
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2023-02-07 23:59:45 -05:00
Isaac Bennetch b0305371a4 Fix Docker build where rm would error because of a missing folder
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2023-02-07 23:58:50 -05:00
Isaac Bennetch 1241428f99 Update to 5.2.1 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2023-02-07 22:01:01 -05:00
Sergio-IME fa108dc809 Add TZ env var to change PHP date.timezone 2023-01-20 18:02:51 +01:00
William Desportes d1f327e462 Fix #393 - Upgrade the image to PHP 8.1 2023-01-01 12:11:54 +04:00
William Desportes c59f287b98 Move documentation for ENVs of #384 and fixup the wording 2022-11-25 17:47:44 +01:00
William Desportes a5fd64c9fb Add CHANGELOG entries for #381 and #384 2022-11-25 17:44:59 +01:00
William Desportes e6f53b6f8e Add tests for phpmyadmin/docker#384 to the CI 2022-11-25 17:30:38 +01:00
William Desportes 71d54acc93 Merge #384 - Add ENV PMA_UPLOADDIR and PMA_SAVEDIR ENVs
Pull-request: #384
2022-11-25 16:29:15 +01:00
William Desportes c3e03b7429 Add tests for phpmyadmin/docker#384 2022-11-25 16:23:47 +01:00
William Desportes 83bd66d27f Update config.inc.php files 2022-11-25 15:14:29 +01:00
William Desportes 1effd43182 Merge #381 - Fix issue port 80- range when using APACHE_PORT
Pull-request: #381
2022-11-25 15:14:06 +01:00
William Desportes 908e79d246 Merge #389 - Use GitHub Actions to use the new bashbrew action
Pull-request: #389
2022-11-17 22:16:51 +01:00
Tianon Gravi 010de91f3c Update GitHub Actions to use new bashbrew action
This should fix errors that the old code would've run into thanks to the update to Go 1.18, and should help prevent them in the future by pinning to a specific release of both Bashbrew and the related scripts.
2022-11-17 11:46:54 -08:00
7e5dd3b39d Update description of PMA_UPLOADDIR and PM_SAVEDIR
Co-authored-by: William Desportes <williamdes@wdes.fr>
2022-09-21 14:39:50 +01:00
Chris ProudandGitHub 9b09f1ae4c Add ENV PMA_UPLOADDIR and PMA_SAVEDIR to README.md 2022-09-21 14:07:05 +01:00
Chris ProudandGitHub 80ce7025ac Remove Trim() from around dir env settings 2022-09-21 13:10:09 +01:00
Chris ProudandGitHub 0c1b04d2fc [+] ENV PMA_UPLOADDIR and PMA_SAVEDIR 2022-09-20 17:15:13 +01:00
ByteBittenandGitHub 031d27ad30 Fix issue port 80- range when using APACHE_PORT
Setting port to 8000-8099 caused issues after a restart.
Ex: Port got set from 8090 to 809090 resulting in error AH00526.
Using full line replace as ports.conf next character is new line.
2022-08-17 14:56:16 +02:00
William Desportes 905cae841e Update the examples to have something more explicit for Docker command line examples
Ref: https://github.com/phpmyadmin/phpmyadmin/commit/7faf6a53ecd3ce5b47d484b717c9b153d970f678
2022-08-10 00:39:02 +02:00
William Desportes 0ed2e6651b Apply some coding standard rules on config.inc.php 2022-08-01 11:01:02 +02:00
William Desportes df4d08c1a8 Add a missing CHANGELOG entry 2022-08-01 10:54:12 +02:00
William Desportes 0c9a5f06d5 Fix a typo in the README 2022-08-01 10:53:59 +02:00
William Desportes 918d2639a9 Give more time for databases to start on d-compose tests 2022-06-20 01:18:56 +02:00
William Desportes 3f1f550631 Update CHANGELOG.md 2022-06-20 01:13:00 +02:00
William Desportes 9b6fb4229f Stop using container names 2022-06-20 01:07:20 +02:00
William Desportes 8b33eefd53 Add project name for test runs 2022-06-20 01:07:15 +02:00
William Desportes 095161cdb1 Implement test cleanup 2022-06-20 01:07:11 +02:00
William Desportes b936b8ebd1 Ref #369 - Update files using ./update.sh 2022-06-20 01:07:06 +02:00
William Desportes 5ab888d0d4 Ref #369 - Remove apache specific settings from non apache entrypoints 2022-06-20 01:06:59 +02:00
William Desportes fee52fdd0b Merge #369 - Allow a different Apache port with APACHE_PORT
Pull-request: #369
Fixes: #340
Ref: #187
2022-06-20 01:06:42 +02:00
William Desportes 3c16423f78 Ref #369 - Add tests for a different Apache2 port 2022-06-20 00:35:02 +02:00
William Desportes 0b7054a449 Fix #372 - Support docker secrets from file for {PMA_USER,PMA_CONTROLUSER,PMA_CONTROLHOST}
- Support docker secrets from file for `PMA_USER`
- Support docker secrets from file for `PMA_CONTROLUSER`
- Support docker secrets from file for `PMA_CONTROLHOST`
2022-06-19 19:47:49 +02:00
William Desportes 6718899e83 Update CHANGELOG.md 2022-06-19 19:42:20 +02:00
Devin Matte aa6481613d Allowing different apache ports 2022-06-10 13:39:10 -04:00
William Desportes 0f9d9d2630 Fix the section about E2E tests 2022-06-10 16:00:17 +02:00
William Desportes 336ba22d89 Stop forcing a specifig auth mysql plugin as many users do not do such config 2022-06-10 15:53:25 +02:00
William Desportes 545fcca480 Mark test script as python3 2022-06-10 15:52:00 +02:00
William Desportes 3c859c0511 Add mariadb-connector-c for support of caching sha2 password method 2022-06-10 15:43:52 +02:00
William Desportes 347512bfc4 Re-work the makefile 2022-06-10 15:38:42 +02:00
William Desportes d621982217 Move docker-compose test files into a folder 2022-06-10 15:14:55 +02:00
William Desportes cc19f8ada1 Use Alpine 3.15 for the test image 2022-06-10 13:25:56 +02:00
William Desportes c0cd783445 Add permissions on GitHub workflows 2022-06-10 12:20:10 +02:00
William Desportes 326191915b Change the config syntax replacement way for phpMyAdmin 5.2 to define the "configFile" directive
Fixes #361
Fixes #364
Fixes #365
Fixes #366
2022-05-12 21:17:50 +02:00
William Desportes cddd8dda1b Add commands to check the replaced line can be found and was replaced + lint the file afterwards
Ref #361
Ref #364
Ref #365
Ref #366
2022-05-12 21:07:32 +02:00
William Desportes a9851bbd0c Bump actions/checkout to v3 2022-05-12 21:05:38 +02:00
Isaac Bennetch b057ee3d89 Update to 5.2.0 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2022-05-11 10:21:57 -04:00
Isaac Bennetch 90bc75ac92 Version 5.1.4
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2022-05-11 10:17:10 -04:00
Isaac Bennetch 026ddf5c11 Fix incorrect image tag name in README.md
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2022-02-11 09:12:01 -05:00
Isaac Bennetch 2b79d71002 Update to 5.1.3 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2022-02-11 08:58:24 -05:00
Isaac Bennetch 4dd05de348 Update to 5.1.2 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2022-01-21 22:08:10 -05:00
William Desportes 7c28533a32 Fix #325 - Upgrade to PHP 8 2021-08-23 17:39:00 +02:00
William Desportes 056d2b51fd Write CHANGELOG entries since 4.9.2 2021-08-23 17:26:34 +02:00
William Desportes 030928a01e Fix #345 - Add back composer.json and remove non needed source files 2021-08-23 16:46:30 +02:00
William Desportes a73a82a790 Change the tags list link to the official image 2021-08-13 02:59:02 +02:00
William Desportes 0f4250dc7f Move test section to the end
I bet most users to not care about it
2021-08-13 02:55:48 +02:00
William Desportes 17b7a91289 Add a warning and example on the README
Ref: #338
Ref: #342
2021-08-13 02:53:23 +02:00
William Desportes 886f7ae6e3 Fix yaml format fence on the README 2021-08-13 02:47:32 +02:00
William Desportes 1655371fb0 Remove microbadger, it has shutdown 2021-08-13 02:45:41 +02:00
William Desportes 60c187d10d Add some format details from the PHP FAQ
Closes: #328
2021-08-13 02:42:49 +02:00
William Desportes 3dafd123f8 Merge #341 - Fix GPG keyservers 2021-08-13 01:43:47 +02:00
Daniel Rudolf e8ade8e3b1 Follow-up: GPG: Fix GPG keyservers
Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2021-08-11 20:25:33 +02:00
Daniel Rudolf 12e6fdf738 GPG: Fix GPG keyservers
sks-keyservers.net was shut down some time ago. keys.gnupg.net is just
an alias. Neither pgp.mit.edu, nor keyserver.pgp.com are available
right now, but there was no take-down notice, so we should assume they
are temporarily unavailable. Use keys.openpgp.org as main alternative.

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2021-08-11 18:49:58 +02:00
Isaac Bennetch 935605b8d0 Update to 5.1.1 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2021-06-04 00:45:29 -04:00
Isaac Bennetch 4482d47ca7 Improve documentation
Add some missing information, fix typos, restructure, and improve
readability

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2021-03-17 21:22:05 -04:00
Isaac Bennetch 3d8c2ba403 Update to 5.1.0 release
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2021-02-24 01:44:19 -05:00
William Desportes e09f731a32 Merge #324 - Add expose_php env back
It was broken in #320 implementation
2021-02-07 22:02:42 +01:00
J0WI d383a98040 Revert HIDE_PHP_VERSION removal 2021-02-07 21:25:36 +01:00
William Desportes bd7de17631 Add MEMORY_LIMIT to allowed ENV names
Added in #320
See: https://github.com/docker-library/official-images/pull/9426
2021-02-02 00:12:33 +01:00
William Desportes 49a7e0fba7 Make the new MEMORY_LIMIT ENV work for phpMyAdmin configs
Added in #320
See: https://github.com/docker-library/official-images/pull/9426
2021-02-02 00:08:42 +01:00
William Desportes b0beabb4ed Add back HIDE_PHP_VERSION to Docker hub readme
Removed in #320 by mistake
See: https://github.com/docker-library/official-images/pull/9426
2021-02-02 00:05:26 +01:00
William Desportes 1a7be47268 Fix PMA_QUERYHISTORYMAX ENV in config.inc.php
See: https://github.com/docker-library/official-images/pull/9426
2021-02-01 23:53:40 +01:00
William Desportes 8dc7e66dec Merge #320 - Generate phpmyadmin-misc.ini from ENVs 2021-01-30 00:22:21 +01:00
William Desportes d6ab5de683 Add a missed assertion on max_execution_time 2021-01-30 00:15:16 +01:00
J0WIandWilliam Desportes e1bfab5583 Generate phpmyadmin-misc.ini from ENVs 2021-01-30 00:02:30 +01:00
William Desportes 3ba3be3492 Merge #322 - Add PMA_CONTROLPASS 2021-01-29 23:59:11 +01:00
William Desportes 4537d1869c Merge #323 - Re work the test system 2021-01-29 23:58:01 +01:00
William Desportes d7b3994b3a Add a test for PMA_HOST 2021-01-29 23:52:24 +01:00
William Desportes d91c4ba999 Clean old CI files 2021-01-29 23:00:38 +01:00
William Desportes 56fbf97a95 Add more tests for UPLOAD_LIMIT 2021-01-29 21:52:36 +01:00
William Desportes 71627ad719 Re-work the testing scripts 2021-01-29 21:12:55 +01:00
William Desportes 568e5ed308 Use healthcheck strategy for running tests 2021-01-29 14:14:08 +01:00
William Desportes a4dd0817f0 Add a test for PMA_CONTROLPASS secret file 2021-01-28 22:50:06 +01:00
William Desportes 508c9b991c Add PMA_CONTROLPASS to the README file 2021-01-28 22:49:22 +01:00
William Desportes 5d45c24548 Update different versions to add PMA_CONTROLPASS 2021-01-28 22:49:08 +01:00
William Desportes 4e6ed4b275 Update actions/checkout to v2 2021-01-28 22:46:14 +01:00
nicolas.clementz d0f71fbf3b Add PMA_CONTROLPASS to variables thas can be read from a file using _FILE 2021-01-28 11:56:40 +11:00
William Desportes a66e868fd0 Merge #317 - Fix #309 QueryHistoryMax is an int 2020-12-31 11:08:11 +01:00
w3goodiesandGitHub 9322b7afdf Update config.inc.php
PMA_QUERYHISTORYMAX is integer value. Using boolval on it will either result in 1 or 0 for max query history.
2020-12-31 06:19:01 +03:00
William Desportes 0225133981 Merge #292 - Documentation fixes 2020-12-26 12:19:54 +01:00
William Desportes d6da7ca981 Wording improvement 2020-12-26 12:19:09 +01:00
William Desportes 76b8d29695 Improvements and document #309 2020-12-26 12:15:33 +01:00
Isaac BennetchandWilliam Desportes 00ad857703 Document more ENV variables that were added with https://github.com/phpmyadmin/docker/pull/152/
Related to 85198de04f and 93e2be73ec

Fixes #151

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-12-26 12:05:40 +01:00
Isaac BennetchandWilliam Desportes b2edf5d8fd Grammar fixes
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-12-26 12:05:10 +01:00
William Desportes 4b1fe4dc6f Merge #314 - Add the possibility to change max_execution_time 2020-12-26 12:02:34 +01:00
William Desportes a2b0f3a5c0 Merge #309 - Add PMA_QUERYHISTORYMAX config parameter 2020-12-26 12:01:05 +01:00
Dennis PaulandWilliam Desportes a3a4c4e0fd [+] ENV MAX_EXECUTION_TIME 2020-12-26 11:58:45 +01:00
William Desportes 06cc93a972 #313 - Drop Build Images from TravisCI 2020-12-26 11:53:10 +01:00
William Desportes 7f5e91546b Merge #305 - Add 'max_input_vars = 10000' to phpmyadmin_misc.ini 2020-12-26 11:44:14 +01:00
William Desportes 7e3ee4e83c Merge #313 - Add GitHub CI 2020-12-26 11:42:36 +01:00
William Desportes 1465223b65 Improve the README.md 2020-12-26 11:41:21 +01:00
J0WI a8ab7d86e7 Add GitHub CI 2020-11-06 22:20:42 +01:00
Samuel Denis-D'OrtunandGitHub 5e1ea11678 Add PMA_QUERYHISTORYMAX config parameter 2020-10-16 23:10:58 -04:00
Isaac Bennetch 497becb0f2 Update to 5.0.4
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-10-15 18:51:26 -04:00
Isaac Bennetch ba8ecc42f1 Update to 4.9.7
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-10-15 18:50:23 -04:00
Isaac Bennetch 3b0375d811 Release 5.0.3
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-10-10 00:18:15 -04:00
Isaac Bennetch 4f54fc3b46 Release 4.9.6
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-10-10 00:15:20 -04:00
slavik af6cdca3b6 add 'max_input_vars = 10000' to phpmyadmin_misc.ini 2020-09-24 00:37:25 -07:00
William Desportes 785cd48c48 #268 - Add instructions to download bashbrew 2020-09-03 18:23:25 +02:00
William Desportes 301a7c4d18 Merge #268 - Update generate-stackbrew-library.sh 2020-09-03 18:07:59 +02:00
William Desportes ad9f085601 Merge #303 - Fix docker hub tags page link 2020-09-03 18:07:16 +02:00
ff56a56a29 Use the docker library path for tags page
Co-authored-by: William Desportes <williamdes@wdes.fr>
2020-09-03 18:03:41 +02:00
Thomas DutrionandGitHub e3b575ca8e Fix docker hub tags page link
Fix Docker hub tags page link in README
2020-09-03 17:35:54 +02:00
William Desportes b9da1f2c54 Merge #301 - Update paths to image 2020-08-31 19:13:36 +02:00
J0WI d00506237d Update paths to image 2020-08-30 17:22:07 +02:00
William Desportes 39cec98bb5 Use fences for pseudo regex example of #297
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-07-31 23:47:13 +02:00
William Desportes 300ade5226 Merge #297 - Improve UPLOAD_LIMIT documentation 2020-07-31 23:44:12 +02:00
Thomas DecauxandGitHub 76651f53b3 Specify UPLOAD_LIMIT format
Default value format "2048Kb" will not work with Apache !
2020-07-31 15:35:37 +02:00
William Desportes 9d66e78f8a Merge #289 - Add SHA checksum when downloading a version
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-06-01 10:57:51 +02:00
William Desportes 85a642d7b3 Make sha256 fetching more strict
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-06-01 10:56:52 +02:00
J0WI 6e3aeb3adf Update generate-stackbrew-library.sh 2020-05-16 03:07:45 +02:00
William Desportes c0b2ac28f9 Merge #288 - Use same "latest" procedure as in update.sh
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-09 17:46:43 +02:00
J0WI 52d6fe4caf Use same "latest" procedure as in update.sh 2020-05-08 04:46:46 +02:00
J0WI f464cf5a67 Add SHA checksum 2020-05-08 04:44:41 +02:00
William Desportes d1f2dea243 Revert 490df186e5
This commit is no more needed because 27f6f7e5ae fixed the tag process

Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-07 09:48:08 +02:00
William Desportes 27f6f7e5ae Fix parsing each revision on generate-stackbrew-library.sh
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-07 08:50:07 +02:00
William Desportes 490df186e5 Add each variant to the tag list
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-07 08:49:31 +02:00
William Desportes d826f3a721 Merge #286 - cleanup after review for #56
Partial revert of 6b63869f1c

Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-05-07 08:30:07 +02:00
J0WI 12d40a0300 Cleanup according to review 2020-05-07 01:11:27 +02:00
William Desportes 48f16c0dde Update files after #285
Ref: https://github.com/phpmyadmin/docker/pull/285#issuecomment-612213968
2020-04-18 18:05:28 +02:00
Isaac BennetchandGitHub 0dbbe66eb3 Merge pull request #285 from ibennetch/webroot
Extract downloaded files directly to web root /var/www/html/
2020-04-18 11:30:12 -04:00
Isaac Bennetch 4d5c71ca6e Extract downloaded files directly to web root /var/www/html/
Fixes #277

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-04-10 16:34:27 -04:00
Isaac BennetchandGitHub 459489d8c1 Merge pull request #283 from krufab/bugfix/281-added-tzdata-package
#281 Added tzdata also to the template alpine file
2020-03-29 13:57:44 -04:00
Fabio Kruger ac3c819a69 #281 Added tzdata also to the template alpine file
Signed-off-by: Fabio Kruger <krufab@gmail.com>
2020-03-29 19:15:03 +02:00
Isaac BennetchandGitHub 34c0696109 Merge pull request #282 from krufab/bugfix/281-added-tzdata-package
#281 Added tzdata package
2020-03-28 21:26:23 -04:00
Fabio Kruger 3a9dc863e2 #281 Added tzdata package
Signed-off-by: Fabio Kruger <krufab@gmail.com>
2020-03-27 23:16:29 +01:00
Isaac Bennetch 6c9a35dc6e Release 5.0.2
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-03-21 00:44:01 -04:00
William Desportes 26be7daa0c Merge #275 - add some org.opencontainers.image.* labels
Pull-request: #275
2020-03-17 21:41:24 +01:00
William Desportes 6b63869f1c Add org.opencontainers.image.* labels
Licence: https://github.com/phpmyadmin/phpmyadmin/blob/master/composer.json
2020-03-17 21:37:29 +01:00
William Desportes a4071cd297 Merge #274 - apply some feedback from docker-library team
Pull-request: #274
2020-03-17 20:15:46 +01:00
J0WI e05baec603 Apply various minor enhancements 2020-03-17 18:16:01 +01:00
William Desportes 6cd68f9647 Fix generate-stackbrew-library.sh Maintainers format
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-01-16 23:16:05 +01:00
William Desportes 48f555eb3d Maintainer replacement
I put my name here because Michal Čihař resigned from phpMyAdmin
https://blog.cihar.com/archives/2019/05/29/spring-cleanup/
I hope this change is okay :)
[ci skip]
Signed-off-by: William Desportes <williamdes@wdes.fr>
2020-01-16 23:01:11 +01:00
Isaac Bennetch 8c9962be4f Release 5.0.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-01-07 22:07:49 -05:00
Isaac Bennetch 30fea9d2f4 Add version 4.9.4
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-01-07 22:06:55 -05:00
Isaac Bennetch c850d7ece9 Release 5.0.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-01-07 21:55:13 -05:00
Isaac Bennetch 8917fb7bc2 Update to phpMyAdmin release 5.0.0
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-01-01 22:22:25 -05:00
Isaac Bennetch 31f2bdd82c Update to phpMyAdmin release 4.9.3
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2020-01-01 22:14:24 -05:00
Isaac Bennetch 6d26530177 Update to phpMyAdmin release 5.0.0
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-12-26 12:20:27 -05:00
William Desportes 5d4b4dec94 Merge #259 - Improve documentation of which Docker tags we offer
Pull-request: #259
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-26 17:10:42 +01:00
William Desportes 4f88748138 Improve README.md and add a link to the main repo
[ci skip]

Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-26 13:32:14 +01:00
William Desportes b295aa6bf7 Improve README and fix PMA_HOSTS and PMA_HOST
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-26 13:27:08 +01:00
William Desportes dd2ca51984 Update files after 2313c19aed (#247)
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-26 13:21:11 +01:00
William Desportes 568e58cc53 Merge #247 - Implement *_FILE read ENV from file
Pull-request: #247
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-26 13:21:08 +01:00
Mandy SchoepandWilliam Desportes 60e766aa9e Added support for PMA_HOST_FILE and PMA_HOSTS_FILE 2019-12-26 13:17:43 +01:00
Mandy SchoepandWilliam Desportes 05d5c516d3 Fix and improve test suite 2019-12-24 11:21:35 +01:00
Mandy SchoepandWilliam Desportes 2576eb2c26 Implement loading secrets from files 2019-12-24 11:21:06 +01:00
Mandy SchoepandWilliam Desportes bf6422b6a6 Fix .gitignore, README.md and .travis.yml 2019-12-24 11:20:10 +01:00
William Desportes 8edcc52dfb Implement #192 - override config using base64 encoded config in ENVs
Closes: #192
Pull-request: #262

Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 11:13:18 +01:00
William Desportes ed101c2f39 Merge #261 - code improvements and implement UPLOAD_LIMIT
Ref: #238
Closes: #240
Closes: #239
Closes: #233
Closes: #189
Closes: #139
Closes: #241
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 11:11:23 +01:00
Isaac Bennetch fb5222a52c Improve documentation of which Docker tags we offer; standardize this list and adjust Docker Hub to match.
Closes #256, closes #231, closes #229, closes #214

Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-12-23 21:01:26 -05:00
William Desportes d147a455af Remove a non existent use case
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:35:25 +01:00
William Desportes 4e2998a2c5 Fix README.md and add a comment
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:35:25 +01:00
William Desportes 44ab81b7cf Implement upload limit as an ENV value
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:35:09 +01:00
William Desportes 4b236d823a Fix README.md
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:34:46 +01:00
William Desportes 1eede2e6b4 Use PHP_INI_DIR from base image
Ref: https://hub.docker.com/_/php
2019-12-24 00:34:46 +01:00
William Desportes 7cd2b5b46f Use url.php since it is available on all versions
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:34:46 +01:00
William Desportes 62b73c11a9 Add .gitattributes file
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:34:46 +01:00
William Desportes a309c96f6a Use user and group for sessions
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:34:46 +01:00
William Desportes 78f64ee5ce Add a new ENV
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-24 00:34:46 +01:00
Patrik KernstockandIsaac Bennetch 2313c19aed Hide PHP version (#209)
Add option to hide PHP version by adding `expose_php = Off` to `php.ini` for security reasons
Co-authored-by: William Desportes <williamdes@wdes.fr>
2019-12-23 18:26:48 -05:00
William Desportes 7d8a3e5717 Improve README.md
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-12-23 14:26:33 +01:00
J0WIandIsaac Bennetch b696c1f43d Update to PHP 7.4 (#257)
* Update to PHP 7.4
2019-12-20 02:50:31 -05:00
William Desportes 53a793568a Merge #242 - drop opcache from cli actions
Pull-request: #242
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-11-30 18:48:28 +01:00
J0WI 43888414d6 Drop opcache from cli actions 2019-11-29 19:49:53 +01:00
Isaac Bennetch 0343ca5338 Update to phpMyAdmin release 4.9.2
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-11-23 07:11:36 -05:00
William Desportes 9d1872d753 Improve TravisCI file with steps
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-10-22 00:09:47 +02:00
William Desportes 5f2beb027a Revert "Increase limits for upload and post"
This reverts commit e9d1da4ebc.
2019-10-21 21:03:25 +02:00
William Desportes 0bd0e9a958 Merge #251 - improve/fix Travis CI file
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-10-21 21:00:58 +02:00
0X8CandGitHub 8dfcf48b25 Update .travis.yml 2019-10-17 14:14:21 +08:00
William Desportes e9d1da4ebc Increase limits for upload and post
Ref: #238
Closes: #240
Closes: #239
Closes: #233
Closes: #189
2019-09-30 19:19:06 +02:00
Isaac Bennetch f522725291 Update to phpMyAdmin release 4.9.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-09-21 10:28:42 -04:00
Isaac Bennetch a68a25c673 Fix the template file from c5174eeef9
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-09-21 10:27:28 -04:00
William Desportes 21dbdb8968 Merge #232 - Add documentation for using secrets
Pull-request: #232
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-09-06 19:47:06 +02:00
William Desportes ff0e3c994a Merge #221 - remove files and improve configuration
Pull-request: #221
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-09-06 19:38:29 +02:00
William Desportes 24d76d8e35 Merge #216 - Add generate-stackbrew-library.sh
Pull-request: #216
Ref: #56
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-09-06 09:20:54 +02:00
William Desportes d3281e86e1 Merge #234 - Fix makefile
Pull-request: #234
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-09-06 09:16:51 +02:00
ankitjain28may 6167470118 Added suggestions 2019-08-23 14:46:06 +05:30
ankitjain28may 304a628535 Fix makefile 2019-08-13 02:31:23 +05:30
David WhynotandGitHub 342c5fb3fc Add documentation for using secrets. 2019-08-08 15:37:09 -04:00
J0WI c5174eeef9 Cleanup php.ini 2019-07-11 02:19:28 +02:00
Isaac Bennetch 909eab579e Check for dependency and BASH version before running the script
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-06-08 13:40:03 -04:00
Isaac Bennetch 168df32465 Merge branch 'update-version' of git://github.com/J0WI/docker-phpmyadmin
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-06-08 13:29:50 -04:00
Isaac Bennetch 41ef7ee430 Upgrade to phpMyAdmin version 4.9.0.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-06-04 12:36:40 -04:00
William Desportes 33fc40f4a3 Merge pull-request #222 (remove .dockerignore)
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-05-22 18:37:52 +02:00
William Desportes 219e173c5e Merge pull-request #225 (clean unused files)
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-05-22 18:21:48 +02:00
J0WI f30ef539da Cleanup obsolete files 2019-05-22 16:57:57 +02:00
J0WI 036fd21c08 Remove .dockerignore 2019-04-24 19:50:44 +02:00
William DesportesandGitHub 7d35294fc5 Fixed missing accent
[ci skip]
Signed-off-by: William Desportes <williamdes@wdes.fr>
2019-04-01 15:10:11 +02:00
J0WI ca4e508924 Fix typo 2019-03-29 18:11:31 +01:00
J0WI effe2b1e80 Add generate-stackbrew-library.sh 2019-03-29 09:37:58 +01:00
J0WI e670276b37 Fetch latest version from api 2019-03-29 09:11:16 +01:00
J0WIandIsaac Bennetch 78e3cb7aba Refactor Dockerfile to support multiple variants and drop supervisord (#200)
* Refactor Dockerfile to support multiple variants and drop supervisord
* Rename run.sh to docker-entrypoint.sh
* Update tests for apache conatiner
* Fix tests in conatiner
* Fix database startup
* Update Makefile to build all variants
* Update phpMyAdmin to 4.8.4
* Rebase on top of v4.8.5
2019-03-29 03:48:30 -04:00
Isaac Bennetch a114733200 Update to version 4.8.5
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2019-01-25 22:52:24 -05:00
Isaac BennetchandGitHub 967db65940 Merge pull request #201 from J0WI/travis-nosudo
[Travis CI] Drop sudo and use default distro
2018-12-30 08:48:14 -05:00
Isaac Bennetch 921f2867f7 Updated version information to remove old, unsupported releases.
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-12-30 06:46:42 -07:00
Isaac BennetchandGitHub df7df179f2 Merge pull request #202 from glensc/patch-1
Add 4.8 tag to README
2018-12-30 08:37:10 -05:00
Elan RuusamäeandGitHub 0e87cd4731 readme: 4.8 tag is also present
for ones that prefer not to have unexpected version update (but patches are ok), prefer `X.Y` docker tag over `latest`.

improve wording as technically there is no 4.8 branch yet
2018-12-19 11:55:56 +02:00
Isaac Bennetch d3d7a78dae Update to version 4.8.4
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-12-10 21:21:00 -05:00
J0WI c775ef93dc Drop sudo and use default distro 2018-11-25 17:21:33 +01:00
Isaac BennetchandGitHub d2f01baf40 Merge pull request #198 from J0WI/user-and-root
Drop custom user/group and document root, change permissions on runtime, and coding style improvements.
2018-11-22 10:09:01 -05:00
Isaac BennetchandGitHub 56806ecbc7 Merge pull request #197 from J0WI/gpg-batch
Update "gpg" invocations to use "--batch"
2018-11-22 00:17:55 -05:00
J0WI 662b82d27e Drop custom user/group and document root, change permissions on runtime 2018-11-20 01:55:47 +01:00
J0WI fa5fb6c985 Update "gpg" invocations to use "--batch" 2018-11-20 00:44:44 +01:00
Michal ČihařandGitHub b1e2062fb4 Merge pull request #184 from deeky666/allow-env-var-list-spaces
Trims whitespaces in PMA_HOSTS, PMA_PORTS and PMA_VERBOSES
2018-09-01 13:21:22 +02:00
Michal ČihařandGitHub f01eddea45 Merge pull request #191 from baotongshi/patch-1
modify the /etc/phpmyadmin/* file's access right
2018-09-01 13:20:50 +02:00
Michal ČihařandGitHub 7899e91e35 Merge pull request #186 from s0m30n3/master
Specify MySQL socket file via PMA_SOCKET and PMA_SOCKETS environment …
2018-09-01 13:20:21 +02:00
Évan GoujonandGOUJON Évan 7af014ffdf Simplify $sockets testing logic
Signed-off-by: Évan Goujon <evan.goujon@gmail.com>
2018-08-31 21:51:56 +02:00
Baotong ShiandGitHub 0512d0c6b3 Update run.sh
when I start the phpMyAdmin Container, I got the below error
phpMyAdmin - Error
Failed to load phpMyAdmin configuration (./../etc/phpmyadmin/config.inc.php:3): require(): Failed opening required '/etc/phpmyadmin/config.secret.inc.php' (include_path='.:/usr/local/lib/php')

I found the access right of the config.secret.inc.php is not correct, I added the below cmd in run.sh, then build the image, It can work

chmod 644 /etc/phpmyadmin/*
2018-08-30 09:46:04 +08:00
Isaac Bennetch 17003ccf85 Update to version 4.8.3
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-08-22 10:23:38 -04:00
Évan GoujonandGOUJON Alexandre d5a587d00d Specify MySQL socket file via PMA_SOCKET and PMA_SOCKETS environment variables
Signed-off-by: Évan Goujon <evan.goujon@gmail.com>
2018-08-19 22:21:47 +02:00
Steve Müller b2409f5930 trim whitespaces in PMA_HOSTS, PMA_PORTS and PMA_VERBOSES 2018-08-03 12:30:33 +02:00
Isaac Bennetch 7a1cbfd6a3 Update to 4.8.2
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-06-22 10:32:13 -04:00
J0WIandMichal Čihař 25dde22ee9 Use MariaDB 10.2 for now 2018-06-12 21:19:53 +02:00
J0WIandMichal Čihař f0ebd7aec5 Set default_authentication_plugin and use only one container in tests 2018-06-12 21:19:53 +02:00
J0WIandMichal Čihař 98aa7b80c8 Run supervisord in CMD 2018-06-12 07:56:33 +02:00
J0WIandMichal Čihař 2d6fd72542 Use "nogroup" as group name 2018-06-12 07:55:57 +02:00
J0WIandMichal Čihař c706c520ef Enhance caching by moving trivial tasks to the end 2018-06-12 07:55:27 +02:00
J0WIandMichal Čihař 8269a39bfa Use short option style 2018-06-10 21:42:46 +02:00
J0WIandMichal Čihař c625c70fde Fix filename in rm cmd 2018-06-10 21:42:46 +02:00
J0WIandMichal Čihař 2608fbd118 Adjust gpg code to kill daemons, cutting down on race conditions 2018-06-09 14:29:11 +02:00
J0WIandMichal Čihař df45b3f76c code style 2018-06-09 14:29:11 +02:00
J0WIandMichal Čihař edf7b2a375 Fetch xz compressed archive 2018-06-09 14:29:11 +02:00
J0WIandMichal Čihař b369d770dd Remove default values from php.ini 2018-06-09 14:18:32 +02:00
Isaac Bennetch e831e55d59 Update to 4.8.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-05-24 23:43:52 -04:00
Sullivan SENECHALandMichal Čihař 7a5f742d7d Move back compress and AllowNoPassword to default configuration 2018-05-17 16:09:14 +02:00
Isaac Bennetch 316a237509 Update to 4.8.0.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-04-19 10:14:25 -04:00
Michal Čihař 44a266c45d Add missing newline escape
Signed-off-by: Michal Čihař <michal@cihar.com>
2018-04-18 08:40:37 +02:00
Michal Čihař 2fe5947116 Use more pgp keyservers to download the key
Apparently this is only way to make this reliable.

See #149

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-04-18 08:22:22 +02:00
Michal Čihař 92a5a76a26 Switch to gnupg.net keyservers
The old one seem not to be accessible sometimes.

See #149

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-04-18 08:08:05 +02:00
Michal ČihařandGitHub 5dd9a0f015 Merge pull request #152 from Farfaday/master
Possiblity to configure the phpMyAdmin configuration storage
2018-04-18 08:01:11 +02:00
Michal ČihařandGitHub f18aca104e Merge pull request #155 from rogervila/tempdir-fix
Avoid "TempDir is not accessible" message
2018-04-18 08:00:12 +02:00
Michal ČihařandGitHub d42e7c8a7d Merge pull request #149 from J0WI/enhancements2
Fetch GnuPG key from keyserver
2018-04-18 07:58:29 +02:00
Roger VilàandGitHub ca768f47fc Avoid "TempDir is not accessible" message
phpmyadmin should create the tmp dir for twig templates.

This is the original issue: https://github.com/phpmyadmin/phpmyadmin/issues/14172
2018-04-13 11:51:35 +02:00
Isaac Bennetch c6aee5664c Update to 4.8.0
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-04-07 11:42:13 -04:00
François Blondel 93e2be73ec check if the env is set 2018-03-21 10:55:33 +01:00
François Blondel 85198de04f Add Env Var to use an external configuration storage 2018-03-19 18:54:33 +01:00
Isaac Bennetch b024df6c3c Update to 4.7.9
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-03-05 13:21:16 -05:00
Isaac Bennetch ffedad4cdf Update to 4.7.8
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2018-02-20 14:29:01 -05:00
J0WI c5d83d0fba Enhance build caching 2018-02-13 03:35:25 +01:00
J0WI d5f2f27d37 Fetch GnuPG key from keyserver 2018-02-13 03:35:06 +01:00
Michal Čihař d53771b561 Bring back original SQL lookup
Issue #144

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-02-12 14:48:40 +01:00
Michal Čihař 3bd49fb1ef Avoid using tabs
Issue #144

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-02-12 14:47:37 +01:00
Michal Čihař d9236dfdad Merge remote-tracking branch 'origin/pull/144' 2018-02-12 14:47:07 +01:00
Michal Čihař 5e02108932 Increase fastcgi buffers
phpMyAdmin is sometimes manipulating with too many cookies to fit into
standard buffer.

Fixes #147

Signed-off-by: Michal Čihař <michal@cihar.com>
2018-02-12 14:36:08 +01:00
J0WI 3a01bacb26 Keep old path for local testing 2018-02-10 14:22:18 +01:00
J0WI c09ec0fda8 Adjust paths for tests 2018-01-03 15:15:35 +01:00
J0WI 621e3ad755 Upgrade Alpine and PHP version 2018-01-02 23:56:58 +01:00
J0WIandJ0WI c03fa82b56 Use upstream PHP FPM Alpine Docker image 2018-01-02 23:56:11 +01:00
Michal ČihařandGitHub f5644c53c8 Merge pull request #145 from nijel/alpine-3.7
Update to Alpine 3.7
2018-01-02 11:20:05 +01:00
Michal Čihař 45873ade6a Update to Alpine 3.7
Signed-off-by: Michal Čihař <michal@cihar.com>
2018-01-02 11:10:15 +01:00
Isaac Bennetch 7aa164f6e1 Update to 4.7.7
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-12-23 09:40:30 -05:00
Michal Čihař c086bcea60 Remove no longer used configuration
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-12-14 10:54:36 +01:00
Michal Čihař 885eb78b98 Set $i to last used server in configuration
This makes it easier to adjust it in config.user.inc.php.

Fixes #142

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-12-14 10:50:21 +01:00
Isaac Bennetch 686bf94364 Update to 4.7.6
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-11-30 22:37:35 -05:00
Michal ČihařandGitHub ade6f52350 Merge pull request #140 from kujiy/master
Added description of `PMA_PORTS`
2017-11-20 09:42:24 +01:00
KujiyandGitHub c29aadee1b Added description of PMA_PORTS 2017-11-20 14:30:46 +09:00
Isaac Bennetch 30857caf5c Update for phpMyAdmin 4.7.5
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-10-23 09:33:39 -04:00
Michal Čihař 2c92dfa55c Add configuration for Probot Stale
See https://github.com/probot/stale/

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-09-05 13:56:56 +02:00
Michal Čihař a576282372 Update to Alpine linux 3.6
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-09-05 13:55:59 +02:00
Isaac Bennetch c4abbbaa35 Update to 4.7.4
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-08-24 19:30:29 -04:00
Michal Čihař 15e82b23d2 Update to 4.7.3
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-07-20 23:09:24 +02:00
Isaac Bennetch ff2edd1f87 Update Docker image to phpMyAdmin 4.7.2
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-06-29 15:35:37 -04:00
Michal Čihař 275b59e3dd Remove no longer needed ctype dependency
Fixes #115

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-06-19 12:42:05 +02:00
Michal ČihařandGitHub a18b6e3842 Merge pull request #128 from tomasliubinas/patch-1
Remove link to db container
2017-06-07 15:25:14 +02:00
Tomas LiubinasandGitHub 524e669ce9 Remove link to another container
You don't need linking to db container in case of arbitrary server
2017-06-07 16:09:49 +03:00
Isaac Bennetch 8884f19c18 Update Docker image to 4.7.1
Signed-off-by: Isaac Bennetch <bennetch@gmail.com>
2017-05-26 12:36:15 -04:00
Michal Čihař 1cfae7dbf6 Document new docker tags
We will build images based on snapshots as well.

Fixes #109

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-05-05 16:18:49 +02:00
Michal ČihařandGitHub 24fd978c91 Run Travis tests on Trusty (#123)
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-05-05 14:15:52 +02:00
Michal Čihař 77d49d4d88 Create directory for sessions
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-28 13:20:04 +02:00
Michal Čihař 76631a48de Remove VOLUME from Dockerfile
Fixes #117

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-28 12:06:14 +02:00
Michal Čihař 6f28900cf9 Increase fastcgi_read_timeout
Fixes #120

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-28 11:54:58 +02:00
Michal Čihař 3febe28134 Document 4.7 tag
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-11 17:33:56 +02:00
Michal Čihař 1bcaeb5fec Fix getting empty values from environment
If environemnt variable is empty and is not part of $_ENV, the getenv
(obviously) returns empty string, but we should use it.

Fixes #118

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-11 17:28:29 +02:00
Michal Čihař 1204bcd696 Do not set password to null when not specified
This makes the authentication code think this parameter was not set at
all.

Fixes #118

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-11 17:21:32 +02:00
ericfjosneandMichal Čihař 447c731aaa Add PMA_PORTS configuration
Now enabling custom port for each hosts of the PMA_HOSTS environment variable, through the use of a new PMA_PORTS environment variable.

Fixes #112
2017-04-07 15:24:36 +02:00
Michal Čihař 69a0e832d9 Install php7-ctype into the container
It is needed by Symfony ExpressionLanguage (which is used by
motranslator for plurals).

This can be reverted once ExpressionLanguage is fixed
https://github.com/symfony/symfony/pull/22325

Fixes #115

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-07 07:53:31 +02:00
Michal Čihař 0fb67d3437 Adjust cleanup to current releases
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-05 20:39:40 +02:00
Michal Čihař 331c3452f4 These files are no longer part of release
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-05 20:37:56 +02:00
Michal Čihař 942a0dd5ff Update to 4.7.0
Fixes #113

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-04-05 20:10:35 +02:00
Michal Čihař c76721ba8b Fix typo
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:18:16 +02:00
Michal Čihař 554e98df45 Add dabase server link to docker-compose
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:14:02 +02:00
Michal Čihař 5646cff98e Do not report retries
This is expected to take some time...

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:09:20 +02:00
Michal Čihař 382f9b9489 better progress reporting
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:07:27 +02:00
Michal Čihař 70b6297233 Fix path to testing configuration
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:02:09 +02:00
Michal Čihař 6314b17ebd Need more time to run tests
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 15:01:34 +02:00
Michal Čihař 63fd59434e Display logs on timeout
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 14:51:04 +02:00
Michal Čihař a2782dd8f6 Detect correct path to sql file
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 14:50:01 +02:00
Michal Čihař 61bc237761 Document this is supposed to fail right now
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 14:30:32 +02:00
Michal Čihař 6736b49f7a Fix expression calculation
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 14:27:00 +02:00
Michal Čihař b5305971ba Verify test result from docker-compose.testing.yml
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:38:35 +02:00
Michal Čihař 2ebc458766 Run pip installation while building Docker container
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:30:44 +02:00
Michal Čihař 21b0804166 Use latest images for composer testing as well
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:30:21 +02:00
Michal Čihař b35554203c Fix path to testing script
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:27:10 +02:00
Michal Čihař e5a78047b2 Move all testing files into subdirectory
This makes the file structure a bit cleaner.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:24:10 +02:00
Michal Čihař a7aa88b4c6 Specify correct server to test
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:18:09 +02:00
Michal Čihař b45585ea00 Remove trailing whitespace
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:12:31 +02:00
Michal Čihař 5d3536c381 Ignore testing dockerfile from docker
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:12:11 +02:00
Michal Čihař 24679b0c0b Run docker-compose tests in Travis
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:11:04 +02:00
Michal Čihař f5c3a1b628 Avoid using echo -e
It is not working on some /bin/sh versions and there is no reason to
enforce bash just because of this.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:08:37 +02:00
Michal Čihař d79872987d Avoid setting set -e
We are handling error codes, so we do not want script to terminate automatically

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:08:10 +02:00
Paulo LobatoandMichal Čihař ed5d9c5fc9 Provision local test env similar the CI's tests
- Run tests inside or not container
2017-03-28 11:06:54 +02:00
Michal Čihař 446ed9e0d0 Use separate Dockerfile for testing image
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-28 11:05:23 +02:00
Paulo LobatoandMichal Čihař 4ddc41bc29 Document the docker-compose test environment 2017-03-28 11:04:12 +02:00
Paulo LobatoandMichal Čihař ec28d93349 Add database containers on compose test env
- Add MariaDB 10.1 version
  - Add MySQL 5.7 version
  - Link databases to PHPMyAdmin container
2017-03-28 11:03:46 +02:00
Michal Čihař 0ac5c9516c Fix syntax errors
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:31:55 +01:00
Michal Čihař a1270dc0d5 Avoid using non ascii chars
This just makes the testing harder

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:26:18 +01:00
Michal Čihař 73ea59e04b Impove coding style
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:25:56 +01:00
Michal Čihař 54a5953b37 Mechanize does not support Python 3
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:11:01 +01:00
Michal Čihař d07907e15d Use python 3 for testing
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:08:40 +01:00
Michal Čihař e2f38b46ab Install html5lib needed for mechanize
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 11:02:12 +01:00
Michal Čihař cbcd23494f Generate password before using it
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 10:59:03 +01:00
Michal Čihař 4432177a0a Generate random passwords for test
This way nobody will think there is anything secret in the
.travis.yml.

See https://github.com/phpmyadmin/phpmyadmin/issues/13115

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-22 10:34:03 +01:00
Michal Čihař e2052a2066 Enable opcache fast shutdown
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-02 09:54:30 +01:00
Michal Čihař 6e3955516f Disable opcache.use_cwd
All scripts are executed in single working directory, so it should not
cause any harm and according to documentation it should perform better.

Issue #98

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-02 09:45:40 +01:00
Michal Čihař 29d69f34ad Disable opcache API
By setting non existing path as restrict_api.

Fixes #65

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-02 09:44:13 +01:00
Michal Čihař ddfe8e2b1c Update php.ini
Update to match php.ini-production from PHP 7.0.

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-02 09:40:43 +01:00
Michal Čihař facd453fc2 Disable allow_url_fopen
Fixes #55

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-03-02 09:27:46 +01:00
Michal Čihař b4d05f2604 Update to 4.6
Fixes #105

Signed-off-by: Michal Čihař <michal@cihar.com>
2017-02-06 11:24:11 +01:00
Michal ČihařandGitHub ff50a29234 Merge pull request #102 from nijel/alpine-3.5
Upgrade to Alpine 3.5
2017-01-02 17:14:57 +01:00
Michal Čihař e943ff30d0 Merge remote-tracking branch 'origin/pull/94' into alpine-3.5 2017-01-02 17:00:46 +01:00
Michal Čihař 19a74cb25f Fix program name
Signed-off-by: Michal Čihař <michal@cihar.com>
2017-01-02 16:56:07 +01:00
Michal Čihař a9cce1d72c Upgrade to Alpine 3.5
Also switch to PHP 7

Fixes #34

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-22 19:41:50 +01:00
Michal Čihař 4bc799bdb4 Fix markup
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-06 11:20:27 +01:00
Michal Čihař cc3e874181 Document hub tags
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-06 11:19:29 +01:00
Michal Čihař ba761c1841 Update to 4.6.5.2
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-06 09:03:57 +01:00
Michal Čihař d67fafa56c Remove not needed dependency on ctype
Fixes #96

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-12-05 08:41:19 +01:00
Michal Čihař bca3574cf3 Use absolute path here
Issue #95

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-30 11:34:21 +01:00
Michal Čihař c5c62ee24b Create secret and user configs in /etc/phpmyadmin
Fixes #95

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-30 11:17:43 +01:00
Michal Čihař 78f2603e29 Remove more not needed doc files
Fixes #79

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-30 11:16:40 +01:00
Michal Čihař 0715366ee3 Add version label
Issue #85

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-28 16:39:38 +01:00
Sam Mousa a4dc5b36cd Added some missing php extensions. 2016-11-28 10:48:41 +01:00
Sam Mousa f626ed635b Updated to use alpine edge and php7. 2016-11-28 10:40:43 +01:00
Michal Čihař 2a761b2a73 Increase upload size limit to 512MB
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-28 10:39:25 +01:00
Michal ČihařandGitHub f544b5ca97 Merge pull request #92 from nijel/master
Try to reorder commands for better Docker layer caching
2016-11-28 10:23:19 +01:00
Michal ČihařandGitHub d53aadc0bb Merge pull request #93 from nijel/doc-cleanup
Cleanup documentation folder
2016-11-28 10:23:12 +01:00
Michal Čihař f581555bcf Move all configuration to /etc
* configuration is now in /etc
* reorder commands for better Docker layer caching

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-28 10:19:52 +01:00
Michal Čihař 5cef68749a Cleanup documentation folder
We really do not need documentation source in the Docker image.

Fixes #79

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-28 10:12:56 +01:00
Michal ČihařandGitHub 6c1410cbef Merge pull request #91 from nijel/master
Split setting variable from export
2016-11-28 09:37:14 +01:00
Michal Čihař 352e5fe6ed Split setting variable from export
This way we can correctly get error from the mkdir.

Fixes #86

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-28 09:31:58 +01:00
Michal ČihařandGitHub c81443abd1 Merge pull request #90 from vancepym/patch-1
Bump version to 4.6.5.1
2016-11-28 09:29:51 +01:00
vancepymandGitHub 7177389b20 Bump version to 4.6.5.1 2016-11-28 13:35:17 +08:00
Michal ČihařandGitHub 3142368a07 Merge pull request #89 from asolopovas/patch-1
Cancel removal of /www/sql
2016-11-25 15:23:28 +01:00
Andrius SolopovasandGitHub a017968642 Cancel removal of /www/sql
Please do not delete /www/sql folder as it contains create_tables.sql file that creates pma tables and phpmyadmin db for configuration storage
2016-11-24 21:45:58 +00:00
Michal Čihař 9b115208c7 Simplify password generating
- remove not needed cat, this makes it consume less entropy due to less
  buffering
- use $() instead of `` in shell

Fixes #78

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-21 16:09:28 +01:00
Michal Čihař 2e371a1cb5 Simplify expression evaluation
Issue #87

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-21 16:07:48 +01:00
Michal Čihař af486daba0 Add quotes around parameters
Issue #87

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-21 16:07:45 +01:00
Michal Čihař a53f732a77 Use URL variable instead of hardcoding it
Issue #87

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-11-21 16:07:42 +01:00
Michal Čihař 50f822a1c9 Remove more not needed files
Fixes #78

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-25 10:45:00 +02:00
Michal Čihař 101ce17f0d Document where to report issues
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 13:14:37 +02:00
Michal ČihařandGitHub f9c263baf2 Merge pull request #77 from nijel/nginx-setup
Improve nginx setup
2016-10-18 13:07:18 +02:00
Michal ČihařandGitHub 71bf1edde3 Merge pull request #74 from nijel/userconfig
Fix user configuration and add tests for it
2016-10-18 13:03:57 +02:00
Michal Čihař 29bcc43956 Allow only GET, HEAD and POST methods
Fixes #64

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 13:03:27 +02:00
Michal Čihař 379a7df699 Avoid extending try_files too much
Fixes #63

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 13:03:27 +02:00
Michal Čihař ab9d56ffc1 Deny access to all hidden files
Fixes #67

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 13:03:27 +02:00
Michal ČihařandGitHub e3abc1a5bd Merge pull request #76 from nijel/php-name
Avoid encoding PHP version in socket or log name
2016-10-18 12:58:12 +02:00
Michal ČihařandGitHub 1807d08963 Merge pull request #75 from nijel/opcache
Optimize PHP opcache settings
2016-10-18 12:56:39 +02:00
Michal Čihař a4ddcb67ce Add tests for user configuration override
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 12:55:53 +02:00
Michal Čihař b2c5075876 Avoid encoding PHP version in socket or log name
Fixes #68

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 12:39:18 +02:00
Michal Čihař 9ddd36cd25 Optimize PHP opcache settings
- opcache.save_comments=0 to avoid storing comments which we do not need
- opcache.validate_timestamps=0 the timestamps validation should not be
  needed as container is restarted on change
- fixes #71

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 12:33:58 +02:00
Michal Čihař 6ab1e50550 Limit waiting for container to come up
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 12:26:41 +02:00
Michal Čihař cd02b8d305 Move config.user.inc.php to /www
It needs to be stored in a location allowed by open_basedir.

Fixes #73

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-10-18 12:09:58 +02:00
Michal ČihařandGitHub 465ecb08b3 Merge pull request #72 from asosso/master
Adding PMA_VERBOSE and PMA_VERBOSES environment variables
2016-10-04 16:19:38 +02:00
Andrea Sosso 07afa363d7 Adding PMA_VERBOSE and PMA_VERBOSES environment variables 2016-10-04 15:25:13 +02:00
Michal Čihař 8a3544a20a Reduce supervisor loglevel
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-27 09:18:08 +02:00
Michal Čihař 0a9d050db1 Allow access to /tmp
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 10:01:33 +02:00
Michal Čihař edce528acc Can not use armored PGP for keyring
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:25:18 +02:00
Michal Čihař 7b9abff0ff Deny access to libraries and templates
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:18:00 +02:00
Michal Čihař ad4b811c44 Set loglevel for PHP-FPM
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:15:27 +02:00
Michal Čihař 0fd626c1f6 Enable open_basedir in PHP
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:15:15 +02:00
Michal Čihař e415b21140 Make listen mode more secure
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:03:12 +02:00
Michal Čihař d935ec82f8 Include only Isaac's key for verification
There is no need to have all the keys here.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-26 09:01:51 +02:00
Michal Čihař fc12c997ef Allow to specify verbose names
Fixes #54

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 09:55:02 +02:00
Michal Čihař 55a4594325 Fix path name
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 09:40:13 +02:00
Michal Čihař 90551173a8 Use https links
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 09:08:01 +02:00
Michal Čihař b3eb5ffd23 Use SHA-1 for session hash
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 08:50:17 +02:00
Michal Čihař 3554ecfe19 Do not expose nginx version
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 08:49:34 +02:00
Michal Čihař 000827ba7a Move version we have requested
This makes the code easier to understand and avoids possible MITM on
download to push older version.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-22 08:45:21 +02:00
Michal Čihař 0ba8cd2bc8 Add missing find -exec separator
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 13:20:44 +02:00
Michal Čihař f7319feabf Fix line breaks
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 13:14:06 +02:00
Michal Čihař ab8caa4dd7 Adjust permissions of /www
Issue #52

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 13:01:26 +02:00
Michal Čihař 8c13128da9 Correctly prepare log for FPM
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 12:07:58 +02:00
Michal Čihař df1677c26e Display supervisor log on error
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 12:01:08 +02:00
Michal Čihař dc56655368 Move PHP socket
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 11:56:05 +02:00
Michal Čihař 8496f8fd25 Start PHP-FPM as nobody
Issue #52

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 11:47:42 +02:00
Michal Čihař e2a6eb627e List processes at the end of test
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-20 11:41:33 +02:00
Michal Čihař 233e07cd7b Be less strict on version
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-16 13:10:31 +02:00
Michal Čihař bae2c00e12 State which Alpine version to use
The package names could change (as did in past with php) so let's
specify exact version.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-16 12:32:33 +02:00
Michal Čihař 8fd34e6581 Add docker layers badge
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-09-01 12:46:56 +02:00
Michal Čihař 63557d61e9 Revert "Remove not used files from packages"
This reverts commit 38e99339ce.

It seams to break startup and does not really save anything reasonable.
2016-08-29 11:52:36 +02:00
Michal Čihař bac44a4dbb Ignore test files for docker
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:58:20 +02:00
Michal Čihař f5fb1e42f9 Increase upload_max_filesize to be in sync with other settings
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:54:30 +02:00
Michal Čihař 38e99339ce Remove not used files from packages
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:51:35 +02:00
Michal Čihař 961aa4ce9a Remove not needed cleanup
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:45:28 +02:00
Michal Čihař fa5c90cae4 Remove php cli, we do not need it
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:40:07 +02:00
Michal Čihař 923f581fa9 Remove openlayers source from the image as well
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:35:52 +02:00
Michal Čihař 9a78cb3d33 Better cleanup of produced image
- remove setup script
- remove tests
- remove SQL scripts

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:32:39 +02:00
Michal Čihař 23b9a14189 Remove no longer used variables
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 10:16:02 +02:00
Michal Čihař 341bc4965d Simplify tests
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:52:49 +02:00
Michal Čihař d6060e96b5 More verbose reporting in case of error
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:41:40 +02:00
Michal Čihař 454dfd47ed Select import form by name
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:35:35 +02:00
Michal Čihař 47eaf4cb6d Add test for arbitrary server on docker-compose
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:33:33 +02:00
Michal Čihař b80eea10a2 Do not try to use arbitrary server when not enabled
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:32:52 +02:00
Michal Čihař f6ae557f95 Igore robots.txt while testing
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:29:45 +02:00
Michal Čihař d5895311c0 Fix params, correctly handle error
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:23:08 +02:00
Michal Čihař 1c0936f359 Improve server testing
- Use python-mechanize based script
- Test file upload as well

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 09:17:35 +02:00
Michal Čihař cc72b8a432 Really test that arbitrary server settings works
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:18:03 +02:00
Michal Čihař 5acaf20477 Whitespace cleanup in nginx configuration
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:13:54 +02:00
Michal Čihař 7f07a54e26 Configure temp file for bigger uploads
Issue #32

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:13:16 +02:00
Michal Čihař 4b12fdda7c Disable fastcgi buffering
We can immedieately send out fastcgi response.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:11:48 +02:00
Michal Čihař 0ffb4af4c4 Increase maximal execution time
- This is needed to allow big SQL uploads.
- Also keep in sync nginx and PHP limit.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:06:29 +02:00
Michal Čihař a76914f87d Increase nginx buffers and maximal request size
We can expect people posting big SQL files, so let's allow 128M.

Issue #32

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-29 08:05:12 +02:00
Michal Čihař 0c3251bf9e Disable environment cleanup on PHP FPM
We pass settings by environment, so it has to be preserved.

Fixes #49

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 19:21:40 +02:00
Michal Čihař 8bec114378 Adjust description to match current setup
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:21:52 +02:00
Michal Čihař d6be2b9f1a Fix syntax
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:12:39 +02:00
Michal Čihař 32d4928e0a Always test against latest versions of databases
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:11:52 +02:00
Michal Čihař 978bdb4b25 Display logs only on error
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:09:40 +02:00
Michal Čihař 5b5edcafb1 Remove debugging code
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:08:17 +02:00
Michal Čihař d784d12452 Fix permissions on start
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 10:02:57 +02:00
Michal Čihař 84493eb5e4 Fix sessions permissions
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 09:54:34 +02:00
Michal Čihař 91b5bd0fcd Merge branch 'nginx' 2016-08-28 09:47:36 +02:00
Michal Čihař a1c139f901 Debug failures
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 09:47:09 +02:00
Michal ČihařandGitHub 507105ec70 Merge pull request #48 from nijel/nginx
Use supervisor +  nginx + php-fpm
2016-08-28 09:18:28 +02:00
Michal Čihař feb1c92581 Remove debugging settings
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 09:17:59 +02:00
Michal Čihař d12c0493ee Improve sessions configuration
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 09:10:37 +02:00
Michal Čihař 00ff178fd1 Add php.ini configuration file
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-28 09:09:03 +02:00
Michal Čihař b611c5adde Display logs at the end of test
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-27 13:29:48 +02:00
Michal Čihař 1b2ff90941 Better name for docker-compose
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-27 13:24:55 +02:00
Michal Čihař 5cb63716a7 Move tests to separate script
We repeat same for every container anyway.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-27 13:24:55 +02:00
Michal Čihař d70630f09a Initial attempt to use nginx + php-fpm
Replaced php built in server with supervisord + nginx + php-fpm.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-27 13:24:55 +02:00
Michal Čihař 9e0529c6f5 Revert "Remove PMA_ABSOLUTE_URI as it is no longer needed with 4.6"
This reverts commit 812590e038.

Fixes #40

Please note that the setting will take no effect till phpMyAdmin 4.6.5.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-17 15:43:28 +02:00
Michal Čihař e7d5c0f075 Add comments to Dockerfile
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-17 11:00:34 +02:00
Michal Čihař 690acf54dd Document what credentials are used, it seems to be common problem of users
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-17 10:36:42 +02:00
51 changed files with 9235 additions and 181 deletions
-6
View File
@@ -1,6 +0,0 @@
.travis.yml
docker-compose.yml
docker-compose.testing.yml
README.md
LICENSE
Makefile
+1
View File
@@ -0,0 +1 @@
*.sql linguist-detectable=false
+51
View File
@@ -0,0 +1,51 @@
name: GitHub CI
permissions:
contents: read
on:
pull_request:
push:
schedule:
- cron: 0 0 * * 0
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
jobs:
generate-jobs:
name: Generate Jobs
runs-on: ubuntu-latest
outputs:
strategy: ${{ steps.generate-jobs.outputs.strategy }}
steps:
- uses: actions/checkout@v4
- uses: docker-library/bashbrew@v0.1.12
- id: generate-jobs
name: Generate Jobs
run: |
strategy="$(GITHUB_REPOSITORY=phpmyadmin "$BASHBREW_SCRIPTS/github-actions/generate.sh")"
echo "strategy=$strategy" >> "$GITHUB_OUTPUT"
jq . <<<"$strategy" # sanity check / debugging aid
test:
needs: generate-jobs
strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }}
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Prepare Environment
run: ${{ matrix.runs.prepare }}
- name: Pull Dependencies
run: ${{ matrix.runs.pull }}
- name: Build ${{ matrix.name }}
run: ${{ matrix.runs.build }}
- name: History ${{ matrix.name }}
run: ${{ matrix.runs.history }}
- name: Test ${{ matrix.name }}
run: ${{ matrix.runs.test }}
- name: '"docker images"'
run: ${{ matrix.runs.images }}
+73
View File
@@ -0,0 +1,73 @@
name: Internal test suite
permissions:
contents: read
on:
pull_request:
push:
jobs:
test-apache-container:
name: Test (${{ matrix.configuration }}) on database ${{ matrix.database-image }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
database-image: [
"mariadb:10.6",
"mariadb:10.11",
"mariadb:11.4",
"mariadb:latest",
"mysql:5.7",
"mysql:8.4",
"mysql:latest"
]
configuration: [
"default",
"one-host",
"one-socket-host",
"config-mount-dir",
"fs-import-export",
"different-apache-port",
"run-as-www-data"
]
include:
- {
database-image: "mariadb:10.6",
configuration: "one-ssl-host"
}
- {
database-image: "mariadb:10.11",
configuration: "one-ssl-host"
}
- {
database-image: "mariadb:11.4",
configuration: "one-ssl-host"
}
- {
database-image: "mariadb:latest",
configuration: "one-ssl-host"
}
steps:
- uses: actions/checkout@v4
- name: Generate the testing keys
if: ${{ contains(matrix.configuration, 'one-ssl-host') }}
run: ./testing/generate-keys.sh
- name: Switch to MySQL compatible ENVs
if: ${{ contains(matrix.database-image, 'mysql') }}
working-directory: ./testing/docker-compose/
run: sed -i 's/MARIADB_ROOT_PASSWORD/MYSQL_ROOT_PASSWORD/' ./docker-compose.testing-${{ matrix.configuration }}.yml
- name: Switch to MySQL compatible healthcheck
if: ${{ contains(matrix.database-image, 'mysql') }}
working-directory: ./testing/docker-compose/
run: sed -i 's/mariadb-admin/mysqladmin/' ./docker-compose.testing-${{ matrix.configuration }}.yml
- name: Build images
working-directory: ./testing/
run: docker compose -f ./docker-compose/docker-compose.testing-${{ matrix.configuration }}.yml build
- name: Run ${{ matrix.configuration }} tests
working-directory: ./testing/
run: docker compose -f ./docker-compose/docker-compose.testing-${{ matrix.configuration }}.yml up --build --abort-on-container-exit --exit-code-from=sut
env:
DB: ${{ matrix.database-image }}
+6
View File
@@ -1 +1,7 @@
config.secret.inc.php
__pycache__
.pytest_cache
.vscode
.history
.venv
testing/*.pem
-41
View File
@@ -1,41 +0,0 @@
sudo: required
services:
- docker
env:
matrix:
- DB=mysql:5.7
- DB=mariadb:10.0
before_install:
- docker run --name db_server -e MYSQL_ROOT_PASSWORD=my-secret-pw -d $DB
script:
# Build image
- docker build -t phpmyadmin/phpmyadmin .
# Test for single database
- docker run --name testadmin -d --link db_server:db -p 9090:80 phpmyadmin/phpmyadmin
- docker ps -a
- curl http://127.0.0.1:9090/ | grep -q input_password
- curl --cookie-jar /tmp/cj --location -d pma_username=root -d pma_password=my-secret-pw -d server=1 http://127.0.0.1:9090/ | grep -r 'db via TCP'
# Test for single database using env
- docker run --name envadmin -d --link db_server:db2 -e PMA_HOST=db2 -p 6060:80 phpmyadmin/phpmyadmin
- docker ps -a
- curl http://127.0.0.1:6060/ | grep -q input_password
- curl --cookie-jar /tmp/cj --location -d pma_username=root -d pma_password=my-secret-pw -d server=1 http://127.0.0.1:6060/ | grep -r 'db2 via TCP'
# Test for arbitrary database
- docker run --name arbitraryadmin -d --link db_server:db -e PMA_ARBITRARY=1 -p 7070:80 phpmyadmin/phpmyadmin
- docker ps -a
- curl http://127.0.0.1:7070/ | grep -q input_password
- curl --cookie-jar /tmp/cj --location -d pma_servername=db -d pma_username=root -d pma_password=my-secret-pw -d server=1 http://127.0.0.1:7070/ | grep -r 'db via TCP'
# Test docker-compose
- docker-compose up -d
- docker ps -a
- curl http://127.0.0.1:8080/ | grep -q input_password
- curl --cookie-jar /tmp/cj --location -d pma_servername=db -d pma_username=root -d pma_password=my-secret-pw -d server=1 http://127.0.0.1:8080/ | grep -r 'db via TCP'
- docker-compose stop
# Test session survives shutdown
- docker-compose up -d
- curl --cookie-jar /tmp/cj --location http://127.0.0.1:8080/ | grep -r 'db via TCP'
- docker-compose stop
+102
View File
@@ -0,0 +1,102 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [5.2.3.1] - 2025-10-08
- Remove leftover uploadprogress.tar.gz download after installation (#465)
## [5.2.3] - 2025-10-08
- Update to PHP 8.3
- Enable the `uploadprogress` extension
## [5.2.2] - 2025-01-21
- Add `TZ` env var to change PHP `date.timezone` (#133)
- Update to PHP 8.2 (#411)
- Add back a `/sessions` volume for sessions persistence (#399)
- Support adding custom configurations in `/etc/phpmyadmin/conf.d` (#401)
- Fix for Debian 12 issue (#416) that caused libraries for extensions to be uninstalled
- Add extension `bcmath` for 2nd factor authentication (#415)
- Refactor `update.sh` (#408)
- Enable remoteip mod for Apache (#434)
- Add support for `PMA_SSL` and `PMA_SSLS` to enable SSL connection (#441)
- Fixed looping through `$sockets` using the same index variable `$i` interferes with the last server id (#186)
- Add support for `PMA_SSL_VERIFY` and `PMA_SSL_VERIFIES` (#448)
- Add support for `PMA_SSL_CA` and `PMA_SSL_CAS` (#448)
- Add support for `PMA_SSL_CERT` and `PMA_SSL_CERTS` (#448)
- Add support for `PMA_SSL_KEY` and `PMA_SSL_KEYS` (#448)
- Also add `PMA_SSL_DIR` to define the dir where SSL files are generated for `_BASE64` prefixed variables
- Support `PMA_SSL_CA_BASE64` and `PMA_SSL_CAS_BASE64` as variables that contain the file contents (#448)
- Support `PMA_SSL_KEY_BASE64` and `PMA_SSL_KEYS_BASE64` as variables that contain the file contents (#448)
- Support `PMA_SSL_CERT_BASE64` and `PMA_SSL_CERTS_BASE64` as variables that contain the file contents (#448)
## [5.2.1] - 2023-02-08
- Move docker-compose test files into a folder
- Fix the section about E2E tests in `README.md`
- Support docker secrets from file for `PMA_USER` (#372)
- Support docker secrets from file for `PMA_CONTROLUSER` (#372)
- Support docker secrets from file for `PMA_CONTROLHOST` (#372)
- Allow a different Apache port with `APACHE_PORT` (#340)
- Add support for ENVs `PMA_UPLOADDIR` and `PMA_SAVEDIR` (#384)
- Fixed a bug with `APACHE_PORT` ENV on container restart (#381)
- Update to PHP 8.1 (#393)
- Add support for ENV `TZ`
## [5.1.4] - 2022-05-11
- Fix incorrect image tag name in `README.md`
## [5.1.2] - 2022-01-22
- Fix GPG keyservers in Dockerfiles
- Remove microbadger badges, it closed
- Improve the README file
- Fix add back composer.json and remove non needed source files (#345)
- Update to PHP 8.0 (#325)
## [5.1.1] - 2021-06-04
- Improve documentation
## [5.1.0] - 2021-02-24
- Set ini setting `max_input_vars = 10000`
- Add support for ENV `PMA_QUERYHISTORYMAX`
- Add support for ENV `MAX_EXECUTION_TIME`
- Add support for ENV `MEMORY_LIMIT`
- Move to GitHub actions
- Re-work the test system
- Support docker secrets from file for `PMA_CONTROLPASS`
- Generate phpmyadmin-misc.ini from ENVs
## [4.9.{6,7}] - 2020-10-{10,16} and [5.0.{3,4}] - 2020-10-{10,16}
- Add `tzdata` package
- Extract downloaded files directly to web root `/var/www/html/` (#277)
- Add SHA checksum when downloading a version
- Improved `UPLOAD_LIMIT` documentation
- Update documentation from `phpmyadmin/phpmyadmin` to `phpmyadmin`
- `phpmyadmin` is now the official image in the Docker official library
## [5.0.2] - 2020-03-21
- Add org.opencontainers.image.* labels
- Apply some feedback from docker-library team to Dockerfiles
## [4.9.3] - 2020-01-02 and [5.0.0] - 2019-12-26
- Add support for ENV `HIDE_PHP_VERSION` to set ini setting `expose_php = Off`
- Add support for ENV `UPLOAD_LIMIT` to set `upload_max_filesize` and `post_max_size` ini settings
- Add support for ENVs `PMA_CONFIG_BASE64` and `PMA_USER_CONFIG_BASE64` (#192)
- Support docker secrets from files for `PMA_PASSWORD`, `MYSQL_ROOT_PASSWORD` and `MYSQL_PASSWORD`
- Support docker secrets from files for `PMA_HOSTS` and `PMA_HOST`
## [4.9.2-2] - 2020-12-20
- Update to PHP 7.4 (#257)
- Drop ini setting `opcache.enable_cli=1`
-34
View File
@@ -1,34 +0,0 @@
FROM alpine:latest
RUN apk add --no-cache php5-cli php5-mysqli php5-ctype php5-xml php5-gd php5-zlib php5-bz2 php5-zip php5-openssl php5-curl php5-opcache php5-json
COPY phpmyadmin.keyring /
ENV VERSION 4.6.4
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.gz
RUN set -x \
&& export GNUPGHOME="$(mktemp -d)" \
&& apk add --no-cache curl gnupg \
&& curl --output phpMyAdmin.tar.gz --location $URL \
&& curl --output phpMyAdmin.tar.gz.asc --location $URL.asc \
&& gpgv --keyring /phpmyadmin.keyring phpMyAdmin.tar.gz.asc phpMyAdmin.tar.gz \
&& apk del --no-cache curl gnupg \
&& rm -rf "$GNUPGHOME" \
&& tar xzf phpMyAdmin.tar.gz \
&& rm -f phpMyAdmin.tar.gz phpMyAdmin.tar.gz.asc \
&& mv phpMyAdmin* /www \
&& rm -rf /www/js/jquery/src/ /www/examples /www/po/
COPY config.inc.php /www/
COPY run.sh /run.sh
RUN chmod u+rwx /run.sh
VOLUME /sessions
EXPOSE 80
ENV PHP_UPLOAD_MAX_FILESIZE=64M \
PHP_MAX_INPUT_VARS=2000
ENTRYPOINT [ "/run.sh" ]
+145
View File
@@ -0,0 +1,145 @@
FROM php:%%PHP_VERSION%%-%%VARIANT%%
ENV UPLOAD_PROGRESS_EXT_URL="https://github.com/php/pecl-php-uploadprogress/archive/refs/tags/uploadprogress-2.0.2.tar.gz"
ENV UPLOAD_PROGRESS_SHA256="fe3f6cdfcedad563c970c4fd1cda31e422cfc0df5cc9a217d8c80ed3c8d137f5"
# install and docker-entrypoint.sh dependencies
RUN apk add --no-cache \
bash \
tzdata \
gnupg
# Install dependencies
RUN set -ex; \
\
apk add --no-cache --virtual .build-deps \
bzip2-dev \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
; \
\
mkdir -p /tmp/uploadprogress; \
curl -fsSL -o /tmp/uploadprogress/uploadprogress.tar.gz "$UPLOAD_PROGRESS_EXT_URL"; \
echo "$UPLOAD_PROGRESS_SHA256 /tmp/uploadprogress/uploadprogress.tar.gz" | sha256sum -c -; \
tar -xf /tmp/uploadprogress/uploadprogress.tar.gz -C /tmp/uploadprogress --strip-components=1; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
docker-php-ext-install -j "$(nproc)" \
bz2 \
gd \
mysqli \
opcache \
zip \
bcmath \
/tmp/uploadprogress \
; \
\
rm -r /tmp/uploadprogress; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --no-network --virtual .phpmyadmin-phpexts-rundeps $runDeps; \
apk del --no-network .build-deps
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
ENV PMA_SSL_DIR=/etc/phpmyadmin/ssl
ENV MAX_EXECUTION_TIME=600
ENV MEMORY_LIMIT=512M
ENV UPLOAD_LIMIT=2048K
ENV TZ=UTC
ENV SESSION_SAVE_PATH=/sessions
RUN set -ex; \
mkdir $SESSION_SAVE_PATH; \
mkdir -p $PMA_SSL_DIR; \
chmod 1777 $SESSION_SAVE_PATH; \
chmod 755 $PMA_SSL_DIR; \
chown www-data:www-data /etc/phpmyadmin; \
chown www-data:www-data $PMA_SSL_DIR; \
chown www-data:www-data $SESSION_SAVE_PATH; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen=Off'; \
echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
echo 'max_input_vars=10000'; \
echo 'memory_limit=${MEMORY_LIMIT}'; \
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
USER www-data:www-data
# Calculate download URL
ENV VERSION=%%VERSION%%
ENV SHA256=%%SHA256%%
ENV URL=https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="%%GPG_KEY%%"; \
curl -fsSL -o phpMyAdmin.tar.xz $URL; \
curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.openpgp.org --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
mkdir -p /var/www/html/tmp; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -r -v /var/www/html/setup/ /var/www/html/examples/ /var/www/html/js/src/ /var/www/html/babel.config.json /var/www/html/doc/html/_sources/ /var/www/html/RELEASE-DATE-$VERSION /var/www/html/CONTRIBUTING.md; \
grep -q -F "'configFile' => ROOT_PATH . 'config.inc.php'," /var/www/html/libraries/vendor_config.php; \
sed -i "s@'configFile' => .*@'configFile' => '/etc/phpmyadmin/config.inc.php',@" /var/www/html/libraries/vendor_config.php; \
grep -q -F "'configFile' => '/etc/phpmyadmin/config.inc.php'," /var/www/html/libraries/vendor_config.php; \
php -l /var/www/html/libraries/vendor_config.php; \
find /var/www/html -type d -exec chmod 555 {} \;; \
find /var/www/html -type f -exec chmod 444 {} \;; \
chmod 1777 /var/www/html/tmp;
# Copy configuration
COPY --chown=www-data:www-data config.inc.php /etc/phpmyadmin/config.inc.php
COPY --chown=www-data:www-data helpers.php /etc/phpmyadmin/helpers.php
# Copy main script
COPY docker-entrypoint.sh /docker-entrypoint.sh
USER root
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["%%CMD%%"]
+159
View File
@@ -0,0 +1,159 @@
FROM php:%%PHP_VERSION%%-%%VARIANT%%
ENV UPLOAD_PROGRESS_EXT_URL="https://github.com/php/pecl-php-uploadprogress/archive/refs/tags/uploadprogress-2.0.2.tar.gz"
ENV UPLOAD_PROGRESS_SHA256="fe3f6cdfcedad563c970c4fd1cda31e422cfc0df5cc9a217d8c80ed3c8d137f5"
# Install dependencies
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
gnupg \
dirmngr \
; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get install -y --no-install-recommends \
libbz2-dev \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
; \
\
mkdir -p /tmp/uploadprogress; \
curl -fsSL -o /tmp/uploadprogress/uploadprogress.tar.gz "$UPLOAD_PROGRESS_EXT_URL"; \
echo "$UPLOAD_PROGRESS_SHA256 /tmp/uploadprogress/uploadprogress.tar.gz" | sha256sum -c -; \
tar -xf /tmp/uploadprogress/uploadprogress.tar.gz -C /tmp/uploadprogress --strip-components=1; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
docker-php-ext-install -j "$(nproc)" \
bz2 \
gd \
mysqli \
opcache \
zip \
bcmath \
/tmp/uploadprogress \
; \
\
rm -r /tmp/uploadprogress; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
extdir="$(php -r 'echo ini_get("extension_dir");')"; \
ldd "$extdir"/*.so \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
# start: Apache specific build
a2enmod remoteip; \
# end: Apache specific build
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*; \
ldd "$extdir"/*.so | grep -qzv "=> not found" || (echo "Sanity check failed: missing libraries:"; ldd "$extdir"/*.so | grep " => not found"; exit 1); \
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1); \
err="$(php --version 3>&1 1>&2 2>&3)"; \
[ -z "$err" ] || (echo "Sanity check failed: php returned errors; $err"; exit 1;);
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
ENV PMA_SSL_DIR=/etc/phpmyadmin/ssl
ENV MAX_EXECUTION_TIME=600
ENV MEMORY_LIMIT=512M
ENV UPLOAD_LIMIT=2048K
ENV TZ=UTC
ENV SESSION_SAVE_PATH=/sessions
RUN set -ex; \
mkdir $SESSION_SAVE_PATH; \
mkdir -p $PMA_SSL_DIR; \
chmod 1777 $SESSION_SAVE_PATH; \
chmod 755 $PMA_SSL_DIR; \
chown www-data:www-data /etc/phpmyadmin; \
chown www-data:www-data $PMA_SSL_DIR; \
chown www-data:www-data $SESSION_SAVE_PATH; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen=Off'; \
echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
echo 'max_input_vars=10000'; \
echo 'memory_limit=${MEMORY_LIMIT}'; \
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
USER www-data:www-data
# Calculate download URL
ENV VERSION=%%VERSION%%
ENV SHA256=%%SHA256%%
ENV URL=https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="%%GPG_KEY%%"; \
curl -fsSL -o phpMyAdmin.tar.xz $URL; \
curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.openpgp.org --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
mkdir -p /var/www/html/tmp; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -r -v /var/www/html/setup/ /var/www/html/examples/ /var/www/html/js/src/ /var/www/html/babel.config.json /var/www/html/doc/html/_sources/ /var/www/html/RELEASE-DATE-$VERSION /var/www/html/CONTRIBUTING.md; \
grep -q -F "'configFile' => ROOT_PATH . 'config.inc.php'," /var/www/html/libraries/vendor_config.php; \
sed -i "s@'configFile' => .*@'configFile' => '/etc/phpmyadmin/config.inc.php',@" /var/www/html/libraries/vendor_config.php; \
grep -q -F "'configFile' => '/etc/phpmyadmin/config.inc.php'," /var/www/html/libraries/vendor_config.php; \
php -l /var/www/html/libraries/vendor_config.php; \
find /var/www/html -type d -exec chmod 555 {} \;; \
find /var/www/html -type f -exec chmod 444 {} \;; \
chmod 1777 /var/www/html/tmp;
# Copy configuration
COPY --chown=www-data:www-data config.inc.php /etc/phpmyadmin/config.inc.php
COPY --chown=www-data:www-data helpers.php /etc/phpmyadmin/helpers.php
# Copy main script
COPY docker-entrypoint.sh /docker-entrypoint.sh
USER root
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["%%CMD%%"]
+21 -10
View File
@@ -1,28 +1,39 @@
DOCKER_REPO = phpmyadmin/phpmyadmin
DOCKER_REPO = phpmyadmin
.PHONY: all build build_nc run logs clean stop rm prune
.PHONY: all build run logs clean stop rm prune
all: build run logs
build:
docker build -t ${DOCKER_REPO}:testing .
build: build-apache build-fpm build-fpm-alpine
build_nc:
docker build --no-cache=true -t ${DOCKER_REPO}:testing .
build-apache:
docker build ${DOCKER_FLAGS} -t ${DOCKER_REPO}:testing apache
build-fpm:
docker build ${DOCKER_FLAGS} -t ${DOCKER_REPO}:testing-fpm fpm
build-fpm-alpine:
docker build ${DOCKER_FLAGS} -t ${DOCKER_REPO}:testing-fpm-alpine fpm-alpine
run:
docker-compose -f docker-compose.testing.yml up -d
docker compose -f ./testing/docker-compose/docker-compose.testing-default.yml up -d
testing-%:
docker compose -p "phpmyadmin_$@" -f ./testing/docker-compose/docker-compose.$@.yml up --build --abort-on-container-exit --exit-code-from=sut
docker compose -p "phpmyadmin_$@" -f ./testing/docker-compose/docker-compose.$@.yml down
run-tests: testing-default testing-one-host testing-one-socket-host testing-config-mount-dir testing-fs-import-export testing-different-apache-port testing-run-as-www-data testing-one-ssl-host
logs:
docker-compose -f docker-compose.testing.yml logs
docker compose -f ./testing/docker-compose/docker-compose.testing-default.yml logs
clean: stop rm prune
stop:
docker-compose -f docker-compose.testing.yml stop
docker compose -f ./testing/docker-compose/docker-compose.testing-default.yml stop
rm:
docker-compose -f docker-compose.testing.yml rm
docker compose -f ./testing/docker-compose/docker-compose.testing-default.yml rm
prune:
docker rm `docker ps -q -a --filter status=exited`
+227 -41
View File
@@ -1,81 +1,267 @@
# Official phpMyAdmin Docker image
Run phpMyAdmin with Alpine and PHP built in web server.
Note that since phpMyAdmin has been accepted in to the [official DockerHub repository](https://hub.docker.com/_/phpmyadmin), you can use
either that or this older [phpMyAdmin repository](https://hub.docker.com/r/phpmyadmin/phpmyadmin/) for your Docker installation. This
is maintained as a courtesy to users who have not migrated.
[![Build Status](https://travis-ci.org/phpmyadmin/docker.svg?branch=master)](https://travis-ci.org/phpmyadmin/docker)
[![Docker Pulls](https://img.shields.io/docker/pulls/phpmyadmin/phpmyadmin.svg)][hub]
[![Docker Stars](https://img.shields.io/docker/stars/phpmyadmin/phpmyadmin.svg)][hub]
Run phpMyAdmin with Alpine, Apache and PHP FPM.
[![GitHub CI build status badge](https://github.com/phpmyadmin/docker/workflows/GitHub%20CI/badge.svg)](https://github.com/phpmyadmin/docker/actions?query=workflow%3A%22GitHub+CI%22)
[![update.sh build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/phpmyadmin.svg?label=Automated%20update.sh)](https://doi-janky.infosiftr.net/job/update.sh/job/phpmyadmin/)
[![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/phpmyadmin.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/phpmyadmin)
[![arm32v5 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/phpmyadmin.svg?label=arm32v5)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/phpmyadmin)
[![arm32v6 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/phpmyadmin.svg?label=arm32v6)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/phpmyadmin)
[![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/phpmyadmin.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/phpmyadmin)
[![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/phpmyadmin.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/phpmyadmin)
[![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/phpmyadmin.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/phpmyadmin)
[![mips64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/phpmyadmin.svg?label=mips64le)](https://doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/phpmyadmin)
[![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/phpmyadmin.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/phpmyadmin)
[![s390x build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/s390x/job/phpmyadmin.svg?label=s390x)](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/phpmyadmin)
[![Docker Pulls](https://img.shields.io/docker/pulls/_/phpmyadmin.svg)][hub]
[![Docker Stars](https://img.shields.io/docker/stars/_/phpmyadmin.svg)][hub]
All following examples will bring you phpMyAdmin on `http://localhost:8080`
All of the following examples will bring you phpMyAdmin on `http://localhost:8080`
where you can enjoy your happy MySQL administration.
## Credentials
phpMyAdmin connects using your MySQL server credentials. Please check your corresponding
database server image for information on the default username and password or how to specify your own custom credentials during installation.
The official MySQL and MariaDB images use the following environment variables to define these:
- `MYSQL_ROOT_PASSWORD` - This variable is mandatory and specifies the password that will be set for the `root` superuser account.
- `MYSQL_USER`, `MYSQL_PASSWORD` - These variables are optional, used in conjunction to create a new user and to set that user's password.
## Supported Docker Hub tags
The following tags are available:
- `latest`, `fpm`, and `fpm-alpine` are always the most recent released version
- Major versions, such as `5`, `5-fpm`, and `5-fpm-alpine`
- Specific minor versions, such as `5.0`, `5.0-fpm`, and `5-fpm-alpine`
- Specific patch versions, such as `5.0.0`, `5.0.0-fpm`, and `5.0.0-fpm-alpine`. Note that, on rare occasion, there may be an intermediary "docker-only" release, such as 4.9.2-1
A complete list of tags is [available at Docker Hub](https://hub.docker.com/_/phpmyadmin?tab=tags)
## Image variants
We provide three variations:
- "apache" includes a full Apache webserver with PHP and includes everything needed to work out of the box.
This is the default when only a version number is requested.
- "fpm" only starts a PHP FPM container. Use this variant if you already have a separate webserver.
This includes more tools and is therefore a larger image than the "fpm-alpine" variation.
- "fpm-alpine" has a very small footprint. It is based on Alpine Linux and only starts a PHP FPM process.
Use this variant if you already have a separate webserver. If you need more tools that are not available on Alpine Linux, use the fpm image instead.
## Usage with linked server
First you need to run MySQL or MariaDB server in Docker, and this image need
link a running mysql instance container:
First you need to run a MySQL or MariaDB server in Docker, and the phpMyAdmin image needs to be
linked to the running database container:
```
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 phpmyadmin/phpmyadmin
```sh
docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 phpmyadmin:latest
```
## Usage with external server
You can specify MySQL host in the `PMA_HOST` environment variable. You can also
use `PMA_PORT` to specify port of the server in case it's not the default one:
You can specify a MySQL host in the `PMA_HOST` environment variable. You can also
use `PMA_PORT` to specify the port of the server in case it's not the default one:
```
docker run --name myadmin -d -e PMA_HOST=dbhost -p 8080:80 phpmyadmin/phpmyadmin
```sh
docker run --name phpmyadmin -d -e PMA_HOST=dbhost -p 8080:80 phpmyadmin:latest
```
## Usage with arbitrary server
You can use arbitrary servers by adding ENV variable `PMA_ARBITRARY=1` to the startup command:
You can use arbitrary servers by adding the environment variable `PMA_ARBITRARY=1` to the startup command:
```
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 -e PMA_ARBITRARY=1 phpmyadmin/phpmyadmin
```sh
docker run --name phpmyadmin -d -e PMA_ARBITRARY=1 -p 8080:80 phpmyadmin:latest
```
## Usage with docker-compose and arbitrary server
## Usage with docker compose and an arbitrary server
This will run phpMyAdmin with arbitrary server - allowing you to specify MySQL/MariaDB
server on login page.
This will run phpMyAdmin with the arbitrary server option - allowing you to specify any MySQL/MariaDB
server on the login page.
Using the docker-compose.yml from https://github.com/phpmyadmin/docker
```yaml
version: '3.1'
```
docker-compose up -d
services:
db:
image: mariadb:10.11
restart: always
environment:
MYSQL_ROOT_PASSWORD: notSecureChangeMe
phpmyadmin:
image: phpmyadmin
restart: always
ports:
- 8080:80
environment:
- PMA_ARBITRARY=1
```
## Adding Custom Configuration
You can add your own custom config.inc.php settings (such as Configuration Storage setup)
by creating a file named "config.user.inc.php" with the various user defined settings
You can add your own custom config.inc.php settings (such as Configuration Storage setup)
by creating a file named `config.user.inc.php` with the various user defined settings
in it, and then linking it into the container using:
```
-v /some/local/directory/config.user.inc.php:/config.user.inc.php
```
On the "docker run" line like this:
```
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/config.user.inc.php:/config.user.inc.php phpmyadmin/phpmyadmin
```sh
-v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php
```
See the following links for config file information.
http://docs.phpmyadmin.net/en/latest/config.html#config
http://docs.phpmyadmin.net/en/latest/setup.html
On the `docker run` line like this:
```sh
docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php phpmyadmin:latest
```
Be sure to have `<?php` as your first line of the configuration file or the contents will not be detected as PHP code.
Example:
```php
<?php
$cfg['ShowPhpInfo'] = true; // Adds a link to phpinfo() on the home page
```
See the following links for config file information:
- https://docs.phpmyadmin.net/en/latest/config.html#config
- https://docs.phpmyadmin.net/en/latest/setup.html
## Adding custom configuration in `/etc/phpmyadmin/conf.d`
you can also consider storing your custom configuration files in the folder `/etc/phpmyadmin/conf.d`, which is very suitable for managing multiple phpMyAdmin configuration files for different hosts,Then you can create `server-1.php`, `server-2.php`, or any file name you want, and store them in the conf.d directory mounted on the host.
On the `docker run` line like this:
```sh
docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/conf.d:/etc/phpmyadmin/conf.d:ro phpmyadmin:latest
```
## Usage behind a reverse proxy
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
```
## Connect to the database over SSL
Set the variable ``PMA_SSL`` to `1` to enable SSL usage from phpMyAdmin to the MySQL server.
The default value is `0`.
The variable ``PMA_SSLS`` can be used as a comma seperated sequence of `0` and `1` where multiple hosts are mentioned.
Values order must follow the ``PMA_HOSTS`` and will be computed accordingly.
```sh
docker run --name phpmyadmin -d -e PMA_HOSTS=sslhost -e PMA_SSL=1 -p 8080:80 phpmyadmin:latest
```
```sh
docker run --name phpmyadmin -d -e PMA_HOSTS='sslhost,nosslhost' -e PMA_SSLS='1,0' -p 8080:80 phpmyadmin:latest
```
## Environment variables summary
* ``PMA_ARBITRARY`` - when set to 1 connection to the arbitrary server will be allowed
* ``PMA_HOST`` - define address/host name of the MySQL server
* ``PMA_PORT`` - define port of the MySQL server
* ``PMA_HOSTS`` - define comma separated list of address/host names of the MySQL servers
* ``PMA_USER`` and ``PMA_PASSWORD`` - define username to use for config authentication method
* ``PHP_UPLOAD_MAX_FILESIZE`` - define upload_max_filesize and post_max_size PHP settings
* ``PHP_MAX_INPUT_VARS`` - define max_input_vars PHP setting
- ``PMA_ARBITRARY`` - when set to 1 connection to the arbitrary server will be allowed
- ``PMA_HOST`` - define address/host name of the MySQL server
- ``PMA_VERBOSE`` - define verbose name of the MySQL server
- ``PMA_PORT`` - define port of the MySQL server
- ``PMA_HOSTS`` - define comma separated list of address/host names of the MySQL servers
- ``PMA_VERBOSES`` - define comma separated list of verbose names of the MySQL servers
- ``PMA_PORTS`` - define comma separated list of ports of the MySQL servers
- ``PMA_SOCKET`` - define socket file for the MySQL connection
- ``PMA_SOCKETS`` - define comma separated list of socket files for the MySQL connections
- ``PMA_SSL_DIR`` - define the path used for SSL files generated from environement variables, default value is `/etc/phpmyadmin/ssl`
- ``PMA_SSL`` - when set to 1, defines SSL usage for the MySQL connection
- ``PMA_SSLS`` - comma separated list of `0` and `1` defining SSL usage for the corresponding MySQL connections
- ``PMA_SSL_VERIFY`` - when set to 1, enables SSL certificate verification for the MySQL connection.
- ``PMA_SSL_VERIFIES`` - comma-separated list of `0` and `1` to enable or disable SSL certificate verification for multiple MySQL connections.
- ``PMA_SSL_CA`` - in the context of mutual TLS security, allows setting your CA certificate file as a string inside the default `config.inc.php`.
- ``PMA_SSL_CAS`` - in the context of mutual TLS security, allows setting multiple CA certificate files as a comma-separated list of strings inside the default `config.inc.php`.
- ``PMA_SSL_CERT`` - in the context of mutual TLS security, allows setting your certificate file as a string inside the default `config.inc.php`.
- ``PMA_SSL_CERTS`` - in the context of mutual TLS security, allows setting multiple certificate files as a comma-separated list of strings inside the default `config.inc.php`.
- ``PMA_SSL_KEY`` - in the context of mutual TLS security, allows setting your private key file as a string inside the default `config.inc.php`.
- ``PMA_SSL_KEYS`` - in the context of mutual TLS security, allows setting multiple private key files as a comma-separated list of strings inside the default `config.inc.php`.
- ``PMA_USER`` and ``PMA_PASSWORD`` - define username and password to use only with the `config` authentication method
- ``PMA_ABSOLUTE_URI`` - the full URL to phpMyAdmin. Sometimes needed when used in a reverse-proxy configuration. Don't set this unless needed. See [documentation](https://docs.phpmyadmin.net/en/latest/config.html#cfg_PmaAbsoluteUri).
- ``PMA_CONFIG_BASE64`` - if set, this option will override the default `config.inc.php` with the base64 decoded contents of the variable
- ``PMA_USER_CONFIG_BASE64`` - if set, this option will override the default `config.user.inc.php` with the base64 decoded contents of the variable
- ``PMA_UPLOADDIR`` - if defined, this option will set the path where files can be saved to be available to import ([$cfg['UploadDir']](https://docs.phpmyadmin.net/en/latest/config.html#cfg_UploadDir))
- ``PMA_SAVEDIR`` - if defined, this option will set the path where exported files can be saved ([$cfg['SaveDir']](https://docs.phpmyadmin.net/en/latest/config.html#cfg_SaveDir))
- ``PMA_CONTROLHOST`` - when set, this points to an alternate database host used for storing the [phpMyAdmin Configuration Storage database](https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage) database
- ``PMA_CONTROLPORT`` - if set, will override the default port (3306) for connecting to the control host for storing the [phpMyAdmin Configuration Storage database](https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage) database
- ``PMA_PMADB`` - define the name of the database to be used for the [phpMyAdmin Configuration Storage database](https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage). When not set, the advanced features are not enabled by default: they can still potentially be enabled by the user when logging in with the zero conf (zero configuration) feature. Suggested values: `phpmyadmin` or `pmadb`
- ``PMA_CONTROLUSER`` - define the username for phpMyAdmin to use for advanced features (the [controluser](https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_controluser))
- ``PMA_CONTROLPASS`` - define the password for phpMyAdmin to use with the [controluser](https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_controlpass)
- ``PMA_QUERYHISTORYDB`` - when set [to true](https://docs.phpmyadmin.net/en/latest/config.html#cfg_QueryHistoryDB), enables storing [SQL history](https://docs.phpmyadmin.net/en/latest/config.html#cfg_Servers_history) to the [phpMyAdmin Configuration Storage database](https://docs.phpmyadmin.net/en/latest/setup.html#phpmyadmin-configuration-storage). When [false](https://docs.phpmyadmin.net/en/latest/config.html#cfg_QueryHistoryDB), history is stored in the browser and is cleared when logging out
- ``PMA_QUERYHISTORYMAX`` - when set to an integer, controls the number of history items. See [documentation](https://docs.phpmyadmin.net/en/latest/config.html#cfg_QueryHistoryMax). Defaults to `25`.
- ``MAX_EXECUTION_TIME`` - if set, will override the maximum execution time in seconds (default 600) for phpMyAdmin ([$cfg['ExecTimeLimit']](https://docs.phpmyadmin.net/en/latest/config.html#cfg_ExecTimeLimit)) and PHP [max_execution_time](https://www.php.net/manual/en/info.configuration.php#ini.max-execution-time) (format as `[0-9+]`)
- ``MEMORY_LIMIT`` - if set, will override the memory limit (default 512M) for phpMyAdmin ([$cfg['MemoryLimit']](https://docs.phpmyadmin.net/en/latest/config.html#cfg_MemoryLimit)) and PHP [memory_limit](https://www.php.net/manual/en/ini.core.php#ini.memory-limit) (format as `[0-9+](K,M,G)` where K is for Kilobytes, M for Megabytes, G for Gigabytes and 1K = 1024 bytes)
- ``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)
- ``TZ`` - if defined, this option will change the default PHP `date.timezone` from `UTC`. See [documentation](https://www.php.net/manual/en/timezones.php) for supported values.
- ``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`).
- ``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`)
For usage with Docker secrets, appending ``_FILE`` to the ``PMA_PASSWORD`` environment variable is allowed (it overrides ``PMA_PASSWORD`` if it is set):
```sh
docker run --name phpmyadmin -d -e PMA_PASSWORD_FILE=/run/secrets/db_password.txt -p 8080:80 phpmyadmin:latest
```
#### Variables that can store the file contents using ``_BASE64``
- `PMA_SSL_CA`
- `PMA_SSL_CAS`
- `PMA_SSL_KEY`
- `PMA_SSL_KEYS`
- `PMA_SSL_CERT`
- `PMA_SSL_CERTS`
Also includes: `PMA_CONFIG_BASE64` or `PMA_USER_CONFIG_BASE64`.
For example, the variable would be named `PMA_SSL_CA_BASE64` and the value is the base64 encoded contents of the file.
#### Variables that can be read from a file using ``_FILE``
- `MYSQL_ROOT_PASSWORD`
- `MYSQL_PASSWORD`
- `PMA_USER`
- `PMA_PASSWORD`
- `PMA_HOSTS`
- `PMA_HOST`
- `PMA_CONTROLHOST`
- `PMA_CONTROLUSER`
- `PMA_CONTROLPASS`
## Run the E2E tests for this docker image
You can run the E2E test suite on a local test environment.
The Requirements are `make`, `docker` and the `docker compose` plugin.
Clone this repository: `https://github.com/phpmyadmin/docker.git`
And then run this command to start the test suite:
```sh
make run-tests
```
For more detailed documentation see https://docs.phpmyadmin.net/en/latest/setup.html#installing-using-docker
[hub]: https://hub.docker.com/r/phpmyadmin/phpmyadmin/
[hub]: https://hub.docker.com/_/phpmyadmin
Please report any issues with the Docker container to https://github.com/phpmyadmin/docker/issues
Please report any issues with phpMyAdmin to https://github.com/phpmyadmin/phpmyadmin/issues
+160
View File
@@ -0,0 +1,160 @@
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
FROM php:8.3-apache
ENV UPLOAD_PROGRESS_EXT_URL="https://github.com/php/pecl-php-uploadprogress/archive/refs/tags/uploadprogress-2.0.2.tar.gz"
ENV UPLOAD_PROGRESS_SHA256="fe3f6cdfcedad563c970c4fd1cda31e422cfc0df5cc9a217d8c80ed3c8d137f5"
# Install dependencies
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
gnupg \
dirmngr \
; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get install -y --no-install-recommends \
libbz2-dev \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
; \
\
mkdir -p /tmp/uploadprogress; \
curl -fsSL -o /tmp/uploadprogress/uploadprogress.tar.gz "$UPLOAD_PROGRESS_EXT_URL"; \
echo "$UPLOAD_PROGRESS_SHA256 /tmp/uploadprogress/uploadprogress.tar.gz" | sha256sum -c -; \
tar -xf /tmp/uploadprogress/uploadprogress.tar.gz -C /tmp/uploadprogress --strip-components=1; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
docker-php-ext-install -j "$(nproc)" \
bz2 \
gd \
mysqli \
opcache \
zip \
bcmath \
/tmp/uploadprogress \
; \
\
rm -r /tmp/uploadprogress; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
extdir="$(php -r 'echo ini_get("extension_dir");')"; \
ldd "$extdir"/*.so \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
# start: Apache specific build
a2enmod remoteip; \
# end: Apache specific build
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*; \
ldd "$extdir"/*.so | grep -qzv "=> not found" || (echo "Sanity check failed: missing libraries:"; ldd "$extdir"/*.so | grep " => not found"; exit 1); \
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1); \
err="$(php --version 3>&1 1>&2 2>&3)"; \
[ -z "$err" ] || (echo "Sanity check failed: php returned errors; $err"; exit 1;);
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
ENV PMA_SSL_DIR=/etc/phpmyadmin/ssl
ENV MAX_EXECUTION_TIME=600
ENV MEMORY_LIMIT=512M
ENV UPLOAD_LIMIT=2048K
ENV TZ=UTC
ENV SESSION_SAVE_PATH=/sessions
RUN set -ex; \
mkdir $SESSION_SAVE_PATH; \
mkdir -p $PMA_SSL_DIR; \
chmod 1777 $SESSION_SAVE_PATH; \
chmod 755 $PMA_SSL_DIR; \
chown www-data:www-data /etc/phpmyadmin; \
chown www-data:www-data $PMA_SSL_DIR; \
chown www-data:www-data $SESSION_SAVE_PATH; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen=Off'; \
echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
echo 'max_input_vars=10000'; \
echo 'memory_limit=${MEMORY_LIMIT}'; \
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
USER www-data:www-data
# Calculate download URL
ENV VERSION=5.2.3
ENV SHA256=57881348297c4412f86c410547cf76b4d8a236574dd2c6b7d6a2beebe7fc44e3
ENV URL=https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl -fsSL -o phpMyAdmin.tar.xz $URL; \
curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.openpgp.org --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
mkdir -p /var/www/html/tmp; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -r -v /var/www/html/setup/ /var/www/html/examples/ /var/www/html/js/src/ /var/www/html/babel.config.json /var/www/html/doc/html/_sources/ /var/www/html/RELEASE-DATE-$VERSION /var/www/html/CONTRIBUTING.md; \
grep -q -F "'configFile' => ROOT_PATH . 'config.inc.php'," /var/www/html/libraries/vendor_config.php; \
sed -i "s@'configFile' => .*@'configFile' => '/etc/phpmyadmin/config.inc.php',@" /var/www/html/libraries/vendor_config.php; \
grep -q -F "'configFile' => '/etc/phpmyadmin/config.inc.php'," /var/www/html/libraries/vendor_config.php; \
php -l /var/www/html/libraries/vendor_config.php; \
find /var/www/html -type d -exec chmod 555 {} \;; \
find /var/www/html -type f -exec chmod 444 {} \;; \
chmod 1777 /var/www/html/tmp;
# Copy configuration
COPY --chown=www-data:www-data config.inc.php /etc/phpmyadmin/config.inc.php
COPY --chown=www-data:www-data helpers.php /etc/phpmyadmin/helpers.php
# Copy main script
COPY docker-entrypoint.sh /docker-entrypoint.sh
USER root
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["apache2-foreground"]
+246
View File
@@ -0,0 +1,246 @@
<?php
require_once '/etc/phpmyadmin/config.secret.inc.php';
require_once '/etc/phpmyadmin/helpers.php';
/* Ensure we got the environment */
$vars = [
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_VERBOSE',
'PMA_VERBOSES',
'PMA_PORT',
'PMA_PORTS',
'PMA_SOCKET',
'PMA_SOCKETS',
'PMA_USER',
'PMA_PASSWORD',
'PMA_ABSOLUTE_URI',
'PMA_CONTROLHOST',
'PMA_CONTROLPORT',
'PMA_PMADB',
'PMA_CONTROLUSER',
'PMA_CONTROLPASS',
'PMA_QUERYHISTORYDB',
'PMA_QUERYHISTORYMAX',
'MAX_EXECUTION_TIME',
'MEMORY_LIMIT',
'PMA_UPLOADDIR',
'PMA_SAVEDIR',
'PMA_SSL',
'PMA_SSLS',
'PMA_SSL_DIR',
'PMA_SSL_VERIFY',
'PMA_SSL_VERIFIES',
'PMA_SSL_CA',
'PMA_SSL_CAS',
'PMA_SSL_CA_BASE64',
'PMA_SSL_CAS_BASE64',
'PMA_SSL_KEY',
'PMA_SSL_KEYS',
'PMA_SSL_KEY_BASE64',
'PMA_SSL_KEYS_BASE64',
'PMA_SSL_CERT',
'PMA_SSL_CERTS',
'PMA_SSL_CERT_BASE64',
'PMA_SSL_CERTS_BASE64',
];
foreach ($vars as $var) {
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
if (! defined('PMA_SSL_DIR')) {
define('PMA_SSL_DIR', $_ENV['PMA_SSL_DIR'] ?? '/etc/phpmyadmin/ssl');
}
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
$cfg['QueryHistoryDB'] = (bool) $_ENV['PMA_QUERYHISTORYDB'];
}
if (isset($_ENV['PMA_QUERYHISTORYMAX'])) {
$cfg['QueryHistoryMax'] = (int) $_ENV['PMA_QUERYHISTORYMAX'];
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
$cfg['AllowArbitraryServer'] = true;
}
/* Play nice behind reverse proxys */
if (isset($_ENV['PMA_ABSOLUTE_URI'])) {
$cfg['PmaAbsoluteUri'] = trim($_ENV['PMA_ABSOLUTE_URI']);
}
if (isset($_ENV['PMA_SSL_CA_BASE64'])) {
$_ENV['PMA_SSL_CA'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CA_BASE64'], 'phpmyadmin-ssl-CA', 'pem', PMA_SSL_DIR);
}
/* Decode and save the SSL key from base64 */
if (isset($_ENV['PMA_SSL_KEY_BASE64'])) {
$_ENV['PMA_SSL_KEY'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_KEY_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save the SSL certificate from base64 */
if (isset($_ENV['PMA_SSL_CERT_BASE64'])) {
$_ENV['PMA_SSL_CERT'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CERT_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save multiple SSL CA certificates from base64 */
if (isset($_ENV['PMA_SSL_CAS_BASE64'])) {
$_ENV['PMA_SSL_CAS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CAS_BASE64'], 'phpmyadmin-ssl-CA', 'pem', PMA_SSL_DIR);
}
/* Decode and save multiple SSL keys from base64 */
if (isset($_ENV['PMA_SSL_KEYS_BASE64'])) {
$_ENV['PMA_SSL_KEYS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_KEYS_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save multiple SSL certificates from base64 */
if (isset($_ENV['PMA_SSL_CERTS_BASE64'])) {
$_ENV['PMA_SSL_CERTS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CERTS_BASE64'], 'phpmyadmin-ssl-KEY', 'key', PMA_SSL_DIR);
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = ['db'];
/* Set by environment */
if (! empty($_ENV['PMA_HOST'])) {
$hosts = [$_ENV['PMA_HOST']];
$verbose = [$_ENV['PMA_VERBOSE']];
$ports = [$_ENV['PMA_PORT']];
$ssls = [$_ENV['PMA_SSL']];
$ssl_verifies = [$_ENV['PMA_SSL_VERIFY']];
$ssl_cas = [$_ENV['PMA_SSL_CA']];
$ssl_keys = [$_ENV['PMA_SSL_KEY']];
$ssl_certs = [$_ENV['PMA_SSL_CERT']];
} elseif (! empty($_ENV['PMA_HOSTS'])) {
$hosts = array_map('trim', explode(',', $_ENV['PMA_HOSTS']));
$verbose = array_map('trim', explode(',', $_ENV['PMA_VERBOSES']));
$ports = array_map('trim', explode(',', $_ENV['PMA_PORTS']));
$ssls = array_map('trim', explode(',', $_ENV['PMA_SSLS']));
$ssl_verifies = array_map('trim', explode(',', $_ENV['PMA_SSL_VERIFIES']));
$ssl_cas = array_map('trim', explode(',', $_ENV['PMA_SSL_CAS']));
$ssl_keys = array_map('trim', explode(',', $_ENV['PMA_SSL_KEYS']));
$ssl_certs = array_map('trim', explode(',', $_ENV['PMA_SSL_CERTS']));
}
if (! empty($_ENV['PMA_SOCKET'])) {
$sockets = [$_ENV['PMA_SOCKET']];
} elseif (! empty($_ENV['PMA_SOCKETS'])) {
$sockets = explode(',', $_ENV['PMA_SOCKETS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
if (isset($ssls[$i - 1]) && $ssls[$i - 1] === '1') {
$cfg['Servers'][$i]['ssl'] = $ssls[$i - 1];
}
if (isset($ssl_verifies[$i - 1]) && $ssl_verifies[$i - 1] === '1') {
$cfg['Servers'][$i]['ssl_verify'] = $ssl_verifies[$i - 1];
}
if (isset($ssl_cas[$i - 1])) {
$cfg['Servers'][$i]['ssl_ca'] = $ssl_cas[$i - 1];
}
if (isset($ssl_keys[$i - 1])) {
$cfg['Servers'][$i]['ssl_key'] = $ssl_keys[$i - 1];
}
if (isset($ssl_certs[$i - 1])) {
$cfg['Servers'][$i]['ssl_cert'] = $ssl_certs[$i - 1];
}
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($ports[$i - 1])) {
$cfg['Servers'][$i]['port'] = $ports[$i - 1];
}
if (isset($_ENV['PMA_USER'])) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
if (isset($_ENV['PMA_PMADB'])) {
$cfg['Servers'][$i]['pmadb'] = $_ENV['PMA_PMADB'];
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
}
if (isset($_ENV['PMA_CONTROLHOST'])) {
$cfg['Servers'][$i]['controlhost'] = $_ENV['PMA_CONTROLHOST'];
}
if (isset($_ENV['PMA_CONTROLPORT'])) {
$cfg['Servers'][$i]['controlport'] = $_ENV['PMA_CONTROLPORT'];
}
if (isset($_ENV['PMA_CONTROLUSER'])) {
$cfg['Servers'][$i]['controluser'] = $_ENV['PMA_CONTROLUSER'];
}
if (isset($_ENV['PMA_CONTROLPASS'])) {
$cfg['Servers'][$i]['controlpass'] = $_ENV['PMA_CONTROLPASS'];
}
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
}
// Avoid overwriting the last server id $i, use another variable name
for ($socketHostId = 1; isset($sockets[$socketHostId - 1]); $socketHostId++) {
$cfg['Servers'][$socketHostId]['socket'] = $sockets[$socketHostId - 1];
$cfg['Servers'][$socketHostId]['host'] = 'localhost';
}
/*
* Revert back to last configured server to make
* it easier in config.user.inc.php
*/
$i--;
/* Uploads setup */
if (isset($_ENV['PMA_UPLOADDIR'])) {
$cfg['UploadDir'] = $_ENV['PMA_UPLOADDIR'];
}
if (isset($_ENV['PMA_SAVEDIR'])) {
$cfg['SaveDir'] = $_ENV['PMA_SAVEDIR'];
}
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];
}
if (isset($_ENV['MEMORY_LIMIT'])) {
$cfg['MemoryLimit'] = $_ENV['MEMORY_LIMIT'];
}
/* Include User Defined Settings Hook */
if (file_exists('/etc/phpmyadmin/config.user.inc.php')) {
include '/etc/phpmyadmin/config.user.inc.php';
}
/* Support additional configurations */
if (is_dir('/etc/phpmyadmin/conf.d/')) {
foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename) {
include $filename;
}
}
+63
View File
@@ -0,0 +1,63 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
EOT
fi
chgrp www-data /etc/phpmyadmin/config.secret.inc.php
if [ ! -f /etc/phpmyadmin/config.user.inc.php ]; then
touch /etc/phpmyadmin/config.user.inc.php
fi
fi
if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo "PHP version is now hidden."
echo -e 'expose_php = Off\n' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi
if [ ! -z "${PMA_CONFIG_BASE64}" ]; then
echo "Adding the custom config.inc.php from base64."
echo "${PMA_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.inc.php
fi
if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "Adding the custom config.user.inc.php from base64."
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
# start: Apache specific settings
if [ -n "${APACHE_PORT+x}" ]; then
echo "Setting apache port to ${APACHE_PORT}."
sed -i "/VirtualHost \*:80/c\\<VirtualHost \*:${APACHE_PORT}\>" /etc/apache2/sites-enabled/000-default.conf
sed -i "/Listen 80/c\Listen ${APACHE_PORT}" /etc/apache2/ports.conf
apachectl configtest
fi
# end: Apache specific settings
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
# Check if the variable with name $env_var_file (which is $PMA_PASSWORD_FILE for example)
# is not empty and export $PMA_PASSWORD as the password in the Docker secrets file
if [[ -n "${!env_var_file}" ]]; then
export "${env_var}"="$(cat "${!env_var_file}")"
fi
}
get_docker_secret PMA_USER
get_docker_secret PMA_PASSWORD
get_docker_secret MYSQL_ROOT_PASSWORD
get_docker_secret MYSQL_PASSWORD
get_docker_secret PMA_HOSTS
get_docker_secret PMA_HOST
get_docker_secret PMA_CONTROLHOST
get_docker_secret PMA_CONTROLUSER
get_docker_secret PMA_CONTROLPASS
exec "$@"
+51
View File
@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
/**
* Helper function to decode and save multiple SSL files from base64.
*
* @param string $base64FilesContents The base64 encoded string containing multiple files separated by commas.
* If no commas are present, the entire string is treated as a single file.
* @param string $prefix The prefix to use for the generated file names.
* @param string $extension The file extension to use for the generated files.
* @param string $storageFolder The folder where to store the generated files.
*
* @return string A comma-separated list of paths to the generated files.
*/
function decodeBase64AndSaveFiles(string $base64FilesContents, string $prefix, string $extension, string $storageFolder): string
{
// Ensure the output directory exists
if (! is_dir($storageFolder)) {
mkdir($storageFolder, 0755, true);
}
// Split the base64 string into an array of files
$base64FilesContents = explode(',', trim($base64FilesContents));
$counter = 1;
$outputFiles = [];
// Process each file
foreach ($base64FilesContents as $base64FileContent) {
$outputFile = $storageFolder . '/' . $prefix . '-' . $counter . '.' . $extension;
$fileContent = base64_decode($base64FileContent, true);
if ($fileContent === false) {
echo 'Failed to decode: ' . $base64FileContent;
exit(1);
}
// Write the decoded file to the output directory
if (file_put_contents($outputFile, $fileContent) === false) {
echo 'Failed to write to ' . $outputFile;
exit(1);
}
// Add the output file path to the list
$outputFiles[] = $outputFile;
$counter++;
}
// Return a comma-separated list of the generated file paths
return implode(',', $outputFiles);
}
+203 -20
View File
@@ -1,63 +1,246 @@
<?php
require('./config.secret.inc.php');
require_once '/etc/phpmyadmin/config.secret.inc.php';
require_once '/etc/phpmyadmin/helpers.php';
/* Ensure we got the environment */
$vars = array(
$vars = [
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_VERBOSE',
'PMA_VERBOSES',
'PMA_PORT',
'PMA_PORTS',
'PMA_SOCKET',
'PMA_SOCKETS',
'PMA_USER',
'PMA_PASSWORD',
);
'PMA_ABSOLUTE_URI',
'PMA_CONTROLHOST',
'PMA_CONTROLPORT',
'PMA_PMADB',
'PMA_CONTROLUSER',
'PMA_CONTROLPASS',
'PMA_QUERYHISTORYDB',
'PMA_QUERYHISTORYMAX',
'MAX_EXECUTION_TIME',
'MEMORY_LIMIT',
'PMA_UPLOADDIR',
'PMA_SAVEDIR',
'PMA_SSL',
'PMA_SSLS',
'PMA_SSL_DIR',
'PMA_SSL_VERIFY',
'PMA_SSL_VERIFIES',
'PMA_SSL_CA',
'PMA_SSL_CAS',
'PMA_SSL_CA_BASE64',
'PMA_SSL_CAS_BASE64',
'PMA_SSL_KEY',
'PMA_SSL_KEYS',
'PMA_SSL_KEY_BASE64',
'PMA_SSL_KEYS_BASE64',
'PMA_SSL_CERT',
'PMA_SSL_CERTS',
'PMA_SSL_CERT_BASE64',
'PMA_SSL_CERTS_BASE64',
];
foreach ($vars as $var) {
if (!isset($_ENV[$var]) && getenv($var)) {
$_ENV[$var] = getenv($var);
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
if (! defined('PMA_SSL_DIR')) {
define('PMA_SSL_DIR', $_ENV['PMA_SSL_DIR'] ?? '/etc/phpmyadmin/ssl');
}
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
$cfg['QueryHistoryDB'] = (bool) $_ENV['PMA_QUERYHISTORYDB'];
}
if (isset($_ENV['PMA_QUERYHISTORYMAX'])) {
$cfg['QueryHistoryMax'] = (int) $_ENV['PMA_QUERYHISTORYMAX'];
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
$cfg['AllowArbitraryServer'] = true;
}
/* Play nice behind reverse proxys */
if (isset($_ENV['PMA_ABSOLUTE_URI'])) {
$cfg['PmaAbsoluteUri'] = trim($_ENV['PMA_ABSOLUTE_URI']);
}
if (isset($_ENV['PMA_SSL_CA_BASE64'])) {
$_ENV['PMA_SSL_CA'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CA_BASE64'], 'phpmyadmin-ssl-CA', 'pem', PMA_SSL_DIR);
}
/* Decode and save the SSL key from base64 */
if (isset($_ENV['PMA_SSL_KEY_BASE64'])) {
$_ENV['PMA_SSL_KEY'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_KEY_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save the SSL certificate from base64 */
if (isset($_ENV['PMA_SSL_CERT_BASE64'])) {
$_ENV['PMA_SSL_CERT'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CERT_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save multiple SSL CA certificates from base64 */
if (isset($_ENV['PMA_SSL_CAS_BASE64'])) {
$_ENV['PMA_SSL_CAS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CAS_BASE64'], 'phpmyadmin-ssl-CA', 'pem', PMA_SSL_DIR);
}
/* Decode and save multiple SSL keys from base64 */
if (isset($_ENV['PMA_SSL_KEYS_BASE64'])) {
$_ENV['PMA_SSL_KEYS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_KEYS_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save multiple SSL certificates from base64 */
if (isset($_ENV['PMA_SSL_CERTS_BASE64'])) {
$_ENV['PMA_SSL_CERTS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CERTS_BASE64'], 'phpmyadmin-ssl-KEY', 'key', PMA_SSL_DIR);
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = array('db');
$hosts = ['db'];
/* Set by environment */
if (!empty($_ENV['PMA_HOST'])) {
$hosts = array($_ENV['PMA_HOST']);
} elseif (!empty($_ENV['PMA_HOSTS'])) {
$hosts = explode(',', $_ENV['PMA_HOSTS']);
if (! empty($_ENV['PMA_HOST'])) {
$hosts = [$_ENV['PMA_HOST']];
$verbose = [$_ENV['PMA_VERBOSE']];
$ports = [$_ENV['PMA_PORT']];
$ssls = [$_ENV['PMA_SSL']];
$ssl_verifies = [$_ENV['PMA_SSL_VERIFY']];
$ssl_cas = [$_ENV['PMA_SSL_CA']];
$ssl_keys = [$_ENV['PMA_SSL_KEY']];
$ssl_certs = [$_ENV['PMA_SSL_CERT']];
} elseif (! empty($_ENV['PMA_HOSTS'])) {
$hosts = array_map('trim', explode(',', $_ENV['PMA_HOSTS']));
$verbose = array_map('trim', explode(',', $_ENV['PMA_VERBOSES']));
$ports = array_map('trim', explode(',', $_ENV['PMA_PORTS']));
$ssls = array_map('trim', explode(',', $_ENV['PMA_SSLS']));
$ssl_verifies = array_map('trim', explode(',', $_ENV['PMA_SSL_VERIFIES']));
$ssl_cas = array_map('trim', explode(',', $_ENV['PMA_SSL_CAS']));
$ssl_keys = array_map('trim', explode(',', $_ENV['PMA_SSL_KEYS']));
$ssl_certs = array_map('trim', explode(',', $_ENV['PMA_SSL_CERTS']));
}
if (! empty($_ENV['PMA_SOCKET'])) {
$sockets = [$_ENV['PMA_SOCKET']];
} elseif (! empty($_ENV['PMA_SOCKETS'])) {
$sockets = explode(',', $_ENV['PMA_SOCKETS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
if (isset($ssls[$i - 1]) && $ssls[$i - 1] === '1') {
$cfg['Servers'][$i]['ssl'] = $ssls[$i - 1];
}
if (isset($ssl_verifies[$i - 1]) && $ssl_verifies[$i - 1] === '1') {
$cfg['Servers'][$i]['ssl_verify'] = $ssl_verifies[$i - 1];
}
if (isset($ssl_cas[$i - 1])) {
$cfg['Servers'][$i]['ssl_ca'] = $ssl_cas[$i - 1];
}
if (isset($ssl_keys[$i - 1])) {
$cfg['Servers'][$i]['ssl_key'] = $ssl_keys[$i - 1];
}
if (isset($ssl_certs[$i - 1])) {
$cfg['Servers'][$i]['ssl_cert'] = $ssl_certs[$i - 1];
}
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($_ENV['PMA_PORT'])) {
$cfg['Servers'][$i]['port'] = $_ENV['PMA_PORT'];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($ports[$i - 1])) {
$cfg['Servers'][$i]['port'] = $ports[$i - 1];
}
if (isset($_ENV['PMA_USER'])) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : null;
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
$cfg['Servers'][$i]['connect_type'] = 'tcp';
if (isset($_ENV['PMA_PMADB'])) {
$cfg['Servers'][$i]['pmadb'] = $_ENV['PMA_PMADB'];
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
}
if (isset($_ENV['PMA_CONTROLHOST'])) {
$cfg['Servers'][$i]['controlhost'] = $_ENV['PMA_CONTROLHOST'];
}
if (isset($_ENV['PMA_CONTROLPORT'])) {
$cfg['Servers'][$i]['controlport'] = $_ENV['PMA_CONTROLPORT'];
}
if (isset($_ENV['PMA_CONTROLUSER'])) {
$cfg['Servers'][$i]['controluser'] = $_ENV['PMA_CONTROLUSER'];
}
if (isset($_ENV['PMA_CONTROLPASS'])) {
$cfg['Servers'][$i]['controlpass'] = $_ENV['PMA_CONTROLPASS'];
}
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
}
// Avoid overwriting the last server id $i, use another variable name
for ($socketHostId = 1; isset($sockets[$socketHostId - 1]); $socketHostId++) {
$cfg['Servers'][$socketHostId]['socket'] = $sockets[$socketHostId - 1];
$cfg['Servers'][$socketHostId]['host'] = 'localhost';
}
/*
* Revert back to last configured server to make
* it easier in config.user.inc.php
*/
$i--;
/* Uploads setup */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
/* Include User Defined Settings Hook */
if (file_exists('/config.user.inc.php')) {
include('/config.user.inc.php');
if (isset($_ENV['PMA_UPLOADDIR'])) {
$cfg['UploadDir'] = $_ENV['PMA_UPLOADDIR'];
}
if (isset($_ENV['PMA_SAVEDIR'])) {
$cfg['SaveDir'] = $_ENV['PMA_SAVEDIR'];
}
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];
}
if (isset($_ENV['MEMORY_LIMIT'])) {
$cfg['MemoryLimit'] = $_ENV['MEMORY_LIMIT'];
}
/* Include User Defined Settings Hook */
if (file_exists('/etc/phpmyadmin/config.user.inc.php')) {
include '/etc/phpmyadmin/config.user.inc.php';
}
/* Support additional configurations */
if (is_dir('/etc/phpmyadmin/conf.d/')) {
foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename) {
include $filename;
}
}
-8
View File
@@ -1,8 +0,0 @@
phpmyadmin:
image: phpmyadmin/phpmyadmin:testing
container_name: myadmin
environment:
- PMA_ARBITRARY=1
restart: always
ports:
- 8090:80
+2 -2
View File
@@ -1,6 +1,6 @@
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: myadmin
image: phpmyadmin
container_name: phpmyadmin
environment:
- PMA_ARBITRARY=1
restart: always
+63
View File
@@ -0,0 +1,63 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
EOT
fi
chgrp www-data /etc/phpmyadmin/config.secret.inc.php
if [ ! -f /etc/phpmyadmin/config.user.inc.php ]; then
touch /etc/phpmyadmin/config.user.inc.php
fi
fi
if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo "PHP version is now hidden."
echo -e 'expose_php = Off\n' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi
if [ ! -z "${PMA_CONFIG_BASE64}" ]; then
echo "Adding the custom config.inc.php from base64."
echo "${PMA_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.inc.php
fi
if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "Adding the custom config.user.inc.php from base64."
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
# start: Apache specific settings
if [ -n "${APACHE_PORT+x}" ]; then
echo "Setting apache port to ${APACHE_PORT}."
sed -i "/VirtualHost \*:80/c\\<VirtualHost \*:${APACHE_PORT}\>" /etc/apache2/sites-enabled/000-default.conf
sed -i "/Listen 80/c\Listen ${APACHE_PORT}" /etc/apache2/ports.conf
apachectl configtest
fi
# end: Apache specific settings
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
# Check if the variable with name $env_var_file (which is $PMA_PASSWORD_FILE for example)
# is not empty and export $PMA_PASSWORD as the password in the Docker secrets file
if [[ -n "${!env_var_file}" ]]; then
export "${env_var}"="$(cat "${!env_var_file}")"
fi
}
get_docker_secret PMA_USER
get_docker_secret PMA_PASSWORD
get_docker_secret MYSQL_ROOT_PASSWORD
get_docker_secret MYSQL_PASSWORD
get_docker_secret PMA_HOSTS
get_docker_secret PMA_HOST
get_docker_secret PMA_CONTROLHOST
get_docker_secret PMA_CONTROLUSER
get_docker_secret PMA_CONTROLPASS
exec "$@"
+146
View File
@@ -0,0 +1,146 @@
# DO NOT EDIT: created by update.sh from Dockerfile-alpine.template
FROM php:8.3-fpm-alpine
ENV UPLOAD_PROGRESS_EXT_URL="https://github.com/php/pecl-php-uploadprogress/archive/refs/tags/uploadprogress-2.0.2.tar.gz"
ENV UPLOAD_PROGRESS_SHA256="fe3f6cdfcedad563c970c4fd1cda31e422cfc0df5cc9a217d8c80ed3c8d137f5"
# install and docker-entrypoint.sh dependencies
RUN apk add --no-cache \
bash \
tzdata \
gnupg
# Install dependencies
RUN set -ex; \
\
apk add --no-cache --virtual .build-deps \
bzip2-dev \
freetype-dev \
libjpeg-turbo-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
; \
\
mkdir -p /tmp/uploadprogress; \
curl -fsSL -o /tmp/uploadprogress/uploadprogress.tar.gz "$UPLOAD_PROGRESS_EXT_URL"; \
echo "$UPLOAD_PROGRESS_SHA256 /tmp/uploadprogress/uploadprogress.tar.gz" | sha256sum -c -; \
tar -xf /tmp/uploadprogress/uploadprogress.tar.gz -C /tmp/uploadprogress --strip-components=1; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
docker-php-ext-install -j "$(nproc)" \
bz2 \
gd \
mysqli \
opcache \
zip \
bcmath \
/tmp/uploadprogress \
; \
\
rm -r /tmp/uploadprogress; \
\
runDeps="$( \
scanelf --needed --nobanner --format '%n#p' --recursive /usr/local/lib/php/extensions \
| tr ',' '\n' \
| sort -u \
| awk 'system("[ -e /usr/local/lib/" $1 " ]") == 0 { next } { print "so:" $1 }' \
)"; \
apk add --no-network --virtual .phpmyadmin-phpexts-rundeps $runDeps; \
apk del --no-network .build-deps
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
ENV PMA_SSL_DIR=/etc/phpmyadmin/ssl
ENV MAX_EXECUTION_TIME=600
ENV MEMORY_LIMIT=512M
ENV UPLOAD_LIMIT=2048K
ENV TZ=UTC
ENV SESSION_SAVE_PATH=/sessions
RUN set -ex; \
mkdir $SESSION_SAVE_PATH; \
mkdir -p $PMA_SSL_DIR; \
chmod 1777 $SESSION_SAVE_PATH; \
chmod 755 $PMA_SSL_DIR; \
chown www-data:www-data /etc/phpmyadmin; \
chown www-data:www-data $PMA_SSL_DIR; \
chown www-data:www-data $SESSION_SAVE_PATH; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen=Off'; \
echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
echo 'max_input_vars=10000'; \
echo 'memory_limit=${MEMORY_LIMIT}'; \
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
USER www-data:www-data
# Calculate download URL
ENV VERSION=5.2.3
ENV SHA256=57881348297c4412f86c410547cf76b4d8a236574dd2c6b7d6a2beebe7fc44e3
ENV URL=https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl -fsSL -o phpMyAdmin.tar.xz $URL; \
curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.openpgp.org --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
mkdir -p /var/www/html/tmp; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -r -v /var/www/html/setup/ /var/www/html/examples/ /var/www/html/js/src/ /var/www/html/babel.config.json /var/www/html/doc/html/_sources/ /var/www/html/RELEASE-DATE-$VERSION /var/www/html/CONTRIBUTING.md; \
grep -q -F "'configFile' => ROOT_PATH . 'config.inc.php'," /var/www/html/libraries/vendor_config.php; \
sed -i "s@'configFile' => .*@'configFile' => '/etc/phpmyadmin/config.inc.php',@" /var/www/html/libraries/vendor_config.php; \
grep -q -F "'configFile' => '/etc/phpmyadmin/config.inc.php'," /var/www/html/libraries/vendor_config.php; \
php -l /var/www/html/libraries/vendor_config.php; \
find /var/www/html -type d -exec chmod 555 {} \;; \
find /var/www/html -type f -exec chmod 444 {} \;; \
chmod 1777 /var/www/html/tmp;
# Copy configuration
COPY --chown=www-data:www-data config.inc.php /etc/phpmyadmin/config.inc.php
COPY --chown=www-data:www-data helpers.php /etc/phpmyadmin/helpers.php
# Copy main script
COPY docker-entrypoint.sh /docker-entrypoint.sh
USER root
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["php-fpm"]
+246
View File
@@ -0,0 +1,246 @@
<?php
require_once '/etc/phpmyadmin/config.secret.inc.php';
require_once '/etc/phpmyadmin/helpers.php';
/* Ensure we got the environment */
$vars = [
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_VERBOSE',
'PMA_VERBOSES',
'PMA_PORT',
'PMA_PORTS',
'PMA_SOCKET',
'PMA_SOCKETS',
'PMA_USER',
'PMA_PASSWORD',
'PMA_ABSOLUTE_URI',
'PMA_CONTROLHOST',
'PMA_CONTROLPORT',
'PMA_PMADB',
'PMA_CONTROLUSER',
'PMA_CONTROLPASS',
'PMA_QUERYHISTORYDB',
'PMA_QUERYHISTORYMAX',
'MAX_EXECUTION_TIME',
'MEMORY_LIMIT',
'PMA_UPLOADDIR',
'PMA_SAVEDIR',
'PMA_SSL',
'PMA_SSLS',
'PMA_SSL_DIR',
'PMA_SSL_VERIFY',
'PMA_SSL_VERIFIES',
'PMA_SSL_CA',
'PMA_SSL_CAS',
'PMA_SSL_CA_BASE64',
'PMA_SSL_CAS_BASE64',
'PMA_SSL_KEY',
'PMA_SSL_KEYS',
'PMA_SSL_KEY_BASE64',
'PMA_SSL_KEYS_BASE64',
'PMA_SSL_CERT',
'PMA_SSL_CERTS',
'PMA_SSL_CERT_BASE64',
'PMA_SSL_CERTS_BASE64',
];
foreach ($vars as $var) {
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
if (! defined('PMA_SSL_DIR')) {
define('PMA_SSL_DIR', $_ENV['PMA_SSL_DIR'] ?? '/etc/phpmyadmin/ssl');
}
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
$cfg['QueryHistoryDB'] = (bool) $_ENV['PMA_QUERYHISTORYDB'];
}
if (isset($_ENV['PMA_QUERYHISTORYMAX'])) {
$cfg['QueryHistoryMax'] = (int) $_ENV['PMA_QUERYHISTORYMAX'];
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
$cfg['AllowArbitraryServer'] = true;
}
/* Play nice behind reverse proxys */
if (isset($_ENV['PMA_ABSOLUTE_URI'])) {
$cfg['PmaAbsoluteUri'] = trim($_ENV['PMA_ABSOLUTE_URI']);
}
if (isset($_ENV['PMA_SSL_CA_BASE64'])) {
$_ENV['PMA_SSL_CA'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CA_BASE64'], 'phpmyadmin-ssl-CA', 'pem', PMA_SSL_DIR);
}
/* Decode and save the SSL key from base64 */
if (isset($_ENV['PMA_SSL_KEY_BASE64'])) {
$_ENV['PMA_SSL_KEY'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_KEY_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save the SSL certificate from base64 */
if (isset($_ENV['PMA_SSL_CERT_BASE64'])) {
$_ENV['PMA_SSL_CERT'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CERT_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save multiple SSL CA certificates from base64 */
if (isset($_ENV['PMA_SSL_CAS_BASE64'])) {
$_ENV['PMA_SSL_CAS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CAS_BASE64'], 'phpmyadmin-ssl-CA', 'pem', PMA_SSL_DIR);
}
/* Decode and save multiple SSL keys from base64 */
if (isset($_ENV['PMA_SSL_KEYS_BASE64'])) {
$_ENV['PMA_SSL_KEYS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_KEYS_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save multiple SSL certificates from base64 */
if (isset($_ENV['PMA_SSL_CERTS_BASE64'])) {
$_ENV['PMA_SSL_CERTS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CERTS_BASE64'], 'phpmyadmin-ssl-KEY', 'key', PMA_SSL_DIR);
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = ['db'];
/* Set by environment */
if (! empty($_ENV['PMA_HOST'])) {
$hosts = [$_ENV['PMA_HOST']];
$verbose = [$_ENV['PMA_VERBOSE']];
$ports = [$_ENV['PMA_PORT']];
$ssls = [$_ENV['PMA_SSL']];
$ssl_verifies = [$_ENV['PMA_SSL_VERIFY']];
$ssl_cas = [$_ENV['PMA_SSL_CA']];
$ssl_keys = [$_ENV['PMA_SSL_KEY']];
$ssl_certs = [$_ENV['PMA_SSL_CERT']];
} elseif (! empty($_ENV['PMA_HOSTS'])) {
$hosts = array_map('trim', explode(',', $_ENV['PMA_HOSTS']));
$verbose = array_map('trim', explode(',', $_ENV['PMA_VERBOSES']));
$ports = array_map('trim', explode(',', $_ENV['PMA_PORTS']));
$ssls = array_map('trim', explode(',', $_ENV['PMA_SSLS']));
$ssl_verifies = array_map('trim', explode(',', $_ENV['PMA_SSL_VERIFIES']));
$ssl_cas = array_map('trim', explode(',', $_ENV['PMA_SSL_CAS']));
$ssl_keys = array_map('trim', explode(',', $_ENV['PMA_SSL_KEYS']));
$ssl_certs = array_map('trim', explode(',', $_ENV['PMA_SSL_CERTS']));
}
if (! empty($_ENV['PMA_SOCKET'])) {
$sockets = [$_ENV['PMA_SOCKET']];
} elseif (! empty($_ENV['PMA_SOCKETS'])) {
$sockets = explode(',', $_ENV['PMA_SOCKETS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
if (isset($ssls[$i - 1]) && $ssls[$i - 1] === '1') {
$cfg['Servers'][$i]['ssl'] = $ssls[$i - 1];
}
if (isset($ssl_verifies[$i - 1]) && $ssl_verifies[$i - 1] === '1') {
$cfg['Servers'][$i]['ssl_verify'] = $ssl_verifies[$i - 1];
}
if (isset($ssl_cas[$i - 1])) {
$cfg['Servers'][$i]['ssl_ca'] = $ssl_cas[$i - 1];
}
if (isset($ssl_keys[$i - 1])) {
$cfg['Servers'][$i]['ssl_key'] = $ssl_keys[$i - 1];
}
if (isset($ssl_certs[$i - 1])) {
$cfg['Servers'][$i]['ssl_cert'] = $ssl_certs[$i - 1];
}
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($ports[$i - 1])) {
$cfg['Servers'][$i]['port'] = $ports[$i - 1];
}
if (isset($_ENV['PMA_USER'])) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
if (isset($_ENV['PMA_PMADB'])) {
$cfg['Servers'][$i]['pmadb'] = $_ENV['PMA_PMADB'];
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
}
if (isset($_ENV['PMA_CONTROLHOST'])) {
$cfg['Servers'][$i]['controlhost'] = $_ENV['PMA_CONTROLHOST'];
}
if (isset($_ENV['PMA_CONTROLPORT'])) {
$cfg['Servers'][$i]['controlport'] = $_ENV['PMA_CONTROLPORT'];
}
if (isset($_ENV['PMA_CONTROLUSER'])) {
$cfg['Servers'][$i]['controluser'] = $_ENV['PMA_CONTROLUSER'];
}
if (isset($_ENV['PMA_CONTROLPASS'])) {
$cfg['Servers'][$i]['controlpass'] = $_ENV['PMA_CONTROLPASS'];
}
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
}
// Avoid overwriting the last server id $i, use another variable name
for ($socketHostId = 1; isset($sockets[$socketHostId - 1]); $socketHostId++) {
$cfg['Servers'][$socketHostId]['socket'] = $sockets[$socketHostId - 1];
$cfg['Servers'][$socketHostId]['host'] = 'localhost';
}
/*
* Revert back to last configured server to make
* it easier in config.user.inc.php
*/
$i--;
/* Uploads setup */
if (isset($_ENV['PMA_UPLOADDIR'])) {
$cfg['UploadDir'] = $_ENV['PMA_UPLOADDIR'];
}
if (isset($_ENV['PMA_SAVEDIR'])) {
$cfg['SaveDir'] = $_ENV['PMA_SAVEDIR'];
}
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];
}
if (isset($_ENV['MEMORY_LIMIT'])) {
$cfg['MemoryLimit'] = $_ENV['MEMORY_LIMIT'];
}
/* Include User Defined Settings Hook */
if (file_exists('/etc/phpmyadmin/config.user.inc.php')) {
include '/etc/phpmyadmin/config.user.inc.php';
}
/* Support additional configurations */
if (is_dir('/etc/phpmyadmin/conf.d/')) {
foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename) {
include $filename;
}
}
+55
View File
@@ -0,0 +1,55 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
EOT
fi
chgrp www-data /etc/phpmyadmin/config.secret.inc.php
if [ ! -f /etc/phpmyadmin/config.user.inc.php ]; then
touch /etc/phpmyadmin/config.user.inc.php
fi
fi
if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo "PHP version is now hidden."
echo -e 'expose_php = Off\n' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi
if [ ! -z "${PMA_CONFIG_BASE64}" ]; then
echo "Adding the custom config.inc.php from base64."
echo "${PMA_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.inc.php
fi
if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "Adding the custom config.user.inc.php from base64."
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
# Check if the variable with name $env_var_file (which is $PMA_PASSWORD_FILE for example)
# is not empty and export $PMA_PASSWORD as the password in the Docker secrets file
if [[ -n "${!env_var_file}" ]]; then
export "${env_var}"="$(cat "${!env_var_file}")"
fi
}
get_docker_secret PMA_USER
get_docker_secret PMA_PASSWORD
get_docker_secret MYSQL_ROOT_PASSWORD
get_docker_secret MYSQL_PASSWORD
get_docker_secret PMA_HOSTS
get_docker_secret PMA_HOST
get_docker_secret PMA_CONTROLHOST
get_docker_secret PMA_CONTROLUSER
get_docker_secret PMA_CONTROLPASS
exec "$@"
+51
View File
@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
/**
* Helper function to decode and save multiple SSL files from base64.
*
* @param string $base64FilesContents The base64 encoded string containing multiple files separated by commas.
* If no commas are present, the entire string is treated as a single file.
* @param string $prefix The prefix to use for the generated file names.
* @param string $extension The file extension to use for the generated files.
* @param string $storageFolder The folder where to store the generated files.
*
* @return string A comma-separated list of paths to the generated files.
*/
function decodeBase64AndSaveFiles(string $base64FilesContents, string $prefix, string $extension, string $storageFolder): string
{
// Ensure the output directory exists
if (! is_dir($storageFolder)) {
mkdir($storageFolder, 0755, true);
}
// Split the base64 string into an array of files
$base64FilesContents = explode(',', trim($base64FilesContents));
$counter = 1;
$outputFiles = [];
// Process each file
foreach ($base64FilesContents as $base64FileContent) {
$outputFile = $storageFolder . '/' . $prefix . '-' . $counter . '.' . $extension;
$fileContent = base64_decode($base64FileContent, true);
if ($fileContent === false) {
echo 'Failed to decode: ' . $base64FileContent;
exit(1);
}
// Write the decoded file to the output directory
if (file_put_contents($outputFile, $fileContent) === false) {
echo 'Failed to write to ' . $outputFile;
exit(1);
}
// Add the output file path to the list
$outputFiles[] = $outputFile;
$counter++;
}
// Return a comma-separated list of the generated file paths
return implode(',', $outputFiles);
}
+157
View File
@@ -0,0 +1,157 @@
# DO NOT EDIT: created by update.sh from Dockerfile-debian.template
FROM php:8.3-fpm
ENV UPLOAD_PROGRESS_EXT_URL="https://github.com/php/pecl-php-uploadprogress/archive/refs/tags/uploadprogress-2.0.2.tar.gz"
ENV UPLOAD_PROGRESS_SHA256="fe3f6cdfcedad563c970c4fd1cda31e422cfc0df5cc9a217d8c80ed3c8d137f5"
# Install dependencies
RUN set -ex; \
\
apt-get update; \
apt-get install -y --no-install-recommends \
gnupg \
dirmngr \
; \
\
savedAptMark="$(apt-mark showmanual)"; \
\
apt-get install -y --no-install-recommends \
libbz2-dev \
libfreetype6-dev \
libjpeg-dev \
libpng-dev \
libwebp-dev \
libxpm-dev \
libzip-dev \
; \
\
mkdir -p /tmp/uploadprogress; \
curl -fsSL -o /tmp/uploadprogress/uploadprogress.tar.gz "$UPLOAD_PROGRESS_EXT_URL"; \
echo "$UPLOAD_PROGRESS_SHA256 /tmp/uploadprogress/uploadprogress.tar.gz" | sha256sum -c -; \
tar -xf /tmp/uploadprogress/uploadprogress.tar.gz -C /tmp/uploadprogress --strip-components=1; \
\
docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp --with-xpm; \
docker-php-ext-install -j "$(nproc)" \
bz2 \
gd \
mysqli \
opcache \
zip \
bcmath \
/tmp/uploadprogress \
; \
\
rm -r /tmp/uploadprogress; \
\
apt-mark auto '.*' > /dev/null; \
apt-mark manual $savedAptMark; \
extdir="$(php -r 'echo ini_get("extension_dir");')"; \
ldd "$extdir"/*.so \
| awk '/=>/ { so = $(NF-1); if (index(so, "/usr/local/") == 1) { next }; gsub("^/(usr/)?", "", so); print so }' \
| sort -u \
| xargs -r dpkg-query -S \
| cut -d: -f1 \
| sort -u \
| xargs -rt apt-mark manual; \
\
\
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \
rm -rf /var/lib/apt/lists/*; \
ldd "$extdir"/*.so | grep -qzv "=> not found" || (echo "Sanity check failed: missing libraries:"; ldd "$extdir"/*.so | grep " => not found"; exit 1); \
ldd "$extdir"/*.so | grep -q "libzip.so.* => .*/libzip.so.*" || (echo "Sanity check failed: libzip.so is not referenced"; ldd "$extdir"/*.so; exit 1); \
err="$(php --version 3>&1 1>&2 2>&3)"; \
[ -z "$err" ] || (echo "Sanity check failed: php returned errors; $err"; exit 1;);
# set recommended PHP.ini settings
# see https://secure.php.net/manual/en/opcache.installation.php
ENV PMA_SSL_DIR=/etc/phpmyadmin/ssl
ENV MAX_EXECUTION_TIME=600
ENV MEMORY_LIMIT=512M
ENV UPLOAD_LIMIT=2048K
ENV TZ=UTC
ENV SESSION_SAVE_PATH=/sessions
RUN set -ex; \
mkdir $SESSION_SAVE_PATH; \
mkdir -p $PMA_SSL_DIR; \
chmod 1777 $SESSION_SAVE_PATH; \
chmod 755 $PMA_SSL_DIR; \
chown www-data:www-data /etc/phpmyadmin; \
chown www-data:www-data $PMA_SSL_DIR; \
chown www-data:www-data $SESSION_SAVE_PATH; \
\
{ \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=2'; \
echo 'opcache.fast_shutdown=1'; \
} > $PHP_INI_DIR/conf.d/opcache-recommended.ini; \
\
{ \
echo 'session.cookie_httponly=1'; \
echo 'session.use_strict_mode=1'; \
} > $PHP_INI_DIR/conf.d/session-strict.ini; \
\
{ \
echo 'allow_url_fopen=Off'; \
echo 'max_execution_time=${MAX_EXECUTION_TIME}'; \
echo 'max_input_vars=10000'; \
echo 'memory_limit=${MEMORY_LIMIT}'; \
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
USER www-data:www-data
# Calculate download URL
ENV VERSION=5.2.3
ENV SHA256=57881348297c4412f86c410547cf76b4d8a236574dd2c6b7d6a2beebe7fc44e3
ENV URL=https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL org.opencontainers.image.title="Official phpMyAdmin Docker image" \
org.opencontainers.image.description="Run phpMyAdmin with Alpine, Apache and PHP FPM." \
org.opencontainers.image.authors="The phpMyAdmin Team <developers@phpmyadmin.net>" \
org.opencontainers.image.vendor="phpMyAdmin" \
org.opencontainers.image.documentation="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.licenses="GPL-2.0-only" \
org.opencontainers.image.version="${VERSION}" \
org.opencontainers.image.url="https://github.com/phpmyadmin/docker#readme" \
org.opencontainers.image.source="https://github.com/phpmyadmin/docker.git"
# Download tarball, verify it using gpg and extract
RUN set -ex; \
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl -fsSL -o phpMyAdmin.tar.xz $URL; \
curl -fsSL -o phpMyAdmin.tar.xz.asc $URL.asc; \
echo "$SHA256 *phpMyAdmin.tar.xz" | sha256sum -c -; \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.openpgp.org --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /var/www/html --strip-components=1; \
mkdir -p /var/www/html/tmp; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
rm -r -v /var/www/html/setup/ /var/www/html/examples/ /var/www/html/js/src/ /var/www/html/babel.config.json /var/www/html/doc/html/_sources/ /var/www/html/RELEASE-DATE-$VERSION /var/www/html/CONTRIBUTING.md; \
grep -q -F "'configFile' => ROOT_PATH . 'config.inc.php'," /var/www/html/libraries/vendor_config.php; \
sed -i "s@'configFile' => .*@'configFile' => '/etc/phpmyadmin/config.inc.php',@" /var/www/html/libraries/vendor_config.php; \
grep -q -F "'configFile' => '/etc/phpmyadmin/config.inc.php'," /var/www/html/libraries/vendor_config.php; \
php -l /var/www/html/libraries/vendor_config.php; \
find /var/www/html -type d -exec chmod 555 {} \;; \
find /var/www/html -type f -exec chmod 444 {} \;; \
chmod 1777 /var/www/html/tmp;
# Copy configuration
COPY --chown=www-data:www-data config.inc.php /etc/phpmyadmin/config.inc.php
COPY --chown=www-data:www-data helpers.php /etc/phpmyadmin/helpers.php
# Copy main script
COPY docker-entrypoint.sh /docker-entrypoint.sh
USER root
ENTRYPOINT [ "/docker-entrypoint.sh" ]
CMD ["php-fpm"]
+246
View File
@@ -0,0 +1,246 @@
<?php
require_once '/etc/phpmyadmin/config.secret.inc.php';
require_once '/etc/phpmyadmin/helpers.php';
/* Ensure we got the environment */
$vars = [
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_VERBOSE',
'PMA_VERBOSES',
'PMA_PORT',
'PMA_PORTS',
'PMA_SOCKET',
'PMA_SOCKETS',
'PMA_USER',
'PMA_PASSWORD',
'PMA_ABSOLUTE_URI',
'PMA_CONTROLHOST',
'PMA_CONTROLPORT',
'PMA_PMADB',
'PMA_CONTROLUSER',
'PMA_CONTROLPASS',
'PMA_QUERYHISTORYDB',
'PMA_QUERYHISTORYMAX',
'MAX_EXECUTION_TIME',
'MEMORY_LIMIT',
'PMA_UPLOADDIR',
'PMA_SAVEDIR',
'PMA_SSL',
'PMA_SSLS',
'PMA_SSL_DIR',
'PMA_SSL_VERIFY',
'PMA_SSL_VERIFIES',
'PMA_SSL_CA',
'PMA_SSL_CAS',
'PMA_SSL_CA_BASE64',
'PMA_SSL_CAS_BASE64',
'PMA_SSL_KEY',
'PMA_SSL_KEYS',
'PMA_SSL_KEY_BASE64',
'PMA_SSL_KEYS_BASE64',
'PMA_SSL_CERT',
'PMA_SSL_CERTS',
'PMA_SSL_CERT_BASE64',
'PMA_SSL_CERTS_BASE64',
];
foreach ($vars as $var) {
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
if (! defined('PMA_SSL_DIR')) {
define('PMA_SSL_DIR', $_ENV['PMA_SSL_DIR'] ?? '/etc/phpmyadmin/ssl');
}
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
$cfg['QueryHistoryDB'] = (bool) $_ENV['PMA_QUERYHISTORYDB'];
}
if (isset($_ENV['PMA_QUERYHISTORYMAX'])) {
$cfg['QueryHistoryMax'] = (int) $_ENV['PMA_QUERYHISTORYMAX'];
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
$cfg['AllowArbitraryServer'] = true;
}
/* Play nice behind reverse proxys */
if (isset($_ENV['PMA_ABSOLUTE_URI'])) {
$cfg['PmaAbsoluteUri'] = trim($_ENV['PMA_ABSOLUTE_URI']);
}
if (isset($_ENV['PMA_SSL_CA_BASE64'])) {
$_ENV['PMA_SSL_CA'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CA_BASE64'], 'phpmyadmin-ssl-CA', 'pem', PMA_SSL_DIR);
}
/* Decode and save the SSL key from base64 */
if (isset($_ENV['PMA_SSL_KEY_BASE64'])) {
$_ENV['PMA_SSL_KEY'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_KEY_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save the SSL certificate from base64 */
if (isset($_ENV['PMA_SSL_CERT_BASE64'])) {
$_ENV['PMA_SSL_CERT'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CERT_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save multiple SSL CA certificates from base64 */
if (isset($_ENV['PMA_SSL_CAS_BASE64'])) {
$_ENV['PMA_SSL_CAS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CAS_BASE64'], 'phpmyadmin-ssl-CA', 'pem', PMA_SSL_DIR);
}
/* Decode and save multiple SSL keys from base64 */
if (isset($_ENV['PMA_SSL_KEYS_BASE64'])) {
$_ENV['PMA_SSL_KEYS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_KEYS_BASE64'], 'phpmyadmin-ssl-CERT', 'cert', PMA_SSL_DIR);
}
/* Decode and save multiple SSL certificates from base64 */
if (isset($_ENV['PMA_SSL_CERTS_BASE64'])) {
$_ENV['PMA_SSL_CERTS'] = decodeBase64AndSaveFiles($_ENV['PMA_SSL_CERTS_BASE64'], 'phpmyadmin-ssl-KEY', 'key', PMA_SSL_DIR);
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = ['db'];
/* Set by environment */
if (! empty($_ENV['PMA_HOST'])) {
$hosts = [$_ENV['PMA_HOST']];
$verbose = [$_ENV['PMA_VERBOSE']];
$ports = [$_ENV['PMA_PORT']];
$ssls = [$_ENV['PMA_SSL']];
$ssl_verifies = [$_ENV['PMA_SSL_VERIFY']];
$ssl_cas = [$_ENV['PMA_SSL_CA']];
$ssl_keys = [$_ENV['PMA_SSL_KEY']];
$ssl_certs = [$_ENV['PMA_SSL_CERT']];
} elseif (! empty($_ENV['PMA_HOSTS'])) {
$hosts = array_map('trim', explode(',', $_ENV['PMA_HOSTS']));
$verbose = array_map('trim', explode(',', $_ENV['PMA_VERBOSES']));
$ports = array_map('trim', explode(',', $_ENV['PMA_PORTS']));
$ssls = array_map('trim', explode(',', $_ENV['PMA_SSLS']));
$ssl_verifies = array_map('trim', explode(',', $_ENV['PMA_SSL_VERIFIES']));
$ssl_cas = array_map('trim', explode(',', $_ENV['PMA_SSL_CAS']));
$ssl_keys = array_map('trim', explode(',', $_ENV['PMA_SSL_KEYS']));
$ssl_certs = array_map('trim', explode(',', $_ENV['PMA_SSL_CERTS']));
}
if (! empty($_ENV['PMA_SOCKET'])) {
$sockets = [$_ENV['PMA_SOCKET']];
} elseif (! empty($_ENV['PMA_SOCKETS'])) {
$sockets = explode(',', $_ENV['PMA_SOCKETS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
if (isset($ssls[$i - 1]) && $ssls[$i - 1] === '1') {
$cfg['Servers'][$i]['ssl'] = $ssls[$i - 1];
}
if (isset($ssl_verifies[$i - 1]) && $ssl_verifies[$i - 1] === '1') {
$cfg['Servers'][$i]['ssl_verify'] = $ssl_verifies[$i - 1];
}
if (isset($ssl_cas[$i - 1])) {
$cfg['Servers'][$i]['ssl_ca'] = $ssl_cas[$i - 1];
}
if (isset($ssl_keys[$i - 1])) {
$cfg['Servers'][$i]['ssl_key'] = $ssl_keys[$i - 1];
}
if (isset($ssl_certs[$i - 1])) {
$cfg['Servers'][$i]['ssl_cert'] = $ssl_certs[$i - 1];
}
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($verbose[$i - 1])) {
$cfg['Servers'][$i]['verbose'] = $verbose[$i - 1];
}
if (isset($ports[$i - 1])) {
$cfg['Servers'][$i]['port'] = $ports[$i - 1];
}
if (isset($_ENV['PMA_USER'])) {
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = $_ENV['PMA_USER'];
$cfg['Servers'][$i]['password'] = isset($_ENV['PMA_PASSWORD']) ? $_ENV['PMA_PASSWORD'] : '';
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
if (isset($_ENV['PMA_PMADB'])) {
$cfg['Servers'][$i]['pmadb'] = $_ENV['PMA_PMADB'];
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
}
if (isset($_ENV['PMA_CONTROLHOST'])) {
$cfg['Servers'][$i]['controlhost'] = $_ENV['PMA_CONTROLHOST'];
}
if (isset($_ENV['PMA_CONTROLPORT'])) {
$cfg['Servers'][$i]['controlport'] = $_ENV['PMA_CONTROLPORT'];
}
if (isset($_ENV['PMA_CONTROLUSER'])) {
$cfg['Servers'][$i]['controluser'] = $_ENV['PMA_CONTROLUSER'];
}
if (isset($_ENV['PMA_CONTROLPASS'])) {
$cfg['Servers'][$i]['controlpass'] = $_ENV['PMA_CONTROLPASS'];
}
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
}
// Avoid overwriting the last server id $i, use another variable name
for ($socketHostId = 1; isset($sockets[$socketHostId - 1]); $socketHostId++) {
$cfg['Servers'][$socketHostId]['socket'] = $sockets[$socketHostId - 1];
$cfg['Servers'][$socketHostId]['host'] = 'localhost';
}
/*
* Revert back to last configured server to make
* it easier in config.user.inc.php
*/
$i--;
/* Uploads setup */
if (isset($_ENV['PMA_UPLOADDIR'])) {
$cfg['UploadDir'] = $_ENV['PMA_UPLOADDIR'];
}
if (isset($_ENV['PMA_SAVEDIR'])) {
$cfg['SaveDir'] = $_ENV['PMA_SAVEDIR'];
}
if (isset($_ENV['MAX_EXECUTION_TIME'])) {
$cfg['ExecTimeLimit'] = $_ENV['MAX_EXECUTION_TIME'];
}
if (isset($_ENV['MEMORY_LIMIT'])) {
$cfg['MemoryLimit'] = $_ENV['MEMORY_LIMIT'];
}
/* Include User Defined Settings Hook */
if (file_exists('/etc/phpmyadmin/config.user.inc.php')) {
include '/etc/phpmyadmin/config.user.inc.php';
}
/* Support additional configurations */
if (is_dir('/etc/phpmyadmin/conf.d/')) {
foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename) {
include $filename;
}
}
+55
View File
@@ -0,0 +1,55 @@
#!/bin/bash
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ]; then
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
EOT
fi
chgrp www-data /etc/phpmyadmin/config.secret.inc.php
if [ ! -f /etc/phpmyadmin/config.user.inc.php ]; then
touch /etc/phpmyadmin/config.user.inc.php
fi
fi
if [ ! -z "${HIDE_PHP_VERSION}" ]; then
echo "PHP version is now hidden."
echo -e 'expose_php = Off\n' > $PHP_INI_DIR/conf.d/phpmyadmin-hide-php-version.ini
fi
if [ ! -z "${PMA_CONFIG_BASE64}" ]; then
echo "Adding the custom config.inc.php from base64."
echo "${PMA_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.inc.php
fi
if [ ! -z "${PMA_USER_CONFIG_BASE64}" ]; then
echo "Adding the custom config.user.inc.php from base64."
echo "${PMA_USER_CONFIG_BASE64}" | base64 -d > /etc/phpmyadmin/config.user.inc.php
fi
get_docker_secret() {
local env_var="${1}"
local env_var_file="${env_var}_FILE"
# Check if the variable with name $env_var_file (which is $PMA_PASSWORD_FILE for example)
# is not empty and export $PMA_PASSWORD as the password in the Docker secrets file
if [[ -n "${!env_var_file}" ]]; then
export "${env_var}"="$(cat "${!env_var_file}")"
fi
}
get_docker_secret PMA_USER
get_docker_secret PMA_PASSWORD
get_docker_secret MYSQL_ROOT_PASSWORD
get_docker_secret MYSQL_PASSWORD
get_docker_secret PMA_HOSTS
get_docker_secret PMA_HOST
get_docker_secret PMA_CONTROLHOST
get_docker_secret PMA_CONTROLUSER
get_docker_secret PMA_CONTROLPASS
exec "$@"
+51
View File
@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
/**
* Helper function to decode and save multiple SSL files from base64.
*
* @param string $base64FilesContents The base64 encoded string containing multiple files separated by commas.
* If no commas are present, the entire string is treated as a single file.
* @param string $prefix The prefix to use for the generated file names.
* @param string $extension The file extension to use for the generated files.
* @param string $storageFolder The folder where to store the generated files.
*
* @return string A comma-separated list of paths to the generated files.
*/
function decodeBase64AndSaveFiles(string $base64FilesContents, string $prefix, string $extension, string $storageFolder): string
{
// Ensure the output directory exists
if (! is_dir($storageFolder)) {
mkdir($storageFolder, 0755, true);
}
// Split the base64 string into an array of files
$base64FilesContents = explode(',', trim($base64FilesContents));
$counter = 1;
$outputFiles = [];
// Process each file
foreach ($base64FilesContents as $base64FileContent) {
$outputFile = $storageFolder . '/' . $prefix . '-' . $counter . '.' . $extension;
$fileContent = base64_decode($base64FileContent, true);
if ($fileContent === false) {
echo 'Failed to decode: ' . $base64FileContent;
exit(1);
}
// Write the decoded file to the output directory
if (file_put_contents($outputFile, $fileContent) === false) {
echo 'Failed to write to ' . $outputFile;
exit(1);
}
// Add the output file path to the list
$outputFiles[] = $outputFile;
$counter++;
}
// Return a comma-separated list of the generated file paths
return implode(',', $outputFiles);
}
+95
View File
@@ -0,0 +1,95 @@
#!/usr/bin/env bash
set -Eeuo pipefail
self="$(basename "$BASH_SOURCE")"
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")"
# get the most recent commit which modified any of "$@"
fileCommit() {
git log -1 --format='format:%H' HEAD -- "$@"
}
# get the most recent commit which modified "$1/Dockerfile" or any file COPY'd from "$1/Dockerfile"
dirCommit() {
local dir="$1"; shift
(
cd "$dir"
fileCommit \
Dockerfile \
$(git show HEAD:./Dockerfile | awk '
toupper($1) == "COPY" {
for (i = 2; i < NF; i++) {
print $i
}
}
')
)
}
getArches() {
local repo="$1"; shift
local officialImagesUrl='https://github.com/docker-library/official-images/raw/master/library/'
eval "declare -A -g parentRepoToArches=( $(
find -name 'Dockerfile' -exec awk '
toupper($1) == "FROM" && $2 !~ /^('"$repo"'|scratch|.*\/.*)(:|$)/ {
print "'"$officialImagesUrl"'" $2
}
' '{}' + \
| sort -u \
| xargs bashbrew cat --format '[{{ .RepoName }}:{{ .TagName }}]="{{ join " " .TagEntry.Architectures }}"'
) )"
}
getArches 'phpmyadmin'
if ! command -v bashbrew --version &> /dev/null
then
echo "bashbrew could not be found"
echo "You can download it from Jenkins at https://github.com/docker-library/bashbrew#installing"
exit 1
fi
cat <<-EOH
# This file is generated via https://github.com/phpmyadmin/docker/blob/$(fileCommit "$self")/$self
Maintainers: Isaac Bennetch <bennetch@gmail.com> (@ibennetch),
William Desportes <williamdes@wdes.fr> (@williamdes)
GitRepo: https://github.com/phpmyadmin/docker.git
EOH
# prints "$2$1$3$1...$N"
join() {
local sep="$1"; shift
local out; printf -v out "${sep//%/%%}%s" "$@"
echo "${out#$sep}"
}
latest="$(curl -fsSL 'https://www.phpmyadmin.net/home_page/version.json' | jq -r '.version' | grep -E '^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$')"
for variant in apache fpm fpm-alpine; do
commit="$(dirCommit "$variant")"
fullversion="$(git show "$commit":"$variant/Dockerfile" | awk -F" |=" '$1 == "ENV" && $2 == "VERSION" { print $3; exit }')"
versionAliases=( "$fullversion" "${fullversion%.*}" "${fullversion%.*.*}" )
if [ "$fullversion" = "$latest" ]; then
versionAliases+=( "latest" )
fi
variantAliases=( "${versionAliases[@]/%/-$variant}" )
variantAliases=( "${variantAliases[@]//latest-}" )
if [ "$variant" = "apache" ]; then
variantAliases+=( "${versionAliases[@]}" )
fi
variantParent="$(awk 'toupper($1) == "FROM" { print $2 }' "$variant/Dockerfile")"
variantArches="${parentRepoToArches[$variantParent]}"
cat <<-EOE
Tags: $(join ', ' "${variantAliases[@]}")
Architectures: $(join ', ' $variantArches)
GitCommit: $commit
Directory: $variant
EOE
done
+51
View File
@@ -0,0 +1,51 @@
<?php
declare(strict_types=1);
/**
* Helper function to decode and save multiple SSL files from base64.
*
* @param string $base64FilesContents The base64 encoded string containing multiple files separated by commas.
* If no commas are present, the entire string is treated as a single file.
* @param string $prefix The prefix to use for the generated file names.
* @param string $extension The file extension to use for the generated files.
* @param string $storageFolder The folder where to store the generated files.
*
* @return string A comma-separated list of paths to the generated files.
*/
function decodeBase64AndSaveFiles(string $base64FilesContents, string $prefix, string $extension, string $storageFolder): string
{
// Ensure the output directory exists
if (! is_dir($storageFolder)) {
mkdir($storageFolder, 0755, true);
}
// Split the base64 string into an array of files
$base64FilesContents = explode(',', trim($base64FilesContents));
$counter = 1;
$outputFiles = [];
// Process each file
foreach ($base64FilesContents as $base64FileContent) {
$outputFile = $storageFolder . '/' . $prefix . '-' . $counter . '.' . $extension;
$fileContent = base64_decode($base64FileContent, true);
if ($fileContent === false) {
echo 'Failed to decode: ' . $base64FileContent;
exit(1);
}
// Write the decoded file to the output directory
if (file_put_contents($outputFile, $fileContent) === false) {
echo 'Failed to write to ' . $outputFile;
exit(1);
}
// Add the output file path to the list
$outputFiles[] = $outputFile;
$counter++;
}
// Return a comma-separated list of the generated file paths
return implode(',', $outputFiles);
}
Executable
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
# This file is used by docker hub to build the image
docker build -t $IMAGE_NAME .
Binary file not shown.
-19
View File
@@ -1,19 +0,0 @@
#!/bin/sh
set -x
if [ ! -f /www/config.secret.inc.php ] ; then
cat > /www/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '`cat /dev/urandom | tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' | fold -w 32 | head -n 1`';
EOT
fi
if [ ! -f /config.user.inc.php ] ; then
touch /config.user.inc.php
fi
exec php -S 0.0.0.0:80 -t /www/ \
-d upload_max_filesize=$PHP_UPLOAD_MAX_FILESIZE \
-d post_max_size=$PHP_UPLOAD_MAX_FILESIZE \
-d max_input_vars=$PHP_MAX_INPUT_VARS \
-d session.save_path=/sessions
+9
View File
@@ -0,0 +1,9 @@
# Testing image for phpMyAdmin
FROM alpine:3.21
# Install test dependencies
RUN set -ex; \
\
apk add --no-cache --update mariadb-client mariadb-connector-c bash \
py3-html5lib py3-pytest py3-mechanize curl
+2
View File
@@ -0,0 +1,2 @@
<?php
$cfg['AllowArbitraryServer'] = true;
+3
View File
@@ -0,0 +1,3 @@
<?php
$cfg['ShowPhpInfo'] = true;
+33
View File
@@ -0,0 +1,33 @@
import pytest
def pytest_addoption(parser):
parser.addoption("--url")
parser.addoption("--username")
parser.addoption("--password")
parser.addoption("--root-password")
parser.addoption("--server")
parser.addoption("--sqlfile")
@pytest.fixture
def url(request):
return request.config.getoption("--url")
@pytest.fixture
def username(request):
return request.config.getoption("--username")
@pytest.fixture
def password(request):
return request.config.getoption("--password")
@pytest.fixture
def root_password(request):
return request.config.getoption("--root-password")
@pytest.fixture
def server(request):
return request.config.getoption("--server")
@pytest.fixture
def sqlfile(request):
return request.config.getoption("--sqlfile")
@@ -0,0 +1,69 @@
version: "3.1"
services:
db_server:
image: ${DB:-mariadb:10.11}
environment:
MARIADB_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"]
start_period: 10s
interval: 5s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_db
tmpfs:
- /var/lib/mysql:rw,noexec,nosuid,size=300m
phpmyadmin:
build:
context: ../../apache
environment:
PMA_HOST: db_server
UPLOAD_LIMIT: 123M
MAX_EXECUTION_TIME: 125
HIDE_PHP_VERSION: 1
volumes:
- ../config.user.inc.php:/etc/phpmyadmin/conf.d/config.test.php:ro
healthcheck:
test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"]
start_period: 5s
interval: 3s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_apache
depends_on:
db_server:
condition: service_healthy
sut:
depends_on:
phpmyadmin:
condition: service_healthy
db_server:
condition: service_healthy
build:
context: ../
command: "/tests/testing/test-docker.sh"
networks:
testing:
environment:
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
TESTSUITE_PORT: 80
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
PMA_HOST: phpmyadmin_testing_db
PMA_PORT: 3306
volumes:
- ../../:/tests:ro
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /tests
networks:
testing:
driver: bridge
@@ -0,0 +1,69 @@
version: "3.1"
services:
db_server:
image: ${DB:-mariadb:10.11}
environment:
MARIADB_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"]
start_period: 10s
interval: 5s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_db
tmpfs:
- /var/lib/mysql:rw,noexec,nosuid,size=300m
phpmyadmin:
build:
context: ../../apache
environment:
PMA_ARBITRARY: 1
UPLOAD_LIMIT: 123M
MAX_EXECUTION_TIME: 125
HIDE_PHP_VERSION: 1
volumes:
- ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro
healthcheck:
test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"]
start_period: 5s
interval: 3s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_apache
depends_on:
db_server:
condition: service_healthy
sut:
depends_on:
phpmyadmin:
condition: service_healthy
db_server:
condition: service_healthy
build:
context: ../
command: "/tests/testing/test-docker.sh"
networks:
testing:
environment:
TESTSUITE_HOSTNAME_ARBITRARY: 1
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
PMA_HOST: phpmyadmin_testing_db
TESTSUITE_PORT: 80
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
volumes:
- ../../:/tests:ro
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /tests
networks:
testing:
driver: bridge
@@ -0,0 +1,70 @@
version: "3.1"
services:
db_server:
image: ${DB:-mariadb:10.11}
environment:
MARIADB_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"]
start_period: 10s
interval: 5s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_db
tmpfs:
- /var/lib/mysql:rw,noexec,nosuid,size=300m
phpmyadmin:
build:
context: ../../apache
environment:
PMA_HOST: db_server
UPLOAD_LIMIT: 123M
MAX_EXECUTION_TIME: 125
HIDE_PHP_VERSION: 1
APACHE_PORT: 8090
volumes:
- ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro
healthcheck:
test: ["CMD", "curl", "-Ss", "http://localhost:8090/robots.txt"]
start_period: 5s
interval: 3s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_apache
depends_on:
db_server:
condition: service_healthy
sut:
depends_on:
phpmyadmin:
condition: service_healthy
db_server:
condition: service_healthy
build:
context: ../
command: "/tests/testing/test-docker.sh"
networks:
testing:
environment:
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
TESTSUITE_PORT: 8090
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
PMA_HOST: phpmyadmin_testing_db
PMA_PORT: 3306
volumes:
- ../../:/tests:ro
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /tests
networks:
testing:
driver: bridge
@@ -0,0 +1,80 @@
version: "3.1"
services:
db_server:
image: ${DB:-mariadb:10.11}
environment:
MARIADB_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"]
start_period: 10s
interval: 5s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_db
tmpfs:
- /var/lib/mysql:rw,noexec,nosuid,size=300m
phpmyadmin:
build:
context: ../../apache
environment:
PMA_HOST: db_server
UPLOAD_LIMIT: 123M
MAX_EXECUTION_TIME: 125
HIDE_PHP_VERSION: 1
PMA_UPLOADDIR: /etc/phpmyadmin/imports
PMA_SAVEDIR: /etc/phpmyadmin/exports
volumes:
- ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro
- phpmyadmin-data:/etc/phpmyadmin/imports:ro
- phpmyadmin-data:/etc/phpmyadmin/exports
healthcheck:
test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"]
start_period: 5s
interval: 3s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_apache
depends_on:
db_server:
condition: service_healthy
sut:
depends_on:
phpmyadmin:
condition: service_healthy
db_server:
condition: service_healthy
build:
context: ../
command: "/tests/testing/test-docker.sh"
networks:
testing:
environment:
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
TESTSUITE_PORT: 80
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
PMA_HOST: phpmyadmin_testing_db
PMA_PORT: 3306
PMA_UPLOADDIR: /etc/phpmyadmin/imports
PMA_SAVEDIR: /etc/phpmyadmin/exports
volumes:
- ../../:/tests:ro
- /var/run/docker.sock:/var/run/docker.sock
- phpmyadmin-data:/etc/phpmyadmin/imports
- phpmyadmin-data:/etc/phpmyadmin/exports
working_dir: /tests
networks:
testing:
driver: bridge
volumes:
phpmyadmin-data:
@@ -0,0 +1,69 @@
version: "3.1"
services:
db_server:
image: ${DB:-mariadb:10.11}
environment:
MARIADB_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"]
start_period: 10s
interval: 5s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_db
tmpfs:
- /var/lib/mysql:rw,noexec,nosuid,size=300m
phpmyadmin:
build:
context: ../../apache
environment:
PMA_HOST: db_server
UPLOAD_LIMIT: 123M
MAX_EXECUTION_TIME: 125
HIDE_PHP_VERSION: 1
volumes:
- ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro
healthcheck:
test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"]
start_period: 5s
interval: 3s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_apache
depends_on:
db_server:
condition: service_healthy
sut:
depends_on:
phpmyadmin:
condition: service_healthy
db_server:
condition: service_healthy
build:
context: ../
command: "/tests/testing/test-docker.sh"
networks:
testing:
environment:
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
TESTSUITE_PORT: 80
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
PMA_HOST: phpmyadmin_testing_db
PMA_PORT: 3306
volumes:
- ../../:/tests:ro
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /tests
networks:
testing:
driver: bridge
@@ -0,0 +1,75 @@
version: "3.1"
services:
db_server:
image: ${DB:-mariadb:10.11}
environment:
MARIADB_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"]
start_period: 10s
interval: 5s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_db
tmpfs:
- /var/lib/mysql:rw,noexec,nosuid,size=300m
volumes:
- db-socket:/run/mysqld/
phpmyadmin:
build:
context: ../../apache
environment:
PMA_SOCKET: /run/mysqld/mysqld.sock
UPLOAD_LIMIT: 123M
MAX_EXECUTION_TIME: 125
HIDE_PHP_VERSION: 1
volumes:
- ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro
- db-socket:/run/mysqld/
healthcheck:
test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"]
start_period: 5s
interval: 3s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_apache
depends_on:
db_server:
condition: service_healthy
sut:
depends_on:
phpmyadmin:
condition: service_healthy
db_server:
condition: service_healthy
build:
context: ../
command: "/tests/testing/test-docker.sh"
networks:
testing:
environment:
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
TESTSUITE_PORT: 80
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
PMA_HOST: phpmyadmin_testing_db
PMA_PORT: 3306
volumes:
- ../../:/tests:ro
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /tests
networks:
testing:
driver: bridge
volumes:
db-socket:
@@ -0,0 +1,99 @@
version: "3.1"
services:
db_server:
image: ${DB:-mariadb:11}
command:
- "--ssl-ca=/etc/phpmyadmin/ssl/ca-cert.pem"
- "--ssl-cert=/etc/phpmyadmin/ssl/server-cert.pem"
- "--ssl-key=/etc/phpmyadmin/ssl/server-key.pem"
- "--require-secure-transport=ON"
environment:
MARIADB_USER: secure-user
MARIADB_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
MARIADB_ROOT_PASSWORD: "${TESTSUITE_ROOT_PASSWORD:-random-pass}"
# The database name used in the import test
MARIADB_DATABASE: World
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-uroot", "-prandom-pass"]
start_period: 10s
interval: 5s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- mariadb.phpmyadmin.local
tmpfs:
- /var/lib/mysql:rw,noexec,nosuid,size=300m
volumes:
#- ../secure-user.sql:/docker-entrypoint-initdb.d/secure-user.sql:ro
- ../ca-cert.pem:/etc/phpmyadmin/ssl/ca-cert.pem:ro
- ../ca-key.pem:/etc/phpmyadmin/ssl/ca-key.pem:ro
- ../server-cert.pem:/etc/phpmyadmin/ssl/server-cert.pem:ro
- ../server-key.pem:/etc/phpmyadmin/ssl/server-key.pem:ro
#- ../mariadb-audit:/var/log/mariadb-audit
phpmyadmin:
build:
context: ../../apache
environment:
PMA_HOST: mariadb.phpmyadmin.local
PMA_SSL: 1
PMA_SSL_VERIFY: 1
PMA_SSL_CA: /etc/phpmyadmin/ssl/ca-cert.pem
PMA_SSL_CERT: /etc/phpmyadmin/ssl/client-cert.pem
PMA_SSL_KEY: /etc/phpmyadmin/ssl/client-key.pem
UPLOAD_LIMIT: 123M
MAX_EXECUTION_TIME: 125
HIDE_PHP_VERSION: 1
volumes:
- ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro
- ../ca-cert.pem:/etc/phpmyadmin/ssl/ca-cert.pem:ro
- ../client-cert.pem:/etc/phpmyadmin/ssl/client-cert.pem:ro
- ../client-key.pem:/etc/phpmyadmin/ssl/client-key.pem:ro
healthcheck:
test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"]
start_period: 5s
interval: 3s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_apache
depends_on:
db_server:
condition: service_healthy
sut:
depends_on:
phpmyadmin:
condition: service_healthy
db_server:
condition: service_healthy
build:
context: ../
command: "/tests/testing/test-docker.sh"
networks:
testing:
environment:
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
TESTSUITE_PORT: 80
TESTSUITE_USER: secure-user
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
TESTSUITE_ROOT_PASSWORD: "${TESTSUITE_ROOT_PASSWORD:-random-pass}"
PMA_HOST: mariadb.phpmyadmin.local
PMA_PORT: 3306
IS_USING_SSL: true
volumes:
- ../ca-cert.pem:/etc/phpmyadmin/ssl/ca-cert.pem:ro
- ../server-cert.pem:/etc/phpmyadmin/ssl/server-cert.pem:ro
- ../client-cert.pem:/etc/phpmyadmin/ssl/client-cert.pem:ro
- ../client-key.pem:/etc/phpmyadmin/ssl/client-key.pem:ro
- ../../:/tests:ro
working_dir: /tests
networks:
testing:
driver: bridge
@@ -0,0 +1,76 @@
services:
db_server:
image: ${DB:-mariadb:10.11}
# mysql:mysql in MariaDB for Docker (https://stackoverflow.com/a/55241769/5155484)
user: 999:999
environment:
MARIADB_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
healthcheck:
test: ["CMD", "mariadb-admin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"]
start_period: 10s
interval: 5s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_db
volumes:
- mariadb-data:/var/lib/mysql
phpmyadmin:
build:
context: ../../apache
# www-data:www-data in Debian (https://stackoverflow.com/a/69290889/5155484)
user: 33:33
environment:
PMA_HOST: db_server
UPLOAD_LIMIT: 123M
MAX_EXECUTION_TIME: 125
volumes:
- ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro
healthcheck:
test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"]
start_period: 5s
interval: 3s
timeout: 60s
retries: 10
networks:
testing:
aliases:
- phpmyadmin_testing_apache
depends_on:
db_server:
condition: service_healthy
sut:
# nobody:nobody
user: 65534:65534
depends_on:
phpmyadmin:
condition: service_healthy
db_server:
condition: service_healthy
build:
context: ../
command: "/tests/testing/test-docker.sh"
networks:
testing:
environment:
TESTSUITE_HOSTNAME: phpmyadmin_testing_apache
TESTSUITE_PORT: 80
TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}"
PMA_HOST: phpmyadmin_testing_db
PMA_PORT: 3306
SKIP_EXPOSE_PHP_TEST: true
volumes:
- ../../:/tests:ro
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /tests
networks:
testing:
driver: bridge
volumes:
mariadb-data:
+37
View File
@@ -0,0 +1,37 @@
#!/bin/sh
set -eu
# Source: https://github.com/chio-nzgft/docker-MariaDB-with-SSL
# See: https://dev.mysql.com/doc/refman/5.7/en/creating-ssl-files-using-openssl.html
ROOT_DIR="$(realpath $(dirname $0))"
echo "Using root dir: $ROOT_DIR"
cd "$ROOT_DIR"
rm -f *.pem
SUBJECT_CA="/C=US/O=phpMyAdmin testing/OU=Docker/CN=ssl-ca.phpmyadmin.local/emailAddress=ssl-ca@example.org"
SUBJECT_CLIENT="/C=US/O=phpMyAdmin testing/OU=Docker/CN=client.phpmyadmin.local/emailAddress=secure-user@example.org"
SUBJECT_SERVER="/C=US/O=phpMyAdmin testing/OU=Docker/CN=mariadb.phpmyadmin.local"
echo "CA key"
openssl genrsa 2048 > ca-key.pem
openssl req -new -x509 -nodes -days 3600 -subj "${SUBJECT_CA}" -key ca-key.pem -out ca-cert.pem
echo "server key"
openssl req -subj "${SUBJECT_SERVER}" -newkey rsa:2048 -days 3600 -nodes -keyout server-key.pem -out server-req.pem
openssl rsa -in server-key.pem -out server-key.pem
openssl x509 -req -in server-req.pem -days 3600 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out server-cert.pem
echo "client key"
openssl req -subj "${SUBJECT_CLIENT}" -newkey rsa:2048 -days 3600 -nodes -keyout client-key.pem -out client-req.pem
openssl rsa -in client-key.pem -out client-key.pem
openssl x509 -req -in client-req.pem -days 3600 -CA ca-cert.pem -CAkey ca-key.pem -set_serial 01 -out client-cert.pem
echo "check key ok"
openssl verify -CAfile ca-cert.pem server-cert.pem client-cert.pem
chmod 666 *.pem
+212
View File
@@ -0,0 +1,212 @@
#!/usr/bin/env python3
import argparse
import os
import subprocess
import re
import sys
import mechanize
import tempfile
import pytest
def create_browser():
br = mechanize.Browser()
# Ignore robots.txt
br.set_handle_robots(False)
return br
def do_login(br, url, username, password, server):
# Login page
br.open(url)
# Fill login form
br.select_form('login_form')
br['pma_username'] = username
br['pma_password'] = password
if server is not None:
br['pma_servername'] = server
# Login and check if logged in
response = br.submit()
return response
def get_world_sql_path():
if os.path.exists('/world.sql'):
return '/world.sql'
elif os.path.exists('./world.sql'):
return './world.sql'
else:
path = os.path.dirname(os.path.realpath(__file__))
return path + '/world.sql'
def test_import(url, username, password, server, sqlfile):
if sqlfile is None:
sqlfile = get_world_sql_path()
br = create_browser()
response = do_login(br, url, username, password, server)
assert(b'Server version' in response.read())
# Open server import
response = br.follow_link(text_regex=re.compile('Import'))
assert(b'OpenDocument Spreadsheet' in response.read())
# Upload SQL file
br.select_form('import')
br.form.add_file(open(sqlfile), 'text/plain', sqlfile)
response = br.submit()
response = response.read()
assert(b'5326 queries executed' in response)
def docker_secret(env_name):
dir_path = os.path.dirname(os.path.realpath(__file__))
secret_file = tempfile.mkstemp()
password = "The_super_secret_password"
password_file = open(secret_file[1], 'wb')
password_file.write(str.encode(password))
password_file.close()
test_env = {env_name + '_FILE': secret_file[1]}
# Run entrypoint and afterwards echo the environment variables
result = subprocess.Popen("bash " +dir_path+ "/../docker-entrypoint.sh 'env'", shell=True, stdout=subprocess.PIPE, env=test_env)
output = result.stdout.read().decode()
assert (env_name + "=" + password) in output
def test_phpmyadmin_secrets():
docker_secret('MYSQL_PASSWORD')
docker_secret('MYSQL_ROOT_PASSWORD')
docker_secret('PMA_USER')
docker_secret('PMA_PASSWORD')
docker_secret('PMA_HOSTS')
docker_secret('PMA_HOST')
docker_secret('PMA_CONTROLHOST')
docker_secret('PMA_CONTROLUSER')
docker_secret('PMA_CONTROLPASS')
def test_is_using_ssl(url, username, password, server):
is_using_ssl = os.environ.get('IS_USING_SSL');
br = create_browser()
response = do_login(br, url, username, password, server)
response = response.read()
assert(b'Server connection' in response)
if is_using_ssl:
assert(b'SSL is used' in response)
assert(b'SSL is not being used' not in response)
else:
assert(b'SSL is used' not in response)
assert(b'SSL is not being used' in response)
def test_is_using_ssl_client_cert(url, server):
is_using_ssl = os.environ.get('IS_USING_SSL');
if not is_using_ssl:
pytest.skip("Missing IS_USING_SSL ENV", allow_module_level=True)
br = create_browser()
password = ""
response = do_login(br, url, "ssl-specific-user", password, server)
response = response.read()
assert(b'Server connection' in response)
assert(b'ssl-specific-user@' in response)
assert(b'SSL is used' in response)
assert(b'SSL is not being used' not in response)
def test_php_ini(url, username, password, server):
skip_expose_php_test = os.environ.get('SKIP_EXPOSE_PHP_TEST');
br = create_browser()
response = do_login(br, url, username, password, server)
response = response.read()
assert(b'Show PHP information' in response)
# Open Show PHP information
response = br.follow_link(text_regex=re.compile('Show PHP information'))
response = response.read()
assert(b'PHP Version' in response)
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)
assert(b'<tr><td class="e">upload_max_filesize</td><td class="v">123M</td><td class="v">123M</td></tr>' in response)
assert(b'<tr><td class="e">post_max_size</td><td class="v">123M</td><td class="v">123M</td></tr>' in response)
if not skip_expose_php_test:
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');
if not upload_dir:
pytest.skip("Missing PMA_UPLOADDIR ENV", allow_module_level=True)
# Copy file into the volume
with open(get_world_sql_path(), 'rb') as src, open(upload_dir + '/world-data.sql', 'wb') as dst:
dst.write(src.read())
br = create_browser()
response = do_login(br, url, username, password, server)
assert(b'Server version' in response.read())
# Open server import
response = br.follow_link(text_regex=re.compile('Import'))
response = response.read()
assert(b'Browse your computer:' in response)
assert(upload_dir.encode() in response)
assert(b'world-data.sql' in response)
def test_export_to_folder(url, username, password, server, sqlfile):
save_dir = os.environ.get('PMA_SAVEDIR');
if not save_dir:
pytest.skip("Missing PMA_SAVEDIR ENV", allow_module_level=True)
# Delete file from previous runs
if os.path.exists(save_dir + "/db_server.sql"):
os.remove(save_dir + "/db_server.sql")
assert os.path.exists(save_dir + "/db_server.sql") == False
# Avoid: "The web server does not have permission to save the file"
os.chmod(save_dir , 0o777)
br = create_browser()
response = do_login(br, url, username, password, server)
assert(b'Server version' in response.read())
# Open server export
response = br.follow_link(text_regex=re.compile('Export'))
response = response.read()
assert(b'Save on server in the directory' in response)
assert(save_dir.encode() in response)
br.select_form('dump')
br.find_control("quick_export_onserver").items[0].selected=True
response = br.submit()
response = response.read()
assert(b'Dump has been saved to file' in response)
assert(b'Dump has been saved to file /etc/phpmyadmin/exports/db_server.sql' in response)
assert os.path.exists(save_dir + "/db_server.sql") == True
View File
+106
View File
@@ -0,0 +1,106 @@
#!/bin/sh
set -eu
# Set phpMyAdmin environment
PHPMYADMIN_HOSTNAME=${TESTSUITE_HOSTNAME:=localhost}
PHPMYADMIN_PORT=${TESTSUITE_PORT:=80}
PHPMYADMIN_URL=http://${PHPMYADMIN_HOSTNAME}:${PHPMYADMIN_PORT}/
# Set database environment
PHPMYADMIN_DB_HOSTNAME=${PMA_HOST:=localhost}
PHPMYADMIN_DB_PORT=${PMA_PORT:=3306}
TESTSUITE_USER=${TESTSUITE_USER:=root}
TESTSUITE_ROOT_PASSWORD=${TESTSUITE_ROOT_PASSWORD:-}
SUBJECT_CA="/C=US/O=phpMyAdmin testing/OU=Docker/CN=ssl-ca.phpmyadmin.local/emailAddress=ssl-ca@example.org"
SUBJECT_CLIENT="/C=US/O=phpMyAdmin testing/OU=Docker/CN=client.phpmyadmin.local/emailAddress=secure-user@example.org"
if [ "${TESTSUITE_USER}" = "root" ] && [ -n "${TESTSUITE_ROOT_PASSWORD}" ]; then
echo "Do not use TESTSUITE_ROOT_PASSWORD with TESTSUITE_USER=root"
exit 1
fi
TEST_CLI_ARGS=""
if [ -n "${TESTSUITE_HOSTNAME_ARBITRARY:-}" ]; then
TEST_CLI_ARGS="$TEST_CLI_ARGS --server ${PHPMYADMIN_DB_HOSTNAME}"
fi
if [ -n "${TESTSUITE_ROOT_PASSWORD}" ]; then
TEST_CLI_ARGS="$TEST_CLI_ARGS --root-password ${TESTSUITE_ROOT_PASSWORD}"
fi
# Find test script
if [ -f ./phpmyadmin_test.py ] ; then
FILENAME=./phpmyadmin_test.py
else
FILENAME=./testing/phpmyadmin_test.py
fi
SSL_FLAG="--skip-ssl"
if [ -n "${IS_USING_SSL:-}" ]; then
SSL_FLAG="--ssl --ssl-verify-server-cert --ssl-ca=/etc/phpmyadmin/ssl/ca-cert.pem"
fi
mariadb $SSL_FLAG -h "${PHPMYADMIN_DB_HOSTNAME}" -P"${PHPMYADMIN_DB_PORT}" -u"$TESTSUITE_USER" -p"${TESTSUITE_PASSWORD}" -e "SELECT @@version;SHOW VARIABLES LIKE 'require_secure_transport';SHOW VARIABLES LIKE '%ssl%';"
if [ -n "${IS_USING_SSL:-}" ]; then
set +e
mariadb --skip-ssl -h "${PHPMYADMIN_DB_HOSTNAME}" -P"${PHPMYADMIN_DB_PORT}" -u"$TESTSUITE_USER" -p"${TESTSUITE_PASSWORD}" -e "SELECT @@version;SHOW VARIABLES LIKE 'require_secure_transport';" 1> /dev/null 2> /dev/null
if [ $? != 1 ]; then
echo "The server does not enforce SSL connections, stopping the test."
exit 1
fi
set -e
fi
if [ -n "${IS_USING_SSL:-}" ] && [ -n "${TESTSUITE_ROOT_PASSWORD}" ]; then
mariadb $SSL_FLAG -h "${PHPMYADMIN_DB_HOSTNAME}" -P"${PHPMYADMIN_DB_PORT}" -u"root" -p"${TESTSUITE_ROOT_PASSWORD}" \
-e "CREATE USER 'ssl-specific-user'@'%' REQUIRE SUBJECT '$SUBJECT_CLIENT' AND ISSUER '$SUBJECT_CA';"
set +e
mariadb $SSL_FLAG --ssl-cert=/etc/phpmyadmin/ssl/client-cert.pem --ssl-key=/etc/phpmyadmin/ssl/client-key.pem -h "${PHPMYADMIN_DB_HOSTNAME}" -P"${PHPMYADMIN_DB_PORT}" -u"ssl-specific-user" -e "SELECT @@version;SHOW VARIABLES LIKE 'require_secure_transport';" 1> /dev/null 2> /dev/null
if [ $? != 0 ]; then
echo "The server should accept the SSL client cert login, stopping the test."
exit 1
fi
set -e
set +e
mariadb $SSL_FLAG -h "${PHPMYADMIN_DB_HOSTNAME}" -P"${PHPMYADMIN_DB_PORT}" -u"ssl-specific-user" -e "SELECT @@version;SHOW VARIABLES LIKE 'require_secure_transport';" 1> /dev/null 2> /dev/null
if [ $? != 1 ]; then
echo "The server should refuse the login without a client cert, stopping the test."
exit 1
fi
set -e
fi
ret=$?
if [ $ret -ne 0 ] ; then
echo "Could not connect to ${PHPMYADMIN_DB_HOSTNAME} on port ${PHPMYADMIN_DB_PORT}"
exit $ret
fi
curl -fsSL --output /dev/null "${PHPMYADMIN_URL}"
ret=$?
if [ $ret -ne 0 ] ; then
echo "Could not connect to ${PHPMYADMIN_URL}"
exit $ret
fi
# Perform tests
ret=0
pytest -p no:cacheprovider -q --url "$PHPMYADMIN_URL" --username $TESTSUITE_USER --password "$TESTSUITE_PASSWORD" $TEST_CLI_ARGS $FILENAME
ret=$?
# Show debug output in case of failure
if [ $ret -ne 0 ] ; then
${COMMAND_HOST} ps faux
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: FAILED"
exit $ret
fi
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: SUCCESS"
+5395
View File
File diff suppressed because it is too large Load Diff
Executable
+101
View File
@@ -0,0 +1,101 @@
#!/bin/bash
set -eu -o pipefail
variants=(
apache
fpm
fpm-alpine
)
declare -A base=(
[apache]='debian'
[fpm]='debian'
[fpm-alpine]='alpine'
)
declare -A php_version=(
[default]='8.3'
)
declare -A cmd=(
[apache]='apache2-foreground'
[fpm]='php-fpm'
[fpm-alpine]='php-fpm'
)
gpg_key='3D06A59ECE730EB71B511C17CE752F178259BD92'
function download_url() {
echo "https://files.phpmyadmin.net/phpMyAdmin/$1/phpMyAdmin-$1-all-languages.tar.xz"
}
function create_variant() {
local variant="$1"
local version="$2"
local sha256="$3"
local branch="$(sed -ne 's/^\([0-9]*\.[0-9]*\)\..*$/\1/p' <<< "$version")"
local url="$(download_url "$version")"
local ascUrl="$(download_url "$version").asc"
local phpVersion="${php_version[$version]-${php_version[default]}}"
echo "updating $version [$branch] $variant"
# Create the variant directory with a Dockerfile
mkdir -p "$variant"
local template="Dockerfile-${base[$variant]}.template"
echo "# DO NOT EDIT: created by update.sh from $template" > "$variant/Dockerfile"
cat "$template" >> "$variant/Dockerfile"
# Replace Dockerfile variables
sed -ri -e '
s/%%VARIANT%%/'"$variant"'/;
s/%%VERSION%%/'"$version"'/;
s/%%SHA256%%/'"$sha256"'/;
s/%%DOWNLOAD_URL%%/'"$(sed -e 's/[\/&]/\\&/g' <<< "$url")"'/;
s/%%DOWNLOAD_URL_ASC%%/'"$(sed -e 's/[\/&]/\\&/g' <<< "$ascUrl")"'/;
s/%%PHP_VERSION%%/'"$phpVersion"'/g;
s/%%GPG_KEY%%/'"$gpg_key"'/g;
s/%%CMD%%/'"${cmd[$variant]}"'/;
' "$variant/Dockerfile"
# Copy docker-entrypoint.sh
cp docker-entrypoint.sh "$variant/docker-entrypoint.sh"
if [ "$variant" != "apache" ]; then
sed -i "/^# start: Apache specific settings$/,/^# end: Apache specific settings$/d" "$variant/docker-entrypoint.sh"
sed -i "/^\s*# start: Apache specific build$/,/^\s*# end: Apache specific build$/d" "$variant/Dockerfile"
fi
# Copy config.inc.php and helpers.php
cp config.inc.php "$variant/config.inc.php"
cp helpers.php "$variant/helpers.php"
# Add variant to versions.json
versionVariantsJson="$(jq -e \
--arg branch "$branch" --arg variant "$variant" --arg base "${base[$variant]}" --arg phpVersion "$phpVersion" \
'.[$branch].variants[$variant] = {"variant": $variant, "base": $base, "phpVersion": $phpVersion}' versions.json)"
versionJson="$(jq -e \
--arg branch "$branch" --arg version "$version" --arg sha256 "$sha256" --arg url "$url" --arg ascUrl "$ascUrl" --argjson variants "$versionVariantsJson" \
'.[$branch] = {"branch": $branch, "version": $version, "sha256": $sha256, "url": $url, "ascUrl": $ascUrl, "variants": $variants[$branch].variants}' versions.json)"
printf '%s\n' "$versionJson" > versions.json
}
# Check script dependencies
command -v curl >/dev/null 2>&1 || { echo >&2 "'curl' is required but not found. Aborting."; exit 1; }
command -v jq >/dev/null 2>&1 || { echo >&2 "'jq' is required but not found. Aborting."; exit 1; }
[ -n "${BASH_VERSINFO}" ] && [ -n "${BASH_VERSINFO[0]}" ] && [ ${BASH_VERSINFO[0]} -ge 4 ] \
|| { echo >&2 "Bash 4.0 or greater is required. Aborting."; exit 1; }
# Create variants
printf '%s\n' "{}" > versions.json
latest="$(curl -fsSL 'https://www.phpmyadmin.net/home_page/version.json' | jq -r '.version' | grep -E '^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$')"
sha256="$(curl -fsSL "$(download_url "$latest").sha256" | cut -f1 -d ' ' | tr -cd 'a-f0-9' | cut -c 1-64)"
for variant in "${variants[@]}"; do
create_variant "$variant" "$latest" "$sha256"
done
# Cleanup the file as for now it's not wanted in the repository
rm versions.json