[bitnami/phpmyadmin] Support user & password for phpmyadmin (#12817)

Signed-off-by: Nobi <nobi@nobidev.com>

Signed-off-by: Nobi <nobi@nobidev.com>
This commit is contained in:
Nguyễn Đức Chiến 2022-11-14 04:40:06 -08:00 committed by GitHub
parent 39bd7be1b2
commit 3bbb1b4771
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 0 deletions

View File

@ -117,6 +117,13 @@ phpmyadmin_initialize() {
! is_empty_value "$CONFIGURATION_ALLOWDENY_ORDER" && phpmyadmin_conf_set "\$cfg['Servers'][\$i]['AllowDeny']['order']" "$ALLOWDENY_ORDER"
! is_empty_value "$CONFIGURATION_ALLOWDENY_RULES" && phpmyadmin_conf_set "\$cfg['Servers'][\$i]['AllowDeny']['rules']" "array($ALLOWDENY_RULES)" yes
# Configure automatic login with account
if ! is_empty_value "$DATABASE_USER"; then
info "Setting auth_type option" && phpmyadmin_conf_set "\$cfg['Servers'][\$i]['auth_type']" config
info "Setting database user option" && phpmyadmin_conf_set "\$cfg['Servers'][\$i]['user']" "$DATABASE_USER"
! is_empty_value "$DATABASE_PASSWORD" && info "Setting database password option" && phpmyadmin_conf_set "\$cfg['Servers'][\$i]['password']" "$DATABASE_PASSWORD"
fi
# Generate random blowfish secret, used for encrypting
info "Setting blowfish_secret option to a randomly generated value"
local blowfish_secret

View File

@ -26,6 +26,8 @@ phpmyadmin_env_vars=(
PHPMYADMIN_ALLOW_REMOTE_CONNECTIONS
PHPMYADMIN_ABSOLUTE_URI
DATABASE_HOST
DATABASE_USER
DATABASE_PASSWORD
DATABASE_PORT_NUMBER
DATABASE_ALLOW_NO_PASSWORD
DATABASE_ENABLE_SSL
@ -76,6 +78,8 @@ export PHPMYADMIN_ABSOLUTE_URI="${PHPMYADMIN_ABSOLUTE_URI:-}"
# Database configuration
export DATABASE_DEFAULT_HOST="mariadb" # only used at build time
export DATABASE_HOST="${DATABASE_HOST:-}"
export DATABASE_USER="${DATABASE_USER:-}"
export DATABASE_PASSWORD="${DATABASE_PASSWORD:-}"
export DATABASE_DEFAULT_PORT_NUMBER="3306" # only used at build time
export DATABASE_PORT_NUMBER="${DATABASE_PORT_NUMBER:-}"
export DATABASE_DEFAULT_ALLOW_NO_PASSWORD="yes" # only used at build time

View File

@ -175,6 +175,8 @@ The phpMyAdmin instance can be customized by specifying environment variables on
- `PHPMYADMIN_ABSOLUTE_URI`: If specified, absolute URL to phpMyAdmin when generating links. No defaults
- `DATABASE_ALLOW_NO_PASSWORD`: Whether to allow logins without a password. Default: **yes**
- `DATABASE_HOST`: Database server host. Default: **mariadb**
- `DATABASE_USER`: Database username.
- `DATABASE_PASSWORD`: Database password.
- `DATABASE_PORT_NUMBER`: Database server port. Default: **3306**
- `DATABASE_ENABLE_SSL`: Whether to enable SSL for the connection between phpMyAdmin and the MySQL server to secure the connection. Default: **no**
- `DATABASE_SSL_KEY`: Path to the client key file when using SSL. Default: **no**