fix(backup): remove -n flag from curl to fix empty response issue

The -n flag was causing curl to rely on .netrc, which conflicted with
explicit -u username:password usage and led to empty responses from
the backup API. Removing it ensures proper authentication.
This commit is contained in:
Nick Heppler 2025-04-25 12:22:59 -04:00
parent 0fdde183da
commit bcefa2a437

View File

@ -52,7 +52,7 @@ log "🔄 Starting Lubelogger backup job"
# Uptime Kuma Check-in: Inform that the backup process has started # Uptime Kuma Check-in: Inform that the backup process has started
uptime_kuma_checkin uptime_kuma_checkin
response=$(curl -s -n -u "$USERNAME:$PASSWORD" --location "$BASE_URL/api/makebackup") response=$(curl -s -u "$USERNAME:$PASSWORD" --location "$BASE_URL/api/makebackup")
if [[ -z "$response" ]]; then if [[ -z "$response" ]]; then
log "❌ Error: Empty response from backup API" log "❌ Error: Empty response from backup API"
@ -63,7 +63,7 @@ fi
backup_url="${BASE_URL}${response//\"/}" backup_url="${BASE_URL}${response//\"/}"
log "⬇️ Downloading backup from $backup_url" log "⬇️ Downloading backup from $backup_url"
curl -s -n -u "$USERNAME:$PASSWORD" --location "$backup_url" -o "$OUTPUT_FILE" curl -s -u "$USERNAME:$PASSWORD" --location "$backup_url" -o "$OUTPUT_FILE"
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
log "✅ Backup saved to $OUTPUT_FILE" log "✅ Backup saved to $OUTPUT_FILE"