From 94889783a33e30e269a37e747379ea6087699c46 Mon Sep 17 00:00:00 2001 From: Apple Date: Wed, 3 Dec 2025 10:12:16 -0800 Subject: [PATCH] fix: Restore asset URLs (logos/banners) after database recovery - Update monitor-db-stability.sh to fix asset URLs after restore - Convert old /assets/ URLs to MinIO format - Clear invalid banner URLs --- scripts/monitor-db-stability.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/monitor-db-stability.sh b/scripts/monitor-db-stability.sh index e1cdc240..711b3a3b 100755 --- a/scripts/monitor-db-stability.sh +++ b/scripts/monitor-db-stability.sh @@ -66,6 +66,20 @@ if [ "$MICRODAO_COUNT" -lt 5 ] || [ "$AGENT_COUNT" -lt 10 ]; then # Remove test agents bash scripts/remove-test-agents.sh 2>&1 | tail -3 || true + # Restore asset URLs (logos and banners) + log "🖼️ Restoring asset URLs..." + docker exec daarion-postgres psql -U postgres -d daarion -c " + UPDATE microdaos + SET logo_url = 'https://assets.daarion.space/daarion-assets/microdao/logo/' || slug || '.png' + WHERE logo_url IS NOT NULL + AND (logo_url LIKE '/assets/%' OR logo_url NOT LIKE 'https://%'); + + UPDATE microdaos + SET banner_url = NULL + WHERE banner_url IS NOT NULL + AND (banner_url LIKE '/api/static/%' OR banner_url NOT LIKE 'https://%'); + " 2>&1 | grep -v "UPDATE\|^$" || true + log "✅ Recovery complete" else log "❌ No backup found for recovery"