Compare commits

..

1 Commits

Author SHA1 Message Date
aki
9ac533865d fix(update-setup): Improve Authelia configuration update logic and replace placeholders
Some checks failed
/ validate-docker-compose (push) Has been cancelled
2025-04-26 20:27:19 +08:00

View File

@ -272,30 +272,30 @@ update_authelia_config() {
local existing_notifier=$(yq e '.notifier // ""' "$AUTHELIA_CONFIG_BACKUP")
# Update secrets in temp file if they existed in the backup
if [[ -n "$existing_jwt_secret" && "$existing_jwt_secret" != '""' && "$existing_jwt_secret" != "null" ]]; then
existing_jwt_secret="$existing_jwt_secret" \
yq e -i '.identity_validation.reset_password.jwt_secret = strenv(existing_jwt_secret)' "$TEMP_CONFIG"
fi
if [[ -n "$existing_jwt_secret" && "$existing_jwt_secret" != '""' && "$existing_jwt_secret" != "null" ]]; then
existing_jwt_secret="$existing_jwt_secret" \
yq e -i '.identity_validation.reset_password.jwt_secret = strenv(existing_jwt_secret)' "$TEMP_CONFIG"
fi
if [[ -n "$existing_session_secret" && "$existing_session_secret" != '""' && "$existing_session_secret" != "null" ]]; then
existing_session_secret="$existing_session_secret" \
yq e -i '.session.secret = strenv(existing_session_secret)' "$TEMP_CONFIG"
fi
if [[ -n "$existing_session_secret" && "$existing_session_secret" != '""' && "$existing_session_secret" != "null" ]]; then
existing_session_secret="$existing_session_secret" \
yq e -i '.session.secret = strenv(existing_session_secret)' "$TEMP_CONFIG"
fi
if [[ -n "$existing_storage_key" && "$existing_storage_key" != '""' && "$existing_storage_key" != "null" ]]; then
existing_storage_key="$existing_storage_key" \
yq e -i '.storage.encryption_key = strenv(existing_storage_key)' "$TEMP_CONFIG"
fi
if [[ -n "$existing_storage_key" && "$existing_storage_key" != '""' && "$existing_storage_key" != "null" ]]; then
existing_storage_key="$existing_storage_key" \
yq e -i '.storage.encryption_key = strenv(existing_storage_key)' "$TEMP_CONFIG"
fi
if [[ -n "$existing_redis_pass" && "$existing_redis_pass" != '""' && "$existing_redis_pass" != "null" ]]; then
existing_redis_pass="$existing_redis_pass" \
yq e -i '.session.redis.password = strenv(existing_redis_pass)' "$TEMP_CONFIG"
fi
if [[ -n "$existing_redis_pass" && "$existing_redis_pass" != '""' && "$existing_redis_pass" != "null" ]]; then
existing_redis_pass="$existing_redis_pass" \
yq e -i '.session.redis.password = strenv(existing_redis_pass)' "$TEMP_CONFIG"
fi
if [[ -n "$existing_notifier" && "$existing_notifier" != '""' && "$existing_notifier" != "null" ]]; then
existing_notifier="$existing_notifier" \
yq e -i '.notifier = strenv(existing_notifier)' "$TEMP_CONFIG"
fi
if [[ -n "$existing_notifier" && "$existing_notifier" != '""' && "$existing_notifier" != "null" ]]; then
existing_notifier="$existing_notifier" \
yq e -i '.notifier = strenv(existing_notifier)' "$TEMP_CONFIG"
fi
fi
# Update domain settings from .env