Compare commits
2 Commits
9ac533865d
...
feature/tr
| Author | SHA1 | Date | |
|---|---|---|---|
| 79a7a0d4c6 | |||
| 93e709841b |
@@ -272,40 +272,40 @@ update_authelia_config() {
|
|||||||
local existing_notifier=$(yq e '.notifier // ""' "$AUTHELIA_CONFIG_BACKUP")
|
local existing_notifier=$(yq e '.notifier // ""' "$AUTHELIA_CONFIG_BACKUP")
|
||||||
|
|
||||||
# Update secrets in temp file if they existed in the 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
|
if [[ -n "$existing_jwt_secret" && "$existing_jwt_secret" != '""' && "$existing_jwt_secret" != "null" ]]; then
|
||||||
existing_jwt_secret="$existing_jwt_secret" \
|
existing_jwt_secret="$existing_jwt_secret" \
|
||||||
yq e -i '.identity_validation.reset_password.jwt_secret = strenv(existing_jwt_secret)' "$TEMP_CONFIG"
|
yq e -i '.identity_validation.reset_password.jwt_secret = strenv(existing_jwt_secret)' "$TEMP_CONFIG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$existing_session_secret" && "$existing_session_secret" != '""' && "$existing_session_secret" != "null" ]]; then
|
if [[ -n "$existing_session_secret" && "$existing_session_secret" != '""' && "$existing_session_secret" != "null" ]]; then
|
||||||
existing_session_secret="$existing_session_secret" \
|
existing_session_secret="$existing_session_secret" \
|
||||||
yq e -i '.session.secret = strenv(existing_session_secret)' "$TEMP_CONFIG"
|
yq e -i '.session.secret = strenv(existing_session_secret)' "$TEMP_CONFIG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$existing_storage_key" && "$existing_storage_key" != '""' && "$existing_storage_key" != "null" ]]; then
|
if [[ -n "$existing_storage_key" && "$existing_storage_key" != '""' && "$existing_storage_key" != "null" ]]; then
|
||||||
existing_storage_key="$existing_storage_key" \
|
existing_storage_key="$existing_storage_key" \
|
||||||
yq e -i '.storage.encryption_key = strenv(existing_storage_key)' "$TEMP_CONFIG"
|
yq e -i '.storage.encryption_key = strenv(existing_storage_key)' "$TEMP_CONFIG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$existing_redis_pass" && "$existing_redis_pass" != '""' && "$existing_redis_pass" != "null" ]]; then
|
if [[ -n "$existing_redis_pass" && "$existing_redis_pass" != '""' && "$existing_redis_pass" != "null" ]]; then
|
||||||
existing_redis_pass="$existing_redis_pass" \
|
existing_redis_pass="$existing_redis_pass" \
|
||||||
yq e -i '.session.redis.password = strenv(existing_redis_pass)' "$TEMP_CONFIG"
|
yq e -i '.session.redis.password = strenv(existing_redis_pass)' "$TEMP_CONFIG"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "$existing_notifier" && "$existing_notifier" != '""' && "$existing_notifier" != "null" ]]; then
|
if [[ -n "$existing_notifier" && "$existing_notifier" != '""' && "$existing_notifier" != "null" ]]; then
|
||||||
existing_notifier="$existing_notifier" \
|
existing_notifier="$existing_notifier" \
|
||||||
yq e -i '.notifier = strenv(existing_notifier)' "$TEMP_CONFIG"
|
yq e -i '.notifier = strenv(existing_notifier)' "$TEMP_CONFIG"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update domain settings from .env
|
# Update domain settings from .env
|
||||||
echo -e "${BLUE}Applying Tailscale domain settings...${NC}"
|
echo -e "${BLUE}Applying Tailscale domain settings...${NC}"
|
||||||
|
|
||||||
# Replace placeholder full hostname
|
# Replace placeholder full hostname - using proper yq syntax instead of walk()
|
||||||
yq e -i "walk(if type == \"string\" and . == \"tailscale-nas.your-tailnet.ts.net\" then \"${FULL_HOSTNAME}\" else . end)" "$TEMP_CONFIG"
|
yq e -i "(.. | select(tag == \"!!str\" and . == \"tailscale-nas.your-tailnet.ts.net\")) = \"${FULL_HOSTNAME}\"" "$TEMP_CONFIG"
|
||||||
|
|
||||||
# Replace placeholder tailnet domain
|
# Replace placeholder tailnet domain - using proper yq syntax instead of walk()
|
||||||
yq e -i "walk(if type == \"string\" and . == \"your-tailnet.ts.net\" then \"${TAILNET_DOMAIN}\" else . end)" "$TEMP_CONFIG"
|
yq e -i "(.. | select(tag == \"!!str\" and . == \"your-tailnet.ts.net\")) = \"${TAILNET_DOMAIN}\"" "$TEMP_CONFIG"
|
||||||
|
|
||||||
# Move temp file to final location
|
# Move temp file to final location
|
||||||
mv "$TEMP_CONFIG" "$AUTHELIA_CONFIG"
|
mv "$TEMP_CONFIG" "$AUTHELIA_CONFIG"
|
||||||
|
|||||||
Reference in New Issue
Block a user