From 6517adbfe3830627ca14c2671373c5f10e1d11fa Mon Sep 17 00:00:00 2001 From: William Desportes Date: Thu, 3 Aug 2023 15:52:13 +0200 Subject: [PATCH] Fix #421 - Document PMA_SOCKET and PMA_SOCKETS --- .github/workflows/run-tests.yml | 2 +- Makefile | 2 +- README.md | 2 + ...docker-compose.testing-one-socket-host.yml | 75 +++++++++++++++++++ 4 files changed, 79 insertions(+), 2 deletions(-) create mode 100644 testing/docker-compose/docker-compose.testing-one-socket-host.yml diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index c12e4d4..f2345f5 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: database-image: ["mariadb:10.6", "mariadb:10.11", "mariadb:latest", "mysql:5.7", "mysql:latest"] - configuration: ["default", "one-host", "config-mount-dir", "fs-import-export", "different-apache-port"] + configuration: ["default", "one-host", "one-socket-host", "config-mount-dir", "fs-import-export", "different-apache-port"] steps: - uses: actions/checkout@v3 diff --git a/Makefile b/Makefile index 0af25c5..2fb5ca6 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ testing-%: docker-compose -p "phpmyadmin_$@" -f ./testing/docker-compose/docker-compose.$@.yml up --build --abort-on-container-exit --exit-code-from=sut docker-compose -p "phpmyadmin_$@" -f ./testing/docker-compose/docker-compose.$@.yml down -run-tests: testing-default testing-one-host testing-config-mount-dir testing-fs-import-export testing-different-apache-port +run-tests: testing-default testing-one-host testing-one-socket-host testing-config-mount-dir testing-fs-import-export testing-different-apache-port logs: docker-compose -f ./testing/docker-compose/docker-compose.testing-default.yml logs diff --git a/README.md b/README.md index 6aa0571..80db1d2 100644 --- a/README.md +++ b/README.md @@ -167,6 +167,8 @@ In order to keep your sessions active between container updates you will need to * ``PMA_HOSTS`` - define comma separated list of address/host names of the MySQL servers * ``PMA_VERBOSES`` - define comma separated list of verbose names of the MySQL servers * ``PMA_PORTS`` - define comma separated list of ports of the MySQL servers +* ``PMA_SOCKET`` - define socket file for the MySQL connection +* ``PMA_SOCKETS`` - define comma separated list of socket files for the MySQL connections * ``PMA_USER`` and ``PMA_PASSWORD`` - define username and password to use only with the `config` authentication method * ``PMA_ABSOLUTE_URI`` - the full URL to phpMyAdmin. Sometimes needed when used in a reverse-proxy configuration. Don't set this unless needed. See [documentation](https://docs.phpmyadmin.net/en/latest/config.html#cfg_PmaAbsoluteUri). * ``PMA_CONFIG_BASE64`` - if set, this option will override the default `config.inc.php` with the base64 decoded contents of the variable diff --git a/testing/docker-compose/docker-compose.testing-one-socket-host.yml b/testing/docker-compose/docker-compose.testing-one-socket-host.yml new file mode 100644 index 0000000..59a0e82 --- /dev/null +++ b/testing/docker-compose/docker-compose.testing-one-socket-host.yml @@ -0,0 +1,75 @@ +version: "3.1" + +services: + db_server: + image: ${DB:-mariadb:10.11} + environment: + MARIADB_ROOT_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}" + healthcheck: + test: ["CMD", "mariadb-admin", "ping", "-uroot", "-p${TESTSUITE_PASSWORD:-my-secret-pw}"] + start_period: 10s + interval: 5s + timeout: 60s + retries: 10 + networks: + testing: + aliases: + - phpmyadmin_testing_db + tmpfs: + - /var/lib/mysql:rw,noexec,nosuid,size=300m + volumes: + - db-socket:/run/mysqld/ + + phpmyadmin: + build: + context: ../../apache + environment: + PMA_SOCKET: /run/mysqld/mysqld.sock + UPLOAD_LIMIT: 123M + MAX_EXECUTION_TIME: 125 + HIDE_PHP_VERSION: 1 + volumes: + - ../config.user.inc.php:/etc/phpmyadmin/config.user.inc.php:ro + - db-socket:/run/mysqld/ + healthcheck: + test: ["CMD", "curl", "-Ss", "http://localhost/robots.txt"] + start_period: 5s + interval: 3s + timeout: 60s + retries: 10 + networks: + testing: + aliases: + - phpmyadmin_testing_apache + depends_on: + db_server: + condition: service_healthy + + sut: + depends_on: + phpmyadmin: + condition: service_healthy + db_server: + condition: service_healthy + build: + context: ../ + command: "/tests/testing/test-docker.sh" + networks: + testing: + environment: + TESTSUITE_HOSTNAME: phpmyadmin_testing_apache + TESTSUITE_PORT: 80 + TESTSUITE_PASSWORD: "${TESTSUITE_PASSWORD:-my-secret-pw}" + PMA_HOST: phpmyadmin_testing_db + PMA_PORT: 3306 + volumes: + - ../../:/tests:ro + - /var/run/docker.sock:/var/run/docker.sock + working_dir: /tests + +networks: + testing: + driver: bridge + +volumes: + db-socket: \ No newline at end of file