Compare commits

...
240 Commits
Author SHA1 Message Date
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
25 changed files with 6169 additions and 138 deletions
+1
View File
@@ -4,3 +4,4 @@ docker-compose.testing.yml
README.md
LICENSE
Makefile
testing
+23
View File
@@ -0,0 +1,23 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before a stale Issue or Pull Request is closed
daysUntilClose: 7
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- pinned
- security
# Label to use when marking as stale
staleLabel: wontfix
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label. Set to `false` to disable
unmarkComment: false
# Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable
closeComment: false
# Limit to only `issues` or `pulls`
only: pulls
+23 -23
View File
@@ -1,41 +1,41 @@
sudo: required
services:
- docker
language: python
python:
- "2.7"
env:
matrix:
- DB=mysql:5.7
- DB=mariadb:10.0
- DB=mysql:latest
- DB=mariadb:10.2
before_install:
- docker run --name db_server -e MYSQL_ROOT_PASSWORD=my-secret-pw -d $DB
- export TESTSUITE_PASSWORD=`openssl rand -base64 30`
- docker run --name db_server -e MYSQL_ROOT_PASSWORD=$TESTSUITE_PASSWORD -v $PWD/testing/testing.cnf:/etc/mysql/conf.d/testing.cnf:ro -d $DB
install:
- pip install mechanize html5lib
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'
- ./testing/test-docker.sh testadmin 9090
# 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'
- ./testing/test-docker.sh envadmin 6060
# 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'
- docker run --name arbitraryadmin -d --link db_server:db3 -e PMA_ARBITRARY=1 -p 7070:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh arbitraryadmin 7070 db3
# Test for arbitrary database with user config
- docker run --name userconfigadmin -d --link db_server:db3 -v `readlink -f ./testing/config.test.inc.php`:/etc/phpmyadmin/config.user.inc.php -p 7080:80 phpmyadmin/phpmyadmin
- ./testing/test-docker.sh userconfigadmin 7080 db3
# 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 -f docker-compose.yml -f docker-compose.db.yml up -d
- ./testing/test-docker.sh phpmyadmin 8080 db_server
- docker-compose stop
# Run tests in testing container
- docker-compose -f docker-compose.testing.yml up -d phpmyadmin
- ./testing/wait-for-testing.sh
+64 -24
View File
@@ -1,34 +1,74 @@
FROM alpine:latest
FROM php:7.2-fpm-alpine
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
RUN apk add --no-cache \
nginx \
supervisor
COPY phpmyadmin.keyring /
# 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 \
; \
\
docker-php-ext-configure gd --with-freetype-dir=/usr --with-jpeg-dir=/usr --with-webp-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr; \
docker-php-ext-install bz2 gd mysqli opcache zip; \
\
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 --virtual .phpmyadmin-phpexts-rundeps $runDeps; \
apk del .build-deps
ENV VERSION 4.6.4
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.gz
# Calculate download URL
ENV VERSION 4.8.5
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.xz
LABEL version=$VERSION
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/
# Download tarball, verify it using gpg and extract
RUN set -ex; \
apk add --no-cache --virtual .fetch-deps \
gnupg \
; \
\
export GNUPGHOME="$(mktemp -d)"; \
export GPGKEY="3D06A59ECE730EB71B511C17CE752F178259BD92"; \
curl --output phpMyAdmin.tar.xz --location $URL; \
curl --output phpMyAdmin.tar.xz.asc --location $URL.asc; \
gpg --batch --keyserver ha.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver ipv4.pool.sks-keyservers.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keys.gnupg.net --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver pgp.mit.edu --recv-keys "$GPGKEY" \
|| gpg --batch --keyserver keyserver.pgp.com --recv-keys "$GPGKEY"; \
gpg --batch --verify phpMyAdmin.tar.xz.asc phpMyAdmin.tar.xz; \
tar -xf phpMyAdmin.tar.xz -C /usr/src; \
gpgconf --kill all; \
rm -r "$GNUPGHOME" phpMyAdmin.tar.xz phpMyAdmin.tar.xz.asc; \
mv /usr/src/phpMyAdmin-$VERSION-all-languages /usr/src/phpmyadmin; \
rm -rf /usr/src/phpmyadmin/setup/ /usr/src/phpmyadmin/examples/ /usr/src/phpmyadmin/test/ /usr/src/phpmyadmin/po/ /usr/src/phpmyadmin/composer.json /usr/src/phpmyadmin/RELEASE-DATE-$VERSION; \
sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /usr/src/phpmyadmin/libraries/vendor_config.php; \
# Add directory for sessions to allow session persistence
mkdir /sessions; \
mkdir -p /var/nginx/client_body_temp; \
apk del .fetch-deps
COPY config.inc.php /www/
# Copy configuration
COPY etc /etc/
COPY php.ini /usr/local/etc/php/conf.d/php-phpmyadmin.ini
# Copy main script
COPY run.sh /run.sh
RUN chmod u+rwx /run.sh
VOLUME /sessions
# We expose phpMyAdmin on port 80
EXPOSE 80
ENV PHP_UPLOAD_MAX_FILESIZE=64M \
PHP_MAX_INPUT_VARS=2000
ENTRYPOINT [ "/run.sh" ]
CMD ["supervisord", "-n", "-j", "/supervisord.pid"]
+46 -8
View File
@@ -1,15 +1,35 @@
# Official phpMyAdmin Docker image
Run phpMyAdmin with Alpine and PHP built in web server.
Run phpMyAdmin with Alpine, supervisor, nginx and PHP FPM.
[![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]
[![Docker Layers](https://images.microbadger.com/badges/image/phpmyadmin/phpmyadmin.svg)](https://microbadger.com/images/phpmyadmin/phpmyadmin "Get your own image badge on microbadger.com")
[![Docker Version](https://images.microbadger.com/badges/version/phpmyadmin/phpmyadmin.svg)](https://microbadger.com/images/phpmyadmin/phpmyadmin "Get your own version badge on microbadger.com")
All following examples will bring you phpMyAdmin on `http://localhost:8080`
where you can enjoy your happy MySQL administration.
## Credentials
phpMyAdmin does use MySQL server credential, please check the corresponding
server image for information how it is setup.
The official MySQL and MariaDB use 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.
## Docker hub tags
You can use following tags on Docker hub:
* `latest` - latest stable release
* `4.8` - latest stable release for the 4.8 version
* `edge` - bleeding edge docker image (contains stable phpMyAdmin, but the Docker image changes might not yet be fully tested)
* `edge-4.8` - bleeding edge docker image + latest snapshots from 4.8 branch (currently master)
## Usage with linked server
@@ -34,7 +54,7 @@ docker run --name myadmin -d -e PMA_HOST=dbhost -p 8080:80 phpmyadmin/phpmyadmin
You can use arbitrary servers by adding ENV 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
docker run --name myadmin -d -e PMA_ARBITRARY=1 -p 8080:80 phpmyadmin/phpmyadmin
```
## Usage with docker-compose and arbitrary server
@@ -48,6 +68,16 @@ Using the docker-compose.yml from https://github.com/phpmyadmin/docker
docker-compose up -d
```
## Run the E2E tests with docker-compose
You can run the E2E tests with the local test environment by running MariaDB/MySQL databases. Adding ENV variable `PHPMYADMIN_RUN_TEST=true` already added on docker-compose file. Simply run:
Using the docker-compose.testing.yml from https://github.com/phpmyadmin/docker
```
docker-compose -f docker-compose.testing.yml up phpmyadmin
```
## Adding Custom Configuration
You can add your own custom config.inc.php settings (such as Configuration Storage setup)
@@ -55,27 +85,35 @@ by creating a file named "config.user.inc.php" with the various user defined set
in it, and then linking it into the container using:
```
-v /some/local/directory/config.user.inc.php:/config.user.inc.php
-v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/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
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php phpmyadmin/phpmyadmin
```
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
https://docs.phpmyadmin.net/en/latest/config.html#config
https://docs.phpmyadmin.net/en/latest/setup.html
## Usage behind reverse proxys
Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma.example.net/``) where the reverse proxy makes phpMyAdmin available.
## 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_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_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_ABSOLUTE_URI`` - define user-facing URI
For more detailed documentation see https://docs.phpmyadmin.net/en/latest/setup.html#installing-using-docker
[hub]: https://hub.docker.com/r/phpmyadmin/phpmyadmin/
Please report any issues with the Docker container to https://github.com/phpmyadmin/docker/issues
-63
View File
@@ -1,63 +0,0 @@
<?php
require('./config.secret.inc.php');
/* Ensure we got the environment */
$vars = array(
'PMA_ARBITRARY',
'PMA_HOST',
'PMA_HOSTS',
'PMA_PORT',
'PMA_USER',
'PMA_PASSWORD',
);
foreach ($vars as $var) {
if (!isset($_ENV[$var]) && getenv($var)) {
$_ENV[$var] = getenv($var);
}
}
/* Arbitrary server connection */
if (isset($_ENV['PMA_ARBITRARY']) && $_ENV['PMA_ARBITRARY'] === '1') {
$cfg['AllowArbitraryServer'] = true;
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = array('db');
/* Set by environment */
if (!empty($_ENV['PMA_HOST'])) {
$hosts = array($_ENV['PMA_HOST']);
} elseif (!empty($_ENV['PMA_HOSTS'])) {
$hosts = explode(',', $_ENV['PMA_HOSTS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
$cfg['Servers'][$i]['host'] = $hosts[$i - 1];
if (isset($_ENV['PMA_PORT'])) {
$cfg['Servers'][$i]['port'] = $_ENV['PMA_PORT'];
}
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;
} else {
$cfg['Servers'][$i]['auth_type'] = 'cookie';
}
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;
}
/* Uploads setup */
$cfg['UploadDir'] = '';
$cfg['SaveDir'] = '';
/* Include User Defined Settings Hook */
if (file_exists('/config.user.inc.php')) {
include('/config.user.inc.php');
}
+3
View File
@@ -0,0 +1,3 @@
phpmyadmin:
external_links:
- db_server:db
+22 -6
View File
@@ -1,8 +1,24 @@
phpmyadmin:
image: phpmyadmin/phpmyadmin:testing
container_name: myadmin
version: '2'
services:
db_server:
image: ${DB}
container_name: phpmyadmin_testing_mariadb
environment:
- PMA_ARBITRARY=1
restart: always
- MYSQL_ROOT_PASSWORD=test123
volumes:
- ./testing/testing.cnf:/etc/mysql/conf.d/testing.cnf:ro
phpmyadmin:
build:
context: testing/
container_name: phpmyadmin_testing
volumes:
- /sessions
ports:
- 8090:80
- 8090:80
environment:
- PMA_ARBITRARY=1
- TESTSUITE_PASSWORD=test123
depends_on:
- db_server
+1 -1
View File
@@ -1,6 +1,6 @@
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: myadmin
container_name: phpmyadmin
environment:
- PMA_ARBITRARY=1
restart: always
+131
View File
@@ -0,0 +1,131 @@
worker_processes 4;
daemon off;
pid /nginx.pid;
error_log /var/log/nginx-error.log;
events {
worker_connections 1024;
}
http {
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/javascript js;
application/atom+xml atom;
application/rss+xml rss;
}
default_type application/octet-stream;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
client_body_timeout 12;
client_header_timeout 12;
keepalive_timeout 15;
send_timeout 10;
server_tokens off;
client_body_buffer_size 512K;
client_body_temp_path /var/nginx/client_body_temp;
client_header_buffer_size 16k;
client_max_body_size 512M;
large_client_header_buffers 4 8k;
gzip on;
gzip_comp_level 2;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/x-javascript text/xml text/css application/xml;
access_log off;
server {
listen 80 default_server;
server_name _;
root /var/www/html;
index index.php index.html index.htm;
charset utf-8;
if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 405;
}
location / {
try_files $uri $uri/ =404;
}
location ~* .(jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;
}
location ~ \.php$ {
fastcgi_intercept_errors on;
fastcgi_pass 127.0.0.1:9000;
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
# Bypass the fact that try_files resets $fastcgi_path_info
# see: https://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_read_timeout 1200;
fastcgi_buffering off;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
}
location ~ /\. {
deny all;
}
location ~ /(libraries|templates) {
deny all;
}
}
}
+137
View File
@@ -0,0 +1,137 @@
<?php
require('/etc/phpmyadmin/config.secret.inc.php');
/* Ensure we got the environment */
$vars = array(
'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'
);
foreach ($vars as $var) {
$env = getenv($var);
if (!isset($_ENV[$var]) && $env !== false) {
$_ENV[$var] = $env;
}
}
if (isset($_ENV['PMA_QUERYHISTORYDB'])) {
$cfg['QueryHistoryDB'] = boolval($_ENV['PMA_QUERYHISTORYDB']);
}
/* 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']);
}
/* Figure out hosts */
/* Fallback to default linked */
$hosts = array('db');
/* Set by environment */
if (!empty($_ENV['PMA_HOST'])) {
$hosts = array($_ENV['PMA_HOST']);
$verbose = array($_ENV['PMA_VERBOSE']);
$ports = array($_ENV['PMA_PORT']);
} 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']));
}
if (!empty($_ENV['PMA_SOCKET'])) {
$sockets = array($_ENV['PMA_SOCKET']);
} elseif (!empty($_ENV['PMA_SOCKETS'])) {
$sockets = explode(',', $_ENV['PMA_SOCKETS']);
}
/* Server settings */
for ($i = 1; isset($hosts[$i - 1]); $i++) {
$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;
}
for ($i = 1; isset($sockets[$i - 1]); $i++) {
$cfg['Servers'][$i]['socket'] = $sockets[$i - 1];
$cfg['Servers'][$i]['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('/etc/phpmyadmin/config.user.inc.php')) {
include('/etc/phpmyadmin/config.user.inc.php');
}
+12
View File
@@ -0,0 +1,12 @@
[program:nginx]
command=nginx -c /etc/nginx.conf
autostart=true
autorestart=true
priority=2
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
+12
View File
@@ -0,0 +1,12 @@
[program:php-fpm]
command=php-fpm --nodaemonize --fpm-config /usr/local/etc/php-fpm.conf
autostart=true
autorestart=true
priority=1
startretries=3
stopwaitsecs=10
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
+20
View File
@@ -0,0 +1,20 @@
[PHP]
allow_url_fopen = Off
max_execution_time = 600
memory_limit = 512M
open_basedir = /var/www/html:/tmp/:/etc/phpmyadmin/
post_max_size = 512M
upload_max_filesize = 512M
[Session]
session.cookie_httponly = 1
session.hash_function = 1
session.save_path = "/sessions"
session.use_strict_mode = 1
[opcache]
opcache.fast_shutdown = 1
opcache.restrict_api = /disabled/
opcache.save_comments = 0
opcache.use_cwd = 0
opcache.validate_timestamps = 0
Binary file not shown.
+44 -13
View File
@@ -1,19 +1,50 @@
#!/bin/sh
set -x
if [[ "$1" == apache2* ]] || [ "$1" == php-fpm ] || [ "$1" == supervisord ] ; then
if [ "$(id -u)" = '0' ]; then
case "$1" in
apache2*)
user="${APACHE_RUN_USER:-www-data}"
group="${APACHE_RUN_GROUP:-www-data}"
;;
*) # php-fpm
user='www-data'
group='www-data'
;;
esac
else
user="$(id -u)"
group="$(id -g)"
fi
if [ ! -f /www/config.secret.inc.php ] ; then
cat > /www/config.secret.inc.php <<EOT
chown www-data:www-data /sessions /var/nginx/client_body_temp
if ! [ -e index.php -a -e db_designer.php ]; then
echo >&2 "phpMyAdmin not found in $PWD - copying now..."
if [ "$(ls -A)" ]; then
echo >&2 "WARNING: $PWD is not empty - press Ctrl+C now if this is an error!"
( set -x; ls -A; sleep 10 )
fi
tar --create \
--file - \
--one-file-system \
--directory /usr/src/phpmyadmin \
--owner "$user" --group "$group" \
. | tar --extract --file -
echo >&2 "Complete! phpMyAdmin has been successfully copied to $PWD"
mkdir -p tmp; \
chmod -R 777 tmp; \
fi
if [ ! -f /etc/phpmyadmin/config.secret.inc.php ]; then
cat > /etc/phpmyadmin/config.secret.inc.php <<EOT
<?php
\$cfg['blowfish_secret'] = '`cat /dev/urandom | tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' | fold -w 32 | head -n 1`';
\$cfg['blowfish_secret'] = '$(tr -dc 'a-zA-Z0-9~!@#$%^&*_()+}{?></";.,[]=-' < /dev/urandom | fold -w 32 | head -n 1)';
EOT
fi
if [ ! -f /etc/phpmyadmin/config.user.inc.php ]; then
touch /etc/phpmyadmin/config.user.inc.php
fi
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
exec "$@"
+10
View File
@@ -0,0 +1,10 @@
# Testing image for phpMyAdmin
FROM phpmyadmin/phpmyadmin
# Install test dependencies
RUN apk add --no-cache curl py2-pip
RUN pip install mechanize html5lib
COPY test.ini /etc/supervisor.d/
COPY phpmyadmin_test.py test-docker.sh world.sql /
+2
View File
@@ -0,0 +1,2 @@
<?php
$cfg['AllowArbitraryServer'] = true;
+73
View File
@@ -0,0 +1,73 @@
#!/usr/bin/env python
import argparse
import os
import re
import sys
import mechanize
def test_content(match, content):
if not match in content:
print(content)
raise Exception('{0} not found in content!'.format(match))
def test_phpmyadmin(url, username, password, server=None, sqlfile=None):
if sqlfile is None:
if os.path.exists('/world.sql'):
sqlfile = '/world.sql'
elif os.path.exists('./world.sql'):
sqlfile = './world.sql'
else:
sqlfile = './testing/world.sql'
br = mechanize.Browser()
# Ignore robots.txt
br.set_handle_robots(False)
# 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 loggged in
response = br.submit()
test_content('Server version', response.read())
# Open server import
response = br.follow_link(text_regex=re.compile('Import'))
test_content('OpenDocument Spreadsheet', response.read())
# Upload SQL file
br.select_form('import')
br.form.add_file(open(sqlfile), 'text/plain', sqlfile)
response = br.submit()
test_content('5326 queries executed', response.read())
def main():
parser = argparse.ArgumentParser()
parser.add_argument('--url', required=True)
parser.add_argument('--username', required=True)
parser.add_argument('--password', required=True)
parser.add_argument('--server')
parser.add_argument('--sqlfile', default=None)
args = parser.parse_args()
test_phpmyadmin(
args.url,
args.username,
args.password,
args.server,
args.sqlfile
)
if __name__ == '__main__':
main()
+94
View File
@@ -0,0 +1,94 @@
#!/bin/sh
NAME="$1"
if [ -n "$2" ] ; then
PORT="$2"
TESTSUITE_PORT=$2
fi
if [ -n "$3" ] ; then
SERVER="--server $3"
PMA_HOST=$3
else
SERVER=''
fi
# Set PHPMyAdmin environment
PHPMYADMIN_HOSTNAME=${TESTSUITE_HOSTNAME:=localhost}
PHPMYADMIN_PORT=${TESTSUITE_PORT:=80}
PHPMYADMIN_URL=http://$PHPMYADMIN_HOSTNAME:$PORT/
# Color text output
GREEN="\033[0;32m"
RED="\033[0;31m"
NC="\033[0m" # No Color
ret=0
# Check if script is running inside container
if [ -f /.dockerenv ] ; then
echo "Tests running inside container..."
# Set database environment
PHPMYADMIN_DB_HOSTNAME=${PMA_HOST:=localhost}
PHPMYADMIN_DB_PORT=${PMA_PORT:=3306}
PHPMYADMIN_DB_URL=http://$PHPMYADMIN_DB_HOSTNAME:$PHPMYADMIN_DB_PORT/
# Wait for database to start
TIMEOUT=0
while ! curl "$PHPMYADMIN_DB_URL" &>/dev/null; do
echo "Waiting for ${PHPMYADMIN_DB_HOSTNAME} database start..."
sleep 10
TIMEOUT=$((TIMEOUT + 1))
if [ $TIMEOUT -gt 3 ] ; then
echo "Failed to connect ${PHPMYADMIN_DB_HOSTNAME} database!"
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${RED}FAILED${NC}"
ret=1
exit 1
fi
done
else
echo "Tests running outside container..."
docker ps -a
COMMAND_HOST="docker exec ${NAME}"
fi
# Wait for container to start
TIMEOUT=0
while ! $COMMAND_HOST ps aux | grep -q nginx ; do
echo "Waiting for PHPMyAdmin start..."
sleep 1
TIMEOUT=$((TIMEOUT + 1))
if [ $TIMEOUT -gt 10 ] ; then
echo "Failed to connect PHPMyAdmin!"
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${RED}FAILED${NC}"
ret=1
exit 1
fi
done
# Perform tests
if [ $ret -eq 0 ] ; then
if [ -f /phpmyadmin_test.py ] ; then
FILENAME=/phpmyadmin_test.py
elif [ -f ./phpmyadmin_test.py ] ; then
FILENAME=./phpmyadmin_test.py
else
FILENAME=./testing/phpmyadmin_test.py
fi
python $FILENAME --url "$PHPMYADMIN_URL" --username root --password $TESTSUITE_PASSWORD $SERVER
ret=$?
fi
# Show debug output in case of failure
if [ $ret -ne 0 ] ; then
curl "$PHPMYADMIN_URL"
$COMMAND_HOST ps faux
$COMMAND_HOST cat /var/log/php-fpm.log
$COMMAND_HOST cat /var/log/nginx-error.log
$COMMAND_HOST cat /var/log/supervisord.log
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${RED}FAILED${NC}"
exit $ret
fi
echo "Result of ${PHPMYADMIN_DB_HOSTNAME} tests: ${GREEN}SUCCESS${NC}"
+11
View File
@@ -0,0 +1,11 @@
[program:test-mariadb]
command=/test-docker.sh test 80 mariadb
autostart=true
autorestart=false
priority=3
startretries=1
stopwaitsecs=20
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
+11
View File
@@ -0,0 +1,11 @@
[program:test-mysql]
command=/test-docker.sh test 80 db_server
autostart=true
autorestart=false
priority=3
startretries=1
stopwaitsecs=20
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
+2
View File
@@ -0,0 +1,2 @@
[mysqld]
default_authentication_plugin = mysql_native_password
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
# Helper script to wait for testing inside container completes
# Needs running docker-compose container based on docker-compose.testing.yml
GREEN="\033[0;32m"
RED="\033[0;31m"
NC="\033[0m" # No Color
TIMEOUT=0
sleep 5
while [ `docker-compose -f docker-compose.testing.yml logs phpmyadmin | grep -c 'Result of db_server tests'` -lt 1 ] ; do
sleep 1
TIMEOUT=$(($TIMEOUT + 1))
if [ $TIMEOUT -gt 20 ] ; then
docker-compose -f docker-compose.testing.yml logs phpmyadmin
echo "${RED}Timeout!${NC}"
exit 1
fi
done
if [ `docker-compose -f docker-compose.testing.yml logs phpmyadmin | grep -c 'Result of db_server tests.*SUCCESS'` -lt 1 ] ; then
docker-compose -f docker-compose.testing.yml logs phpmyadmin
echo "${RED}Failed${NC}"
exit 2
fi
docker-compose -f docker-compose.testing.yml logs phpmyadmin
echo "${GREEN}Success${NC}"
exit 0
+5395
View File
File diff suppressed because it is too large Load Diff