mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-21 21:33:28 +01:00
Merge pull request #47 from tpansino/bug/46-fix-docker-secrets
Fix Docker Secrets injection from DB_USER_FILE/DB_PASS_FILE
This commit is contained in:
@@ -33,23 +33,23 @@ case "$dbtype" in
|
||||
"mongo" | "mongodb" | "MONGO" | "MONGODB" )
|
||||
dbtype=mongo
|
||||
dbport=${DB_PORT:-27017}
|
||||
[[ ( -n "${DB_USER}" ) ]] && file_env 'DB_USER'
|
||||
[[ ( -n "${DB_PASS}" ) ]] && file_env 'DB_PASS'
|
||||
[[ ( -n "${DB_USER}" ) || ( -n "${DB_USER_FILE}" ) ]] && file_env 'DB_USER'
|
||||
[[ ( -n "${DB_PASS}" ) || ( -n "${DB_PASS_FILE}" ) ]] && file_env 'DB_PASS'
|
||||
;;
|
||||
"mysql" | "MYSQL" | "mariadb" | "MARIADB")
|
||||
dbtype=mysql
|
||||
dbport=${DB_PORT:-3306}
|
||||
[[ ( -n "${DB_PASS}" ) ]] && file_env 'DB_PASS'
|
||||
[[ ( -n "${DB_PASS}" ) || ( -n "${DB_PASS_FILE}" ) ]] && file_env 'DB_PASS'
|
||||
;;
|
||||
"postgres" | "postgresql" | "pgsql" | "POSTGRES" | "POSTGRESQL" | "PGSQL" )
|
||||
dbtype=pgsql
|
||||
dbport=${DB_PORT:-5432}
|
||||
[[ ( -n "${DB_PASS}" ) ]] && file_env 'DB_PASS'
|
||||
[[ ( -n "${DB_PASS}" ) || ( -n "${DB_PASS_FILE}" ) ]] && file_env 'DB_PASS'
|
||||
;;
|
||||
"redis" | "REDIS" )
|
||||
dbtype=redis
|
||||
dbport=${DB_PORT:-6379}
|
||||
[[ ( -n "${DB_PASS}" ) ]] && file_env 'DB_PASS'
|
||||
[[ ( -n "${DB_PASS}" || ( -n "${DB_PASS_FILE}" ) ) ]] && file_env 'DB_PASS'
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user