From 585593e8a88ce6f6cd06a48d049e17b69590a417 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Sat, 26 Feb 2022 21:16:20 +0200 Subject: [PATCH] Added variable for root user. Removed DB root from web images --- .../proxy-mysql/alpine/docker-entrypoint.sh | 3 +- .../proxy-mysql/centos/docker-entrypoint.sh | 3 +- .../proxy-mysql/ol/docker-entrypoint.sh | 3 +- .../proxy-mysql/rhel/docker-entrypoint.sh | 3 +- .../proxy-mysql/ubuntu/docker-entrypoint.sh | 3 +- .../server-mysql/alpine/docker-entrypoint.sh | 3 +- .../server-mysql/centos/docker-entrypoint.sh | 3 +- .../server-mysql/ol/docker-entrypoint.sh | 3 +- .../server-mysql/rhel/docker-entrypoint.sh | 3 +- .../server-mysql/ubuntu/docker-entrypoint.sh | 3 +- Dockerfiles/web-apache-mysql/alpine/README.md | 2 -- .../alpine/docker-entrypoint.sh | 32 ++----------------- Dockerfiles/web-apache-mysql/centos/README.md | 2 -- .../centos/docker-entrypoint.sh | 32 ++----------------- Dockerfiles/web-apache-mysql/ol/README.md | 2 -- .../web-apache-mysql/ol/docker-entrypoint.sh | 32 ++----------------- Dockerfiles/web-apache-mysql/ubuntu/README.md | 2 -- .../ubuntu/docker-entrypoint.sh | 32 ++----------------- .../alpine/docker-entrypoint.sh | 15 +-------- .../centos/docker-entrypoint.sh | 15 +-------- .../web-apache-pgsql/ol/docker-entrypoint.sh | 15 +-------- .../ubuntu/docker-entrypoint.sh | 15 +-------- Dockerfiles/web-nginx-mysql/alpine/README.md | 2 -- .../alpine/docker-entrypoint.sh | 32 ++----------------- Dockerfiles/web-nginx-mysql/centos/README.md | 2 -- .../centos/docker-entrypoint.sh | 32 ++----------------- Dockerfiles/web-nginx-mysql/ol/README.md | 2 -- .../web-nginx-mysql/ol/docker-entrypoint.sh | 32 ++----------------- Dockerfiles/web-nginx-mysql/rhel/README.md | 2 -- .../web-nginx-mysql/rhel/docker-entrypoint.sh | 32 ++----------------- Dockerfiles/web-nginx-mysql/ubuntu/README.md | 2 -- .../ubuntu/docker-entrypoint.sh | 32 ++----------------- .../alpine/docker-entrypoint.sh | 15 +-------- .../centos/docker-entrypoint.sh | 15 +-------- .../web-nginx-pgsql/ol/docker-entrypoint.sh | 15 +-------- .../ubuntu/docker-entrypoint.sh | 15 +-------- docker-compose_v3_alpine_mysql_latest.yaml | 4 +++ docker-compose_v3_alpine_mysql_local.yaml | 4 +++ docker-compose_v3_alpine_pgsql_latest.yaml | 3 ++ docker-compose_v3_alpine_pgsql_local.yaml | 3 ++ docker-compose_v3_centos_mysql_latest.yaml | 4 +++ docker-compose_v3_centos_mysql_local.yaml | 4 +++ docker-compose_v3_centos_pgsql_latest.yaml | 3 ++ docker-compose_v3_centos_pgsql_local.yaml | 3 ++ docker-compose_v3_ol_mysql_latest.yaml | 4 +++ docker-compose_v3_ol_mysql_local.yaml | 4 +++ docker-compose_v3_ol_pgsql_latest.yaml | 3 ++ docker-compose_v3_ol_pgsql_local.yaml | 3 ++ docker-compose_v3_ubuntu_mysql_latest.yaml | 4 +++ docker-compose_v3_ubuntu_mysql_local.yaml | 4 +++ docker-compose_v3_ubuntu_pgsql_latest.yaml | 3 ++ docker-compose_v3_ubuntu_pgsql_local.yaml | 3 ++ env_vars/.MYSQL_ROOT_USER | 1 + 53 files changed, 112 insertions(+), 401 deletions(-) create mode 100644 env_vars/.MYSQL_ROOT_USER diff --git a/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh index 7df154f19..3a2165ce3 100755 --- a/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/alpine/docker-entrypoint.sh @@ -148,6 +148,7 @@ check_variables_mysql() { file_env MYSQL_USER file_env MYSQL_PASSWORD + file_env MYSQL_ROOT_USER file_env MYSQL_ROOT_PASSWORD if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then @@ -162,7 +163,7 @@ check_variables_mysql() { if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" + DB_SERVER_ROOT_USER=${MYSQL_ROOT_USER:-"root"} DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi diff --git a/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh index 1634b03a2..16b076c06 100755 --- a/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/centos/docker-entrypoint.sh @@ -148,6 +148,7 @@ check_variables_mysql() { file_env MYSQL_USER file_env MYSQL_PASSWORD + file_env MYSQL_ROOT_USER file_env MYSQL_ROOT_PASSWORD if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then @@ -162,7 +163,7 @@ check_variables_mysql() { if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" + DB_SERVER_ROOT_USER=${MYSQL_ROOT_USER:-"root"} DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi diff --git a/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh index 1634b03a2..16b076c06 100755 --- a/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/ol/docker-entrypoint.sh @@ -148,6 +148,7 @@ check_variables_mysql() { file_env MYSQL_USER file_env MYSQL_PASSWORD + file_env MYSQL_ROOT_USER file_env MYSQL_ROOT_PASSWORD if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then @@ -162,7 +163,7 @@ check_variables_mysql() { if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" + DB_SERVER_ROOT_USER=${MYSQL_ROOT_USER:-"root"} DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi diff --git a/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh index 4598f4c9b..a77a390b9 100755 --- a/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/rhel/docker-entrypoint.sh @@ -148,6 +148,7 @@ check_variables_mysql() { file_env MYSQL_USER file_env MYSQL_PASSWORD + file_env MYSQL_ROOT_USER file_env MYSQL_ROOT_PASSWORD if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then @@ -162,7 +163,7 @@ check_variables_mysql() { if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" + DB_SERVER_ROOT_USER=${MYSQL_ROOT_USER:-"root"} DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi diff --git a/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh index bb379b641..5e33e7ae1 100755 --- a/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/proxy-mysql/ubuntu/docker-entrypoint.sh @@ -148,6 +148,7 @@ check_variables_mysql() { file_env MYSQL_USER file_env MYSQL_PASSWORD + file_env MYSQL_ROOT_USER file_env MYSQL_ROOT_PASSWORD if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then @@ -162,7 +163,7 @@ check_variables_mysql() { if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" + DB_SERVER_ROOT_USER=${MYSQL_ROOT_USER:-"root"} DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi diff --git a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh index 4d22f076e..2821be025 100755 --- a/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/alpine/docker-entrypoint.sh @@ -143,6 +143,7 @@ check_variables_mysql() { file_env MYSQL_USER file_env MYSQL_PASSWORD + file_env MYSQL_ROOT_USER file_env MYSQL_ROOT_PASSWORD if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then @@ -157,7 +158,7 @@ check_variables_mysql() { if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" + DB_SERVER_ROOT_USER=${MYSQL_ROOT_USER:-"root"} DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi diff --git a/Dockerfiles/server-mysql/centos/docker-entrypoint.sh b/Dockerfiles/server-mysql/centos/docker-entrypoint.sh index 3f4db18b1..189ac0619 100755 --- a/Dockerfiles/server-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/centos/docker-entrypoint.sh @@ -143,6 +143,7 @@ check_variables_mysql() { file_env MYSQL_USER file_env MYSQL_PASSWORD + file_env MYSQL_ROOT_USER file_env MYSQL_ROOT_PASSWORD if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then @@ -157,7 +158,7 @@ check_variables_mysql() { if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" + DB_SERVER_ROOT_USER=${MYSQL_ROOT_USER:-"root"} DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi diff --git a/Dockerfiles/server-mysql/ol/docker-entrypoint.sh b/Dockerfiles/server-mysql/ol/docker-entrypoint.sh index 3f4db18b1..189ac0619 100755 --- a/Dockerfiles/server-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/ol/docker-entrypoint.sh @@ -143,6 +143,7 @@ check_variables_mysql() { file_env MYSQL_USER file_env MYSQL_PASSWORD + file_env MYSQL_ROOT_USER file_env MYSQL_ROOT_PASSWORD if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then @@ -157,7 +158,7 @@ check_variables_mysql() { if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" + DB_SERVER_ROOT_USER=${MYSQL_ROOT_USER:-"root"} DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi diff --git a/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh index 3f4db18b1..189ac0619 100755 --- a/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/rhel/docker-entrypoint.sh @@ -143,6 +143,7 @@ check_variables_mysql() { file_env MYSQL_USER file_env MYSQL_PASSWORD + file_env MYSQL_ROOT_USER file_env MYSQL_ROOT_PASSWORD if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then @@ -157,7 +158,7 @@ check_variables_mysql() { if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" + DB_SERVER_ROOT_USER=${MYSQL_ROOT_USER:-"root"} DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi diff --git a/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh index da2cb92f0..70d2e81c0 100755 --- a/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/server-mysql/ubuntu/docker-entrypoint.sh @@ -143,6 +143,7 @@ check_variables_mysql() { file_env MYSQL_USER file_env MYSQL_PASSWORD + file_env MYSQL_ROOT_USER file_env MYSQL_ROOT_PASSWORD if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then @@ -157,7 +158,7 @@ check_variables_mysql() { if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" + DB_SERVER_ROOT_USER=${MYSQL_ROOT_USER:-"root"} DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} fi diff --git a/Dockerfiles/web-apache-mysql/alpine/README.md b/Dockerfiles/web-apache-mysql/alpine/README.md index 615b18142..e2e774ab1 100644 --- a/Dockerfiles/web-apache-mysql/alpine/README.md +++ b/Dockerfiles/web-apache-mysql/alpine/README.md @@ -116,8 +116,6 @@ printf "zabbix" | docker secret create MYSQL_PASSWORD - docker run --name some-zabbix-web-apache-mysql -e DB_SERVER_HOST="some-mysql-server" -e MYSQL_USER_FILE=/run/secrets/MYSQL_USER -e MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD -e ZBX_SERVER_HOST="some-zabbix-server" -e PHP_TZ="some-timezone" -d zabbix/zabbix-web-apache-mysql:tag ``` -This method is also applicable for `MYSQL_ROOT_PASSWORD` with `MYSQL_ROOT_PASSWORD_FILE`. - By default, values for `MYSQL_USER` and `MYSQL_PASSWORD` are `zabbix`, `zabbix`. ### `MYSQL_DATABASE` diff --git a/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh index 1bcbe8291..1fdec25cb 100755 --- a/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/alpine/docker-entrypoint.sh @@ -59,32 +59,10 @@ file_env() { check_variables() { : ${DB_SERVER_HOST:="mysql-server"} : ${DB_SERVER_PORT:="3306"} - USE_DB_ROOT_USER=false - CREATE_ZBX_DB_USER=false + file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then - echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" - exit 1 - fi - - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then - echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" - exit 1 - fi - - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then - USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" - DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} - fi - - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true - - # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -119,10 +97,6 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -132,9 +106,9 @@ check_db_connect() { ssl_opts="$(db_tls_params)" - export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" + export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ROOT_USER} \ + while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ZBX_PASS} \ --silent --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT diff --git a/Dockerfiles/web-apache-mysql/centos/README.md b/Dockerfiles/web-apache-mysql/centos/README.md index 615b18142..e2e774ab1 100644 --- a/Dockerfiles/web-apache-mysql/centos/README.md +++ b/Dockerfiles/web-apache-mysql/centos/README.md @@ -116,8 +116,6 @@ printf "zabbix" | docker secret create MYSQL_PASSWORD - docker run --name some-zabbix-web-apache-mysql -e DB_SERVER_HOST="some-mysql-server" -e MYSQL_USER_FILE=/run/secrets/MYSQL_USER -e MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD -e ZBX_SERVER_HOST="some-zabbix-server" -e PHP_TZ="some-timezone" -d zabbix/zabbix-web-apache-mysql:tag ``` -This method is also applicable for `MYSQL_ROOT_PASSWORD` with `MYSQL_ROOT_PASSWORD_FILE`. - By default, values for `MYSQL_USER` and `MYSQL_PASSWORD` are `zabbix`, `zabbix`. ### `MYSQL_DATABASE` diff --git a/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh index 4b9cea9f0..fd6b7d4c8 100755 --- a/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/centos/docker-entrypoint.sh @@ -59,32 +59,10 @@ file_env() { check_variables() { : ${DB_SERVER_HOST:="mysql-server"} : ${DB_SERVER_PORT:="3306"} - USE_DB_ROOT_USER=false - CREATE_ZBX_DB_USER=false + file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then - echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" - exit 1 - fi - - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then - echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" - exit 1 - fi - - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then - USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" - DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} - fi - - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true - - # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -119,10 +97,6 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -132,9 +106,9 @@ check_db_connect() { ssl_opts="$(db_tls_params)" - export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" + export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ROOT_USER} \ + while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ZBX_USER} \ --silent --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT diff --git a/Dockerfiles/web-apache-mysql/ol/README.md b/Dockerfiles/web-apache-mysql/ol/README.md index 615b18142..e2e774ab1 100644 --- a/Dockerfiles/web-apache-mysql/ol/README.md +++ b/Dockerfiles/web-apache-mysql/ol/README.md @@ -116,8 +116,6 @@ printf "zabbix" | docker secret create MYSQL_PASSWORD - docker run --name some-zabbix-web-apache-mysql -e DB_SERVER_HOST="some-mysql-server" -e MYSQL_USER_FILE=/run/secrets/MYSQL_USER -e MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD -e ZBX_SERVER_HOST="some-zabbix-server" -e PHP_TZ="some-timezone" -d zabbix/zabbix-web-apache-mysql:tag ``` -This method is also applicable for `MYSQL_ROOT_PASSWORD` with `MYSQL_ROOT_PASSWORD_FILE`. - By default, values for `MYSQL_USER` and `MYSQL_PASSWORD` are `zabbix`, `zabbix`. ### `MYSQL_DATABASE` diff --git a/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh index 4b9cea9f0..fd6b7d4c8 100755 --- a/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/ol/docker-entrypoint.sh @@ -59,32 +59,10 @@ file_env() { check_variables() { : ${DB_SERVER_HOST:="mysql-server"} : ${DB_SERVER_PORT:="3306"} - USE_DB_ROOT_USER=false - CREATE_ZBX_DB_USER=false + file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then - echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" - exit 1 - fi - - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then - echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" - exit 1 - fi - - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then - USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" - DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} - fi - - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true - - # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -119,10 +97,6 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -132,9 +106,9 @@ check_db_connect() { ssl_opts="$(db_tls_params)" - export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" + export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ROOT_USER} \ + while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ZBX_USER} \ --silent --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT diff --git a/Dockerfiles/web-apache-mysql/ubuntu/README.md b/Dockerfiles/web-apache-mysql/ubuntu/README.md index 615b18142..e2e774ab1 100644 --- a/Dockerfiles/web-apache-mysql/ubuntu/README.md +++ b/Dockerfiles/web-apache-mysql/ubuntu/README.md @@ -116,8 +116,6 @@ printf "zabbix" | docker secret create MYSQL_PASSWORD - docker run --name some-zabbix-web-apache-mysql -e DB_SERVER_HOST="some-mysql-server" -e MYSQL_USER_FILE=/run/secrets/MYSQL_USER -e MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD -e ZBX_SERVER_HOST="some-zabbix-server" -e PHP_TZ="some-timezone" -d zabbix/zabbix-web-apache-mysql:tag ``` -This method is also applicable for `MYSQL_ROOT_PASSWORD` with `MYSQL_ROOT_PASSWORD_FILE`. - By default, values for `MYSQL_USER` and `MYSQL_PASSWORD` are `zabbix`, `zabbix`. ### `MYSQL_DATABASE` diff --git a/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh index 02bb119b6..3c7aa8f5d 100755 --- a/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-mysql/ubuntu/docker-entrypoint.sh @@ -59,32 +59,10 @@ file_env() { check_variables() { : ${DB_SERVER_HOST:="mysql-server"} : ${DB_SERVER_PORT:="3306"} - USE_DB_ROOT_USER=false - CREATE_ZBX_DB_USER=false + file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then - echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" - exit 1 - fi - - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then - echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" - exit 1 - fi - - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then - USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" - DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} - fi - - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true - - # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -119,10 +97,6 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -132,9 +106,9 @@ check_db_connect() { ssl_opts="$(db_tls_params)" - export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" + export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ROOT_USER} \ + while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ZBX_USER} \ --silent --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT diff --git a/Dockerfiles/web-apache-pgsql/alpine/docker-entrypoint.sh b/Dockerfiles/web-apache-pgsql/alpine/docker-entrypoint.sh index ff9be4364..7dfaadd8c 100755 --- a/Dockerfiles/web-apache-pgsql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-pgsql/alpine/docker-entrypoint.sh @@ -62,10 +62,6 @@ check_variables() { : ${DB_SERVER_HOST:="postgres-server"} : ${DB_SERVER_PORT:="5432"} - : ${CREATE_ZBX_DB_USER:="false"} - - DB_SERVER_ROOT_USER=${POSTGRES_USER:-"postgres"} - DB_SERVER_ROOT_PASS=${POSTGRES_PASSWORD:-""} DB_SERVER_ZBX_USER=${POSTGRES_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${POSTGRES_PASSWORD:-"zabbix"} @@ -84,20 +80,11 @@ check_db_connect() { echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi echo "********************" - if [ "${USE_DB_ROOT_USER}" != "true" ]; then - DB_SERVER_ROOT_USER=${DB_SERVER_ZBX_USER} - DB_SERVER_ROOT_PASS=${DB_SERVER_ZBX_PASS} - fi - if [ -n "${DB_SERVER_ZBX_PASS}" ]; then export PGPASSWORD="${DB_SERVER_ZBX_PASS}" fi @@ -116,7 +103,7 @@ check_db_connect() { export PGSSLKEY=${ZBX_DBTLSKEYFILE} fi - while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do + while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ZBX_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do echo "**** PostgreSQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done diff --git a/Dockerfiles/web-apache-pgsql/centos/docker-entrypoint.sh b/Dockerfiles/web-apache-pgsql/centos/docker-entrypoint.sh index 68e0475dc..ff63887e3 100755 --- a/Dockerfiles/web-apache-pgsql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-pgsql/centos/docker-entrypoint.sh @@ -62,10 +62,6 @@ check_variables() { : ${DB_SERVER_HOST:="postgres-server"} : ${DB_SERVER_PORT:="5432"} - : ${CREATE_ZBX_DB_USER:="false"} - - DB_SERVER_ROOT_USER=${POSTGRES_USER:-"postgres"} - DB_SERVER_ROOT_PASS=${POSTGRES_PASSWORD:-""} DB_SERVER_ZBX_USER=${POSTGRES_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${POSTGRES_PASSWORD:-"zabbix"} @@ -84,20 +80,11 @@ check_db_connect() { echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi echo "********************" - if [ "${USE_DB_ROOT_USER}" != "true" ]; then - DB_SERVER_ROOT_USER=${DB_SERVER_ZBX_USER} - DB_SERVER_ROOT_PASS=${DB_SERVER_ZBX_PASS} - fi - if [ -n "${DB_SERVER_ZBX_PASS}" ]; then export PGPASSWORD="${DB_SERVER_ZBX_PASS}" fi @@ -116,7 +103,7 @@ check_db_connect() { export PGSSLKEY=${ZBX_DBTLSKEYFILE} fi - while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do + while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ZBX_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do echo "**** PostgreSQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done diff --git a/Dockerfiles/web-apache-pgsql/ol/docker-entrypoint.sh b/Dockerfiles/web-apache-pgsql/ol/docker-entrypoint.sh index 68e0475dc..ff63887e3 100755 --- a/Dockerfiles/web-apache-pgsql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-pgsql/ol/docker-entrypoint.sh @@ -62,10 +62,6 @@ check_variables() { : ${DB_SERVER_HOST:="postgres-server"} : ${DB_SERVER_PORT:="5432"} - : ${CREATE_ZBX_DB_USER:="false"} - - DB_SERVER_ROOT_USER=${POSTGRES_USER:-"postgres"} - DB_SERVER_ROOT_PASS=${POSTGRES_PASSWORD:-""} DB_SERVER_ZBX_USER=${POSTGRES_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${POSTGRES_PASSWORD:-"zabbix"} @@ -84,20 +80,11 @@ check_db_connect() { echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi echo "********************" - if [ "${USE_DB_ROOT_USER}" != "true" ]; then - DB_SERVER_ROOT_USER=${DB_SERVER_ZBX_USER} - DB_SERVER_ROOT_PASS=${DB_SERVER_ZBX_PASS} - fi - if [ -n "${DB_SERVER_ZBX_PASS}" ]; then export PGPASSWORD="${DB_SERVER_ZBX_PASS}" fi @@ -116,7 +103,7 @@ check_db_connect() { export PGSSLKEY=${ZBX_DBTLSKEYFILE} fi - while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do + while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ZBX_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do echo "**** PostgreSQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done diff --git a/Dockerfiles/web-apache-pgsql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-apache-pgsql/ubuntu/docker-entrypoint.sh index 364620e34..1102d2ac1 100755 --- a/Dockerfiles/web-apache-pgsql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-apache-pgsql/ubuntu/docker-entrypoint.sh @@ -62,10 +62,6 @@ check_variables() { : ${DB_SERVER_HOST:="postgres-server"} : ${DB_SERVER_PORT:="5432"} - : ${CREATE_ZBX_DB_USER:="false"} - - DB_SERVER_ROOT_USER=${POSTGRES_USER:-"postgres"} - DB_SERVER_ROOT_PASS=${POSTGRES_PASSWORD:-""} DB_SERVER_ZBX_USER=${POSTGRES_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${POSTGRES_PASSWORD:-"zabbix"} @@ -84,20 +80,11 @@ check_db_connect() { echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi echo "********************" - if [ "${USE_DB_ROOT_USER}" != "true" ]; then - DB_SERVER_ROOT_USER=${DB_SERVER_ZBX_USER} - DB_SERVER_ROOT_PASS=${DB_SERVER_ZBX_PASS} - fi - if [ -n "${DB_SERVER_ZBX_PASS}" ]; then export PGPASSWORD="${DB_SERVER_ZBX_PASS}" fi @@ -116,7 +103,7 @@ check_db_connect() { export PGSSLKEY=${ZBX_DBTLSKEYFILE} fi - while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do + while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ZBX_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do echo "**** PostgreSQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done diff --git a/Dockerfiles/web-nginx-mysql/alpine/README.md b/Dockerfiles/web-nginx-mysql/alpine/README.md index 1470801c8..cc08161d1 100644 --- a/Dockerfiles/web-nginx-mysql/alpine/README.md +++ b/Dockerfiles/web-nginx-mysql/alpine/README.md @@ -116,8 +116,6 @@ printf "zabbix" | docker secret create MYSQL_PASSWORD - docker run --name some-zabbix-web-nginx-mysql -e DB_SERVER_HOST="some-mysql-server" -e MYSQL_USER_FILE=/run/secrets/MYSQL_USER -e MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD -e ZBX_SERVER_HOST="some-zabbix-server" -e PHP_TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag ``` -This method is also applicable for `MYSQL_ROOT_PASSWORD` with `MYSQL_ROOT_PASSWORD_FILE`. - By default, values for `MYSQL_USER` and `MYSQL_PASSWORD` are `zabbix`, `zabbix`. ### `MYSQL_DATABASE` diff --git a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh index ff8328d4b..a51300cc6 100755 --- a/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/alpine/docker-entrypoint.sh @@ -59,32 +59,10 @@ file_env() { check_variables() { : ${DB_SERVER_HOST:="mysql-server"} : ${DB_SERVER_PORT:="3306"} - USE_DB_ROOT_USER=false - CREATE_ZBX_DB_USER=false + file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then - echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" - exit 1 - fi - - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then - echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" - exit 1 - fi - - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then - USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" - DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} - fi - - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true - - # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -119,10 +97,6 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -132,9 +106,9 @@ check_db_connect() { ssl_opts="$(db_tls_params)" - export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" + export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ROOT_USER} \ + while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ZBX_USER} \ --silent --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT diff --git a/Dockerfiles/web-nginx-mysql/centos/README.md b/Dockerfiles/web-nginx-mysql/centos/README.md index 1470801c8..cc08161d1 100644 --- a/Dockerfiles/web-nginx-mysql/centos/README.md +++ b/Dockerfiles/web-nginx-mysql/centos/README.md @@ -116,8 +116,6 @@ printf "zabbix" | docker secret create MYSQL_PASSWORD - docker run --name some-zabbix-web-nginx-mysql -e DB_SERVER_HOST="some-mysql-server" -e MYSQL_USER_FILE=/run/secrets/MYSQL_USER -e MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD -e ZBX_SERVER_HOST="some-zabbix-server" -e PHP_TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag ``` -This method is also applicable for `MYSQL_ROOT_PASSWORD` with `MYSQL_ROOT_PASSWORD_FILE`. - By default, values for `MYSQL_USER` and `MYSQL_PASSWORD` are `zabbix`, `zabbix`. ### `MYSQL_DATABASE` diff --git a/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh index 36efaa136..e10775bc8 100755 --- a/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/centos/docker-entrypoint.sh @@ -59,32 +59,10 @@ file_env() { check_variables() { : ${DB_SERVER_HOST:="mysql-server"} : ${DB_SERVER_PORT:="3306"} - USE_DB_ROOT_USER=false - CREATE_ZBX_DB_USER=false + file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then - echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" - exit 1 - fi - - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then - echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" - exit 1 - fi - - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then - USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" - DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} - fi - - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true - - # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -119,10 +97,6 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -132,9 +106,9 @@ check_db_connect() { ssl_opts="$(db_tls_params)" - export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" + export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ROOT_USER} \ + while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ZBX_USER} \ --silent --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT diff --git a/Dockerfiles/web-nginx-mysql/ol/README.md b/Dockerfiles/web-nginx-mysql/ol/README.md index 1470801c8..cc08161d1 100644 --- a/Dockerfiles/web-nginx-mysql/ol/README.md +++ b/Dockerfiles/web-nginx-mysql/ol/README.md @@ -116,8 +116,6 @@ printf "zabbix" | docker secret create MYSQL_PASSWORD - docker run --name some-zabbix-web-nginx-mysql -e DB_SERVER_HOST="some-mysql-server" -e MYSQL_USER_FILE=/run/secrets/MYSQL_USER -e MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD -e ZBX_SERVER_HOST="some-zabbix-server" -e PHP_TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag ``` -This method is also applicable for `MYSQL_ROOT_PASSWORD` with `MYSQL_ROOT_PASSWORD_FILE`. - By default, values for `MYSQL_USER` and `MYSQL_PASSWORD` are `zabbix`, `zabbix`. ### `MYSQL_DATABASE` diff --git a/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh index 36efaa136..e10775bc8 100755 --- a/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/ol/docker-entrypoint.sh @@ -59,32 +59,10 @@ file_env() { check_variables() { : ${DB_SERVER_HOST:="mysql-server"} : ${DB_SERVER_PORT:="3306"} - USE_DB_ROOT_USER=false - CREATE_ZBX_DB_USER=false + file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then - echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" - exit 1 - fi - - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then - echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" - exit 1 - fi - - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then - USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" - DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} - fi - - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true - - # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -119,10 +97,6 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -132,9 +106,9 @@ check_db_connect() { ssl_opts="$(db_tls_params)" - export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" + export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ROOT_USER} \ + while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ZBX_USER} \ --silent --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT diff --git a/Dockerfiles/web-nginx-mysql/rhel/README.md b/Dockerfiles/web-nginx-mysql/rhel/README.md index 1470801c8..cc08161d1 100644 --- a/Dockerfiles/web-nginx-mysql/rhel/README.md +++ b/Dockerfiles/web-nginx-mysql/rhel/README.md @@ -116,8 +116,6 @@ printf "zabbix" | docker secret create MYSQL_PASSWORD - docker run --name some-zabbix-web-nginx-mysql -e DB_SERVER_HOST="some-mysql-server" -e MYSQL_USER_FILE=/run/secrets/MYSQL_USER -e MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD -e ZBX_SERVER_HOST="some-zabbix-server" -e PHP_TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag ``` -This method is also applicable for `MYSQL_ROOT_PASSWORD` with `MYSQL_ROOT_PASSWORD_FILE`. - By default, values for `MYSQL_USER` and `MYSQL_PASSWORD` are `zabbix`, `zabbix`. ### `MYSQL_DATABASE` diff --git a/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh index d41425c2a..c16b3a975 100755 --- a/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/rhel/docker-entrypoint.sh @@ -59,32 +59,10 @@ file_env() { check_variables() { : ${DB_SERVER_HOST:="mysql-server"} : ${DB_SERVER_PORT:="3306"} - USE_DB_ROOT_USER=false - CREATE_ZBX_DB_USER=false + file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then - echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" - exit 1 - fi - - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then - echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" - exit 1 - fi - - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then - USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" - DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} - fi - - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true - - # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -119,10 +97,6 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -132,9 +106,9 @@ check_db_connect() { ssl_opts="$(db_tls_params)" - export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" + export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ROOT_USER} \ + while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ZBX_USER} \ --silent --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT diff --git a/Dockerfiles/web-nginx-mysql/ubuntu/README.md b/Dockerfiles/web-nginx-mysql/ubuntu/README.md index 1470801c8..cc08161d1 100644 --- a/Dockerfiles/web-nginx-mysql/ubuntu/README.md +++ b/Dockerfiles/web-nginx-mysql/ubuntu/README.md @@ -116,8 +116,6 @@ printf "zabbix" | docker secret create MYSQL_PASSWORD - docker run --name some-zabbix-web-nginx-mysql -e DB_SERVER_HOST="some-mysql-server" -e MYSQL_USER_FILE=/run/secrets/MYSQL_USER -e MYSQL_PASSWORD_FILE=/run/secrets/MYSQL_PASSWORD -e ZBX_SERVER_HOST="some-zabbix-server" -e PHP_TZ="some-timezone" -d zabbix/zabbix-web-nginx-mysql:tag ``` -This method is also applicable for `MYSQL_ROOT_PASSWORD` with `MYSQL_ROOT_PASSWORD_FILE`. - By default, values for `MYSQL_USER` and `MYSQL_PASSWORD` are `zabbix`, `zabbix`. ### `MYSQL_DATABASE` diff --git a/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh index c84414adc..cfa406eb5 100755 --- a/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-mysql/ubuntu/docker-entrypoint.sh @@ -59,32 +59,10 @@ file_env() { check_variables() { : ${DB_SERVER_HOST:="mysql-server"} : ${DB_SERVER_PORT:="3306"} - USE_DB_ROOT_USER=false - CREATE_ZBX_DB_USER=false + file_env MYSQL_USER file_env MYSQL_PASSWORD - if [ ! -n "${MYSQL_USER}" ] && [ "${MYSQL_RANDOM_ROOT_PASSWORD,,}" == "true" ]; then - echo "**** Impossible to use MySQL server because of unknown Zabbix user and random 'root' password" - exit 1 - fi - - if [ ! -n "${MYSQL_USER}" ] && [ ! -n "${MYSQL_ROOT_PASSWORD}" ] && [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" != "true" ]; then - echo "*** Impossible to use MySQL server because 'root' password is not defined and it is not empty" - exit 1 - fi - - if [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || [ -n "${MYSQL_ROOT_PASSWORD}" ]; then - USE_DB_ROOT_USER=true - DB_SERVER_ROOT_USER="root" - DB_SERVER_ROOT_PASS=${MYSQL_ROOT_PASSWORD:-""} - fi - - [ -n "${MYSQL_USER}" ] && CREATE_ZBX_DB_USER=true - - # If root password is not specified use provided credentials - : ${DB_SERVER_ROOT_USER:=${MYSQL_USER}} - [ "${MYSQL_ALLOW_EMPTY_PASSWORD,,}" == "true" ] || DB_SERVER_ROOT_PASS=${DB_SERVER_ROOT_PASS:-${MYSQL_PASSWORD}} DB_SERVER_ZBX_USER=${MYSQL_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${MYSQL_PASSWORD:-"zabbix"} @@ -119,10 +97,6 @@ check_db_connect() { echo "* DB_SERVER_PORT: ${DB_SERVER_PORT}" echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi @@ -132,9 +106,9 @@ check_db_connect() { ssl_opts="$(db_tls_params)" - export MYSQL_PWD="${DB_SERVER_ROOT_PASS}" + export MYSQL_PWD="${DB_SERVER_ZBX_PASS}" - while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ROOT_USER} \ + while [ ! "$(mysqladmin ping -h ${DB_SERVER_HOST} -P ${DB_SERVER_PORT} -u ${DB_SERVER_ZBX_USER} \ --silent --connect_timeout=10 $ssl_opts)" ]; do echo "**** MySQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT diff --git a/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh index 9a732c72f..2d805d0dd 100755 --- a/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/alpine/docker-entrypoint.sh @@ -62,10 +62,6 @@ check_variables() { : ${DB_SERVER_HOST:="postgres-server"} : ${DB_SERVER_PORT:="5432"} - : ${CREATE_ZBX_DB_USER:="false"} - - DB_SERVER_ROOT_USER=${POSTGRES_USER:-"postgres"} - DB_SERVER_ROOT_PASS=${POSTGRES_PASSWORD:-""} DB_SERVER_ZBX_USER=${POSTGRES_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${POSTGRES_PASSWORD:-"zabbix"} @@ -84,20 +80,11 @@ check_db_connect() { echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi echo "********************" - if [ "${USE_DB_ROOT_USER}" != "true" ]; then - DB_SERVER_ROOT_USER=${DB_SERVER_ZBX_USER} - DB_SERVER_ROOT_PASS=${DB_SERVER_ZBX_PASS} - fi - if [ -n "${DB_SERVER_ZBX_PASS}" ]; then export PGPASSWORD="${DB_SERVER_ZBX_PASS}" fi @@ -116,7 +103,7 @@ check_db_connect() { export PGSSLKEY=${ZBX_DBTLSKEYFILE} fi - while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do + while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ZBX_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do echo "**** PostgreSQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done diff --git a/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh index f671a6a6e..9b71bfd99 100755 --- a/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/centos/docker-entrypoint.sh @@ -62,10 +62,6 @@ check_variables() { : ${DB_SERVER_HOST:="postgres-server"} : ${DB_SERVER_PORT:="5432"} - : ${CREATE_ZBX_DB_USER:="false"} - - DB_SERVER_ROOT_USER=${POSTGRES_USER:-"postgres"} - DB_SERVER_ROOT_PASS=${POSTGRES_PASSWORD:-""} DB_SERVER_ZBX_USER=${POSTGRES_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${POSTGRES_PASSWORD:-"zabbix"} @@ -84,20 +80,11 @@ check_db_connect() { echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi echo "********************" - if [ "${USE_DB_ROOT_USER}" != "true" ]; then - DB_SERVER_ROOT_USER=${DB_SERVER_ZBX_USER} - DB_SERVER_ROOT_PASS=${DB_SERVER_ZBX_PASS} - fi - if [ -n "${DB_SERVER_ZBX_PASS}" ]; then export PGPASSWORD="${DB_SERVER_ZBX_PASS}" fi @@ -116,7 +103,7 @@ check_db_connect() { export PGSSLKEY=${ZBX_DBTLSKEYFILE} fi - while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do + while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ZBX_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do echo "**** PostgreSQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done diff --git a/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh index f671a6a6e..9b71bfd99 100755 --- a/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/ol/docker-entrypoint.sh @@ -62,10 +62,6 @@ check_variables() { : ${DB_SERVER_HOST:="postgres-server"} : ${DB_SERVER_PORT:="5432"} - : ${CREATE_ZBX_DB_USER:="false"} - - DB_SERVER_ROOT_USER=${POSTGRES_USER:-"postgres"} - DB_SERVER_ROOT_PASS=${POSTGRES_PASSWORD:-""} DB_SERVER_ZBX_USER=${POSTGRES_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${POSTGRES_PASSWORD:-"zabbix"} @@ -84,20 +80,11 @@ check_db_connect() { echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi echo "********************" - if [ "${USE_DB_ROOT_USER}" != "true" ]; then - DB_SERVER_ROOT_USER=${DB_SERVER_ZBX_USER} - DB_SERVER_ROOT_PASS=${DB_SERVER_ZBX_PASS} - fi - if [ -n "${DB_SERVER_ZBX_PASS}" ]; then export PGPASSWORD="${DB_SERVER_ZBX_PASS}" fi @@ -116,7 +103,7 @@ check_db_connect() { export PGSSLKEY=${ZBX_DBTLSKEYFILE} fi - while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do + while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ZBX_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do echo "**** PostgreSQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done diff --git a/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh b/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh index 1ef73a712..d228146d9 100755 --- a/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh +++ b/Dockerfiles/web-nginx-pgsql/ubuntu/docker-entrypoint.sh @@ -62,10 +62,6 @@ check_variables() { : ${DB_SERVER_HOST:="postgres-server"} : ${DB_SERVER_PORT:="5432"} - : ${CREATE_ZBX_DB_USER:="false"} - - DB_SERVER_ROOT_USER=${POSTGRES_USER:-"postgres"} - DB_SERVER_ROOT_PASS=${POSTGRES_PASSWORD:-""} DB_SERVER_ZBX_USER=${POSTGRES_USER:-"zabbix"} DB_SERVER_ZBX_PASS=${POSTGRES_PASSWORD:-"zabbix"} @@ -84,20 +80,11 @@ check_db_connect() { echo "* DB_SERVER_DBNAME: ${DB_SERVER_DBNAME}" echo "* DB_SERVER_SCHEMA: ${DB_SERVER_SCHEMA}" if [ "${DEBUG_MODE,,}" == "true" ]; then - if [ "${USE_DB_ROOT_USER}" == "true" ]; then - echo "* DB_SERVER_ROOT_USER: ${DB_SERVER_ROOT_USER}" - echo "* DB_SERVER_ROOT_PASS: ${DB_SERVER_ROOT_PASS}" - fi echo "* DB_SERVER_ZBX_USER: ${DB_SERVER_ZBX_USER}" echo "* DB_SERVER_ZBX_PASS: ${DB_SERVER_ZBX_PASS}" fi echo "********************" - if [ "${USE_DB_ROOT_USER}" != "true" ]; then - DB_SERVER_ROOT_USER=${DB_SERVER_ZBX_USER} - DB_SERVER_ROOT_PASS=${DB_SERVER_ZBX_PASS} - fi - if [ -n "${DB_SERVER_ZBX_PASS}" ]; then export PGPASSWORD="${DB_SERVER_ZBX_PASS}" fi @@ -116,7 +103,7 @@ check_db_connect() { export PGSSLKEY=${ZBX_DBTLSKEYFILE} fi - while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ROOT_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do + while [ ! "$(psql --host ${DB_SERVER_HOST} --port ${DB_SERVER_PORT} --username ${DB_SERVER_ZBX_USER} --dbname ${DB_SERVER_DBNAME} --list --quiet 2>/dev/null)" ]; do echo "**** PostgreSQL server is not available. Waiting $WAIT_TIMEOUT seconds..." sleep $WAIT_TIMEOUT done diff --git a/docker-compose_v3_alpine_mysql_latest.yaml b/docker-compose_v3_alpine_mysql_latest.yaml index b6e13f2ef..e12724fc9 100644 --- a/docker-compose_v3_alpine_mysql_latest.yaml +++ b/docker-compose_v3_alpine_mysql_latest.yaml @@ -34,6 +34,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -151,6 +152,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -487,6 +489,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD # client-key.pem: diff --git a/docker-compose_v3_alpine_mysql_local.yaml b/docker-compose_v3_alpine_mysql_local.yaml index 5e0e71c67..f28ba222e 100644 --- a/docker-compose_v3_alpine_mysql_local.yaml +++ b/docker-compose_v3_alpine_mysql_local.yaml @@ -71,6 +71,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -203,6 +204,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -583,6 +585,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD # client-key.pem: diff --git a/docker-compose_v3_alpine_pgsql_latest.yaml b/docker-compose_v3_alpine_pgsql_latest.yaml index c30bf5ef8..4135146fd 100644 --- a/docker-compose_v3_alpine_pgsql_latest.yaml +++ b/docker-compose_v3_alpine_pgsql_latest.yaml @@ -146,6 +146,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD depends_on: - mysql-server @@ -506,6 +507,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_var/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD POSTGRES_USER: diff --git a/docker-compose_v3_alpine_pgsql_local.yaml b/docker-compose_v3_alpine_pgsql_local.yaml index 11beb41c9..1263ce6b7 100644 --- a/docker-compose_v3_alpine_pgsql_local.yaml +++ b/docker-compose_v3_alpine_pgsql_local.yaml @@ -210,6 +210,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD depends_on: - mysql-server @@ -613,6 +614,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD POSTGRES_USER: diff --git a/docker-compose_v3_centos_mysql_latest.yaml b/docker-compose_v3_centos_mysql_latest.yaml index 7c69d6035..5d153a2d4 100644 --- a/docker-compose_v3_centos_mysql_latest.yaml +++ b/docker-compose_v3_centos_mysql_latest.yaml @@ -34,6 +34,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -151,6 +152,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -486,6 +488,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD # client-key.pem: diff --git a/docker-compose_v3_centos_mysql_local.yaml b/docker-compose_v3_centos_mysql_local.yaml index 52b34de56..a9f063cc4 100644 --- a/docker-compose_v3_centos_mysql_local.yaml +++ b/docker-compose_v3_centos_mysql_local.yaml @@ -71,6 +71,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -203,6 +204,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -580,6 +582,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD # client-key.pem: diff --git a/docker-compose_v3_centos_pgsql_latest.yaml b/docker-compose_v3_centos_pgsql_latest.yaml index 168b215c8..a4bc90fb2 100644 --- a/docker-compose_v3_centos_pgsql_latest.yaml +++ b/docker-compose_v3_centos_pgsql_latest.yaml @@ -146,6 +146,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD depends_on: - mysql-server @@ -505,6 +506,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD POSTGRES_USER: diff --git a/docker-compose_v3_centos_pgsql_local.yaml b/docker-compose_v3_centos_pgsql_local.yaml index c60086f09..1c212c8ec 100644 --- a/docker-compose_v3_centos_pgsql_local.yaml +++ b/docker-compose_v3_centos_pgsql_local.yaml @@ -210,6 +210,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD depends_on: - mysql-server @@ -612,6 +613,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD POSTGRES_USER: diff --git a/docker-compose_v3_ol_mysql_latest.yaml b/docker-compose_v3_ol_mysql_latest.yaml index d69ff0a4b..c2e3a0236 100644 --- a/docker-compose_v3_ol_mysql_latest.yaml +++ b/docker-compose_v3_ol_mysql_latest.yaml @@ -34,6 +34,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -151,6 +152,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -486,6 +488,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD # client-key.pem: diff --git a/docker-compose_v3_ol_mysql_local.yaml b/docker-compose_v3_ol_mysql_local.yaml index d028eefe1..6f4823fc5 100644 --- a/docker-compose_v3_ol_mysql_local.yaml +++ b/docker-compose_v3_ol_mysql_local.yaml @@ -71,6 +71,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -203,6 +204,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -580,6 +582,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD # client-key.pem: diff --git a/docker-compose_v3_ol_pgsql_latest.yaml b/docker-compose_v3_ol_pgsql_latest.yaml index 7f97e63dd..c71d78afc 100644 --- a/docker-compose_v3_ol_pgsql_latest.yaml +++ b/docker-compose_v3_ol_pgsql_latest.yaml @@ -146,6 +146,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD depends_on: - mysql-server @@ -505,6 +506,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD POSTGRES_USER: diff --git a/docker-compose_v3_ol_pgsql_local.yaml b/docker-compose_v3_ol_pgsql_local.yaml index 220a8d3dd..ebcfbfedc 100644 --- a/docker-compose_v3_ol_pgsql_local.yaml +++ b/docker-compose_v3_ol_pgsql_local.yaml @@ -210,6 +210,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD depends_on: - mysql-server @@ -612,6 +613,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD POSTGRES_USER: diff --git a/docker-compose_v3_ubuntu_mysql_latest.yaml b/docker-compose_v3_ubuntu_mysql_latest.yaml index 36429839c..8e6b5aea4 100644 --- a/docker-compose_v3_ubuntu_mysql_latest.yaml +++ b/docker-compose_v3_ubuntu_mysql_latest.yaml @@ -33,6 +33,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -146,6 +147,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -478,6 +480,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD # client-key.pem: diff --git a/docker-compose_v3_ubuntu_mysql_local.yaml b/docker-compose_v3_ubuntu_mysql_local.yaml index 374955216..b5fc6a788 100644 --- a/docker-compose_v3_ubuntu_mysql_local.yaml +++ b/docker-compose_v3_ubuntu_mysql_local.yaml @@ -70,6 +70,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -200,6 +201,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD # - client-key.pem # - client-cert.pem @@ -574,6 +576,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD # client-key.pem: diff --git a/docker-compose_v3_ubuntu_pgsql_latest.yaml b/docker-compose_v3_ubuntu_pgsql_latest.yaml index 721026132..6f4ce3861 100644 --- a/docker-compose_v3_ubuntu_pgsql_latest.yaml +++ b/docker-compose_v3_ubuntu_pgsql_latest.yaml @@ -143,6 +143,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD depends_on: - mysql-server @@ -499,6 +500,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD POSTGRES_USER: diff --git a/docker-compose_v3_ubuntu_pgsql_local.yaml b/docker-compose_v3_ubuntu_pgsql_local.yaml index 05e0d2f67..a1227dd14 100644 --- a/docker-compose_v3_ubuntu_pgsql_local.yaml +++ b/docker-compose_v3_ubuntu_pgsql_local.yaml @@ -207,6 +207,7 @@ services: secrets: - MYSQL_USER - MYSQL_PASSWORD + - MYSQL_ROOT_USER - MYSQL_ROOT_PASSWORD depends_on: - mysql-server @@ -606,6 +607,8 @@ secrets: file: ./env_vars/.MYSQL_USER MYSQL_PASSWORD: file: ./env_vars/.MYSQL_PASSWORD + MYSQL_ROOT_USER: + file: ./env_vars/.MYSQL_ROOT_USER MYSQL_ROOT_PASSWORD: file: ./env_vars/.MYSQL_ROOT_PASSWORD POSTGRES_USER: diff --git a/env_vars/.MYSQL_ROOT_USER b/env_vars/.MYSQL_ROOT_USER new file mode 100644 index 000000000..93ca1422a --- /dev/null +++ b/env_vars/.MYSQL_ROOT_USER @@ -0,0 +1 @@ +root \ No newline at end of file