kopia lustrzana https://github.com/mumble-voip/mumble-docker
fix: Address code review comments
- Split comment in config file into two lines - De-duplicate incovation for setting superuser passwordpull/29/head
rodzic
c8b2fb353c
commit
c0ac92af44
|
@ -74,7 +74,8 @@ if [[ -f "$MUMBLE_CUSTOM_CONFIG_FILE" ]]; then
|
||||||
CONFIG_FILE="$MUMBLE_CUSTOM_CONFIG_FILE"
|
CONFIG_FILE="$MUMBLE_CUSTOM_CONFIG_FILE"
|
||||||
else
|
else
|
||||||
# Ensures the config file is empty, starting from a clean slate
|
# Ensures the config file is empty, starting from a clean slate
|
||||||
echo -e "# Config file automatically generated from the MUMBLE_CONFIG_* environment variables or secrets in /run/secrets/MUMBLE_CONFIG_* files\n" > "${CONFIG_FILE}"
|
echo -e "# Config file automatically generated from the MUMBLE_CONFIG_* environment variables" > "${CONFIG_FILE}"
|
||||||
|
echo -e "# or secrets in /run/secrets/MUMBLE_CONFIG_* files\n" >> "${CONFIG_FILE}"
|
||||||
|
|
||||||
# Process settings through variables of format MUMBLE_CONFIG_*
|
# Process settings through variables of format MUMBLE_CONFIG_*
|
||||||
|
|
||||||
|
@ -111,7 +112,7 @@ else
|
||||||
else
|
else
|
||||||
set_config "$config_option" "$(cat $secret_file)"
|
set_config "$config_option" "$(cat $secret_file)"
|
||||||
fi
|
fi
|
||||||
done < <(ls /run/secrets | sed -n 's/^MUMBLE_CONFIG_//p')
|
done < <( ls /run/secrets | sed -n 's/^MUMBLE_CONFIG_//p' )
|
||||||
|
|
||||||
# Apply default settings if they're missing
|
# Apply default settings if they're missing
|
||||||
|
|
||||||
|
@ -147,10 +148,11 @@ fi
|
||||||
server_invocation+=( "-ini" "${CONFIG_FILE}")
|
server_invocation+=( "-ini" "${CONFIG_FILE}")
|
||||||
|
|
||||||
if [[ -f /run/secrets/MUMBLE_SUPERUSER_PASSWORD ]]; then
|
if [[ -f /run/secrets/MUMBLE_SUPERUSER_PASSWORD ]]; then
|
||||||
#Variable to change the superuser password
|
MUMBLE_SUPERUSER_PASSWORD="$(cat /run/secrets/MUMBLE_SUPERUSER_PASSWORD)"
|
||||||
"${server_invocation[@]}" -supw "$(cat /run/secrets/MUMBLE_SUPERUSER_PASSWORD)"
|
echo "Read superuser password from container secret"
|
||||||
echo "Successfully configured superuser password from container secret"
|
fi
|
||||||
elif [[ -n "${MUMBLE_SUPERUSER_PASSWORD}" ]]; then
|
|
||||||
|
if [[ -n "${MUMBLE_SUPERUSER_PASSWORD}" ]]; then
|
||||||
#Variable to change the superuser password
|
#Variable to change the superuser password
|
||||||
"${server_invocation[@]}" -supw "$MUMBLE_SUPERUSER_PASSWORD"
|
"${server_invocation[@]}" -supw "$MUMBLE_SUPERUSER_PASSWORD"
|
||||||
echo "Successfully configured superuser password"
|
echo "Successfully configured superuser password"
|
||||||
|
|
Ładowanie…
Reference in New Issue