77# Allow sensitive settings to be defined in a file
88# in order to support Docker secrets
99if [ -n " ${POSTGRES_PASSWORD_FILE} " ]; then
10+ if [ ! -r " $POSTGRES_PASSWORD_FILE " ]; then
11+ echo " Error: Password file '$POSTGRES_PASSWORD_FILE ' not found or not readable" >&2
12+ exit 1
13+ fi
1014 POSTGRES_PASSWORD=$( cat " $POSTGRES_PASSWORD_FILE " )
1115 export POSTGRES_PASSWORD
1216fi
1317
1418if [ -n " ${REDIS_PASSWORD_FILE} " ]; then
19+ if [ ! -r " $REDIS_PASSWORD_FILE " ]; then
20+ echo " Error: Password file '$REDIS_PASSWORD_FILE ' not found or not readable" >&2
21+ exit 1
22+ fi
1523 REDIS_PASSWORD=$( cat " $REDIS_PASSWORD_FILE " )
1624 export REDIS_PASSWORD
1725fi
@@ -22,16 +30,28 @@ if [ -z "$CLIENT_MAX_BODY_SIZE" ]; then
2230fi
2331
2432if [ -n " ${WEBLATE_ADMIN_PASSWORD_FILE} " ]; then
33+ if [ ! -r " $WEBLATE_ADMIN_PASSWORD_FILE " ]; then
34+ echo " Error: Password file '$WEBLATE_ADMIN_PASSWORD_FILE ' not found or not readable" >&2
35+ exit 1
36+ fi
2537 WEBLATE_ADMIN_PASSWORD=$( cat " $WEBLATE_ADMIN_PASSWORD_FILE " )
2638 export WEBLATE_ADMIN_PASSWORD
2739fi
2840
2941if [ -n " ${WEBLATE_EMAIL_HOST_PASSWORD_FILE} " ]; then
42+ if [ ! -r " $WEBLATE_EMAIL_HOST_PASSWORD_FILE " ]; then
43+ echo " Error: Password file '$WEBLATE_EMAIL_HOST_PASSWORD_FILE ' not found or not readable" >&2
44+ exit 1
45+ fi
3046 WEBLATE_EMAIL_HOST_PASSWORD=$( cat " $WEBLATE_EMAIL_HOST_PASSWORD_FILE " )
3147 export WEBLATE_EMAIL_HOST_PASSWORD
3248fi
3349
3450if [ -n " ${WEBLATE_AUTH_LDAP_BIND_PASSWORD_FILE} " ]; then
51+ if [ ! -r " $WEBLATE_AUTH_LDAP_BIND_PASSWORD_FILE " ]; then
52+ echo " Error: Password file '$WEBLATE_AUTH_LDAP_BIND_PASSWORD_FILE ' not found or not readable" >&2
53+ exit 1
54+ fi
3555 WEBLATE_AUTH_LDAP_BIND_PASSWORD=$( cat " $WEBLATE_AUTH_LDAP_BIND_PASSWORD_FILE " )
3656 export WEBLATE_AUTH_LDAP_BIND_PASSWORD
3757fi
0 commit comments