#!/bin/bash # Fix Cookie/Authentication Issues # Run this if you experience login problems or "Service Unavailable" errors echo "==========================================" echo "SkyArt Shop - Cookie Issue Fix" echo "==========================================" echo "" # Stop the service echo "1. Stopping SkyArtShop service..." sudo systemctl stop skyartshop # Fix DataProtection keys directory echo "2. Fixing DataProtection keys directory..." KEYS_DIR="/var/www/SkyArtShop/publish/DataProtection-Keys" sudo mkdir -p "$KEYS_DIR" sudo chown -R www-data:www-data "$KEYS_DIR" sudo chmod 755 "$KEYS_DIR" echo " ✓ Keys directory fixed: $KEYS_DIR" # Fix publish directory permissions echo "3. Fixing publish directory permissions..." sudo chown -R www-data:www-data /var/www/SkyArtShop/publish/ echo " ✓ Permissions fixed" # Restart the service echo "4. Starting SkyArtShop service..." sudo systemctl start skyartshop sleep 3 # Check service status if sudo systemctl is-active --quiet skyartshop; then echo " ✓ Service started successfully" else echo " ✗ Service failed to start. Check logs:" echo " sudo journalctl -u skyartshop -n 50" exit 1 fi echo "" echo "==========================================" echo "✓ Cookie Issue Fixed!" echo "==========================================" echo "" echo "What was fixed:" echo " • DataProtection keys directory created" echo " • Proper permissions set (www-data)" echo " • Service restarted" echo "" echo "Next steps:" echo " 1. Clear browser cookies/cache" echo " 2. Go to: https://skyarts.ddns.net/admin/login" echo " 3. Login with your credentials" echo "" echo "If you still have issues, reset password with:" echo " curl -k 'https://localhost/admin/reset-password-emergency?confirm=yes-reset-now&secret=skyart-emergency-2025'" echo ""