campaign_connector/scripts/fix-database.sh
admin 498e1ab6ca Bunch of improvements:
- Refactored the dashboard html into seperate pages and all the necessary components
- Added login and secured api routes / debugged getting system working on a tailnet.
- added some functionality to the debugging and health endpoints
- added in a new phone contact import and debugged.
2025-12-31 15:02:28 -07:00

31 lines
591 B
Bash
Executable File

#!/bin/bash
echo "🔧 Fixing database and permissions..."
# Stop the container
docker compose down
# Remove WAL and SHM files
rm -f data/campaign.db-wal
rm -f data/campaign.db-shm
# Convert database to non-WAL mode
if [ -f "data/campaign.db" ]; then
sqlite3 data/campaign.db << EOF
PRAGMA journal_mode=TRUNCATE;
VACUUM;
.exit
EOF
fi
# Fix permissions
chmod 777 data/ 2>/dev/null || true
chmod 666 data/campaign.db 2>/dev/null || true
echo "✅ Database fixed. The app should now work properly."
# Restart
docker compose up -d
echo "📋 Check logs with: docker compose logs -f"