mirror of
https://github.com/tiredofit/docker-db-backup.git
synced 2025-12-23 22:18:10 +01:00
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" )
|
"mongo" | "mongodb" | "MONGO" | "MONGODB" )
|
||||||
dbtype=mongo
|
dbtype=mongo
|
||||||
dbport=${DB_PORT:-27017}
|
dbport=${DB_PORT:-27017}
|
||||||
[[ ( -n "${DB_USER}" ) ]] && file_env 'DB_USER'
|
[[ ( -n "${DB_USER}" ) || ( -n "${DB_USER_FILE}" ) ]] && file_env 'DB_USER'
|
||||||
[[ ( -n "${DB_PASS}" ) ]] && file_env 'DB_PASS'
|
[[ ( -n "${DB_PASS}" ) || ( -n "${DB_PASS_FILE}" ) ]] && file_env 'DB_PASS'
|
||||||
;;
|
;;
|
||||||
"mysql" | "MYSQL" | "mariadb" | "MARIADB")
|
"mysql" | "MYSQL" | "mariadb" | "MARIADB")
|
||||||
dbtype=mysql
|
dbtype=mysql
|
||||||
dbport=${DB_PORT:-3306}
|
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" )
|
"postgres" | "postgresql" | "pgsql" | "POSTGRES" | "POSTGRESQL" | "PGSQL" )
|
||||||
dbtype=pgsql
|
dbtype=pgsql
|
||||||
dbport=${DB_PORT:-5432}
|
dbport=${DB_PORT:-5432}
|
||||||
[[ ( -n "${DB_PASS}" ) ]] && file_env 'DB_PASS'
|
[[ ( -n "${DB_PASS}" ) || ( -n "${DB_PASS_FILE}" ) ]] && file_env 'DB_PASS'
|
||||||
;;
|
;;
|
||||||
"redis" | "REDIS" )
|
"redis" | "REDIS" )
|
||||||
dbtype=redis
|
dbtype=redis
|
||||||
dbport=${DB_PORT:-6379}
|
dbport=${DB_PORT:-6379}
|
||||||
[[ ( -n "${DB_PASS}" ) ]] && file_env 'DB_PASS'
|
[[ ( -n "${DB_PASS}" || ( -n "${DB_PASS_FILE}" ) ) ]] && file_env 'DB_PASS'
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user