Skip to content

Commit fa85def

Browse files
Apply suggested fix to start from Copilot Autofix
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
1 parent 9205ea3 commit fa85def

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

start

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,19 @@ set -e
77
# Allow sensitive settings to be defined in a file
88
# in order to support Docker secrets
99
if [ -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
1216
fi
1317

1418
if [ -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
1725
fi
@@ -22,16 +30,28 @@ if [ -z "$CLIENT_MAX_BODY_SIZE" ]; then
2230
fi
2331

2432
if [ -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
2739
fi
2840

2941
if [ -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
3248
fi
3349

3450
if [ -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
3757
fi

0 commit comments

Comments
 (0)