Compare commits

...
132 Commits
Author SHA1 Message Date
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
Michal Čihař 901156a7eb Update to 4.6.4
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-17 10:31:36 +02:00
Michal Čihař ced6ab371a Disable apk cache for removal
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 14:09:08 +02:00
Michal ČihařandGitHub 9d258fed4f Merge pull request #46 from nijel/master
Specify version in variable
2016-08-08 14:08:40 +02:00
Michal Čihař e59a8bab47 Specify version in variable
This way we can reproduce build of tags, with latest approach used so
far, you would always get the latest version even when building older
tag.

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 14:05:53 +02:00
Michal Čihař c099349ef3 Remove not needed curl installation
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 13:52:48 +02:00
Michal ČihařandGitHub a602d1d4c6 Merge pull request #45 from nijel/pgp
Verify downloaded tarball using PGP
2016-08-08 13:47:24 +02:00
Michal Čihař 8a8e9eee0a Verify downloaded tarball using PGP
Fixes #43

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 13:44:21 +02:00
Michal Čihař a5dfdfe993 Move user configuration and simplify it's setup
- move it to root directory to make it easier to use as volume

Signed-off-by: Michal Čihař <michal@cihar.com>
2016-08-08 13:09:32 +02:00
Michal Čihař f67529f585 Merge remote-tracking branch 'origin/pull/42' 2016-08-08 12:56:21 +02:00
Michal Čihař e6bc219529 Fix link to docs
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-26 20:29:10 +02:00
Michal Čihař ef53180e08 Increase number of chars allowed in secret
Signed-off-by: Michal Čihař <michal@cihar.com>
2016-07-26 11:56:47 +02:00
Douglas Wagner 4cadf08f00 Updated for installing config.userdef.inc.php hook to update PHPMYADMIN custom user setttings without modifying/overriding the config.inc.php file. 2016-07-11 12:49:04 -05:00
17 changed files with 7735 additions and 47 deletions
+4
View File
@@ -4,3 +4,7 @@ docker-compose.testing.yml
README.md
LICENSE
Makefile
world.sql
test-docker.sh
phpmyadmin_test.py
config.test.inc.php
+12 -22
View File
@@ -5,37 +5,27 @@ services:
env:
matrix:
- DB=mysql:5.7
- DB=mariadb:10.0
- DB=mysql:latest
- DB=mariadb:latest
before_install:
- docker run --name db_server -e MYSQL_ROOT_PASSWORD=my-secret-pw -d $DB
install:
- pip install mechanize
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-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'
- ./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'
# 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
- docker run --name arbitraryadmin -d --link db_server:db3 -e PMA_ARBITRARY=1 -p 7070:80 phpmyadmin/phpmyadmin
- ./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 ./config.test.inc.php`:/etc/phpmyadmin/config.user.inc.php -p 7080:80 phpmyadmin/phpmyadmin
- ./test-docker.sh userconfigadmin 7080 db3
+41 -9
View File
@@ -1,20 +1,52 @@
FROM alpine:latest
FROM alpine:3.5
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 curl
# Install dependencies
RUN apk add --no-cache php7-session php7-mysqli php7-mbstring php7-xml php7-gd php7-zlib php7-bz2 php7-zip php7-openssl php7-curl php7-opcache php7-json nginx php7-fpm supervisor
RUN curl --location https://www.phpmyadmin.net/downloads/phpMyAdmin-latest-all-languages.tar.gz | tar xzf - \
&& mv phpMyAdmin* /www \
&& rm -rf /www/js/jquery/src/ /www/examples /www/po/
# Include keyring to verify download
COPY phpmyadmin.keyring /
COPY config.inc.php /www/
# Copy configuration
COPY etc /etc/
# Copy main script
COPY run.sh /run.sh
RUN chmod u+rwx /run.sh
# Calculate download URL
ENV VERSION 4.6.6
ENV URL https://files.phpmyadmin.net/phpMyAdmin/${VERSION}/phpMyAdmin-${VERSION}-all-languages.tar.gz
LABEL version=$VERSION
# Download tarball, verify it using gpg and extract
RUN set -x \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& 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-$VERSION-all-languages /www \
&& mv /www/doc/html /www/htmldoc \
&& rm -rf /www/doc \
&& mkdir /www/doc \
&& mv /www/htmldoc /www/doc/html \
&& rm /www/doc/html/.buildinfo /www/doc/html/objects.inv \
&& rm -rf /www/js/jquery/src/ /www/js/openlayers/src/ /www/setup/ /www/examples/ /www/test/ /www/po/ /www/templates/test/ /www/phpunit.xml.* /www/build.xml /www/composer.json /www/RELEASE-DATE-$VERSION \
&& sed -i "s@define('CONFIG_DIR'.*@define('CONFIG_DIR', '/etc/phpmyadmin/');@" /www/libraries/vendor_config.php \
&& chown -R root:nobody /www \
&& find /www -type d -exec chmod 750 {} \; \
&& find /www -type f -exec chmod 640 {} \;
# Add volume for sessions to allow session persistence
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 ["phpmyadmin"]
+48 -4
View File
@@ -1,15 +1,34 @@
# 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.6` - latest stable release from the 4.6 branch
* `edge` - bleeding edge docker image (contains stable phpMyAdmin, but the Docker image changes might not yet be fully tested)
## Usage with linked server
@@ -48,16 +67,41 @@ Using the docker-compose.yml from https://github.com/phpmyadmin/docker
docker-compose up -d
```
## 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
in it, and then linking it into the container using:
```
-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:/etc/phpmyadmin/config.user.inc.php phpmyadmin/phpmyadmin
```
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
## 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_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 http://docs.phpmyadmin.net/en/latest/setup.html#installing-using-docker
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
+2
View File
@@ -0,0 +1,2 @@
<?php
$cfg['AllowArbitraryServer'] = true;
+1 -1
View File
@@ -1,6 +1,6 @@
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: myadmin
container_name: phpmyadmin
environment:
- PMA_ARBITRARY=1
restart: always
+130
View File
@@ -0,0 +1,130 @@
user nobody;
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 /www;
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 unix:/var/run/php/php-fpm.sock;
# 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 600;
fastcgi_buffering off;
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;
}
}
}
+17
View File
@@ -0,0 +1,17 @@
[global]
error_log = /var/log/php-fpm.log
log_level = warning
[www]
user = nobody
group = nobody
listen = /var/run/php/php-fpm.sock
listen.mode = 0660
chdir = /www
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
catch_workers_output = Yes
clear_env = No
+1918
View File
File diff suppressed because it is too large Load Diff
@@ -1,15 +1,18 @@
<?php
require('./config.secret.inc.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_USER',
'PMA_PASSWORD',
'PMA_ABSOLUTE_URI'
);
foreach ($vars as $var) {
if (!isset($_ENV[$var]) && getenv($var)) {
@@ -22,6 +25,11 @@ 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 */
@@ -30,13 +38,18 @@ $hosts = array('db');
/* Set by environment */
if (!empty($_ENV['PMA_HOST'])) {
$hosts = array($_ENV['PMA_HOST']);
$verbose = array($_ENV['PMA_VERBOSE']);
} elseif (!empty($_ENV['PMA_HOSTS'])) {
$hosts = explode(',', $_ENV['PMA_HOSTS']);
$verbose = explode(',', $_ENV['PMA_VERBOSES']);
}
/* 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($_ENV['PMA_PORT'])) {
$cfg['Servers'][$i]['port'] = $_ENV['PMA_PORT'];
}
@@ -55,3 +68,8 @@ for ($i = 1; isset($hosts[$i - 1]); $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
+13
View File
@@ -0,0 +1,13 @@
[program:php-fpm]
command=php-fpm7 --nodaemonize --fpm-config /etc/php-fpm.conf -c /etc/php.ini
user=nobody
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
Binary file not shown.
+59
View File
@@ -0,0 +1,59 @@
#!/usr/bin/env python
import argparse
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='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='world.sql')
args = parser.parse_args()
test_phpmyadmin(args.url, args.username, args.password, args.server, args.sqlfile)
if __name__ == '__main__':
main()
+17 -10
View File
@@ -1,15 +1,22 @@
#!/bin/sh
set -x
if [ ! -f /www/config.secret.inc.php ] ; then
cat > /www/config.secret.inc.php <<EOT
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
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
if [ ! -f /etc/phpmyadmin/config.user.inc.php ] ; then
touch /etc/phpmyadmin/config.user.inc.php
fi
mkdir -p /var/nginx/client_body_temp
chown nobody:nobody /sessions /var/nginx/client_body_temp
mkdir -p /var/run/php/
chown nobody:nobody /var/run/php/
touch /var/log/php-fpm.log
chown nobody:nobody /var/log/php-fpm.log
if [ "$1" = 'phpmyadmin' ]; then
exec supervisord --nodaemon --configuration="/etc/supervisord.conf" --loglevel=info
fi
Executable
+47
View File
@@ -0,0 +1,47 @@
#!/bin/sh
set -x
NAME="$1"
PORT="$2"
if [ -n "$3" ] ; then
SERVER="--server $3"
else
SERVER=''
fi
URL=http://127.0.0.1:$PORT/
# Wait for container to start
ret=0
TIMEOUT=0
while ! docker exec "$NAME" ps aux | grep -q nginx ; do
echo 'Waiting for start...'
sleep 1
TIMEOUT=$((TIMEOUT + 1))
if [ $TIMEOUT -gt 10 ] ; then
echo "Failed to wait!"
ret=1
exit 1
fi
done
# Perform tests
if [ $ret -eq 0 ] ; then
python phpmyadmin_test.py --url "$URL" --username root --password my-secret-pw $SERVER
ret=$?
fi
# Show debug output in case of failure
if [ $ret -ne 0 ] ; then
curl "$URL"
docker ps -a
docker exec "$NAME" ps faux
docker exec "$NAME" cat /var/log/php-fpm.log
docker exec "$NAME" cat /var/log/nginx-error.log
docker exec "$NAME" cat /var/log/supervisord.log
exit $ret
fi
# List processes
docker exec "$NAME" ps faux
+5395
View File
File diff suppressed because it is too large Load Diff