From 4b519610af932737a844a5e3f42eb03e5b86c35a Mon Sep 17 00:00:00 2001 From: Aki Amane <80670461+akippnn@users.noreply.github.com> Date: Sat, 26 Apr 2025 19:26:00 +0800 Subject: [PATCH] fix(update-setup): Remove usage of --env since it does not exist --- update-setup.sh | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/update-setup.sh b/update-setup.sh index e73b39c..8f2754f 100755 --- a/update-setup.sh +++ b/update-setup.sh @@ -272,21 +272,31 @@ 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 - yq e -i '.identity_validation.reset_password.jwt_secret = strenv(existing_jwt_secret)' --env existing_jwt_secret="$existing_jwt_secret" "$TEMP_CONFIG" - fi - if [[ -n "$existing_session_secret" && "$existing_session_secret" != '""' && "$existing_session_secret" != "null" ]]; then - yq e -i '.session.secret = strenv(existing_session_secret)' --env existing_session_secret="$existing_session_secret" "$TEMP_CONFIG" - fi - if [[ -n "$existing_storage_key" && "$existing_storage_key" != '""' && "$existing_storage_key" != "null" ]]; then - yq e -i '.storage.encryption_key = strenv(existing_storage_key)' --env existing_storage_key="$existing_storage_key" "$TEMP_CONFIG" - fi - if [[ -n "$existing_redis_pass" && "$existing_redis_pass" != '""' && "$existing_redis_pass" != "null" ]]; then - yq e -i '.session.redis.password = strenv(existing_redis_pass)' --env existing_redis_pass="$existing_redis_pass" "$TEMP_CONFIG" - fi - if [[ -n "$existing_notifier" && "$existing_notifier" != '""' && "$existing_notifier" != "null" ]]; then - yq e -i '.notifier = strenv(existing_notifier)' --env existing_notifier="$existing_notifier" "$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_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_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 @@ -1369,4 +1379,4 @@ case "$1" in ;; esac -exit 0 \ No newline at end of file +exit 0