- Add Google Analytics tracking (G-ZDZ26XYN2P) to frontend - Create comprehensive analytics utility with event tracking - Track URL submissions, analysis results, and user authentication - Add route tracking for SPA navigation - Fix CORS configuration to support both localhost and production - Fix home page tracking form to display results instead of auto-redirect - Add service management scripts for easier deployment - Update database migrations for enhanced analysis features Key Features: - Anonymous and authenticated user tracking - SSL/SEO/Security analysis event tracking - Error tracking for debugging - Page view tracking for SPA routes - Multi-origin CORS support for development and production
70 lines
2.5 KiB
Bash
Executable File
70 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# URL Tracker Tool V2 - Service Control Script
|
|
# Usage: ./service-control.sh [start|stop|restart|status|logs|enable|disable]
|
|
|
|
SERVICE_NAME="catch-redirect"
|
|
|
|
case "$1" in
|
|
start)
|
|
echo "🚀 Starting URL Tracker Tool V2 service..."
|
|
systemctl start $SERVICE_NAME
|
|
sleep 3
|
|
systemctl status $SERVICE_NAME --no-pager
|
|
;;
|
|
stop)
|
|
echo "🛑 Stopping URL Tracker Tool V2 service..."
|
|
systemctl stop $SERVICE_NAME
|
|
echo "Service stopped."
|
|
;;
|
|
restart)
|
|
echo "🔄 Restarting URL Tracker Tool V2 service..."
|
|
systemctl restart $SERVICE_NAME
|
|
sleep 3
|
|
systemctl status $SERVICE_NAME --no-pager
|
|
;;
|
|
status)
|
|
echo "📊 URL Tracker Tool V2 service status:"
|
|
systemctl status $SERVICE_NAME --no-pager
|
|
echo ""
|
|
echo "🌐 Service Health Check:"
|
|
echo "API (port 3334): $(curl -s http://localhost:3334/health | jq -r '.status' 2>/dev/null || echo "Not responding")"
|
|
echo "Frontend (port 3000): $(curl -s http://localhost:3000 >/dev/null && echo "Running" || echo "Not responding")"
|
|
;;
|
|
logs)
|
|
echo "📝 Recent service logs:"
|
|
echo "=== Main Service Log ==="
|
|
tail -20 /var/log/catch-redirect.log
|
|
echo ""
|
|
echo "=== API Log ==="
|
|
tail -10 /var/log/catch-redirect-api.log 2>/dev/null || echo "No API logs yet"
|
|
echo ""
|
|
echo "=== Frontend Log ==="
|
|
tail -10 /var/log/catch-redirect-frontend.log 2>/dev/null || echo "No frontend logs yet"
|
|
;;
|
|
enable)
|
|
echo "⚡ Enabling URL Tracker Tool V2 service for auto-start..."
|
|
systemctl enable $SERVICE_NAME
|
|
echo "Service will now start automatically on boot."
|
|
;;
|
|
disable)
|
|
echo "❌ Disabling URL Tracker Tool V2 service auto-start..."
|
|
systemctl disable $SERVICE_NAME
|
|
echo "Service will no longer start automatically on boot."
|
|
;;
|
|
*)
|
|
echo "URL Tracker Tool V2 - Service Control"
|
|
echo "Usage: $0 [start|stop|restart|status|logs|enable|disable]"
|
|
echo ""
|
|
echo "Commands:"
|
|
echo " start - Start the service"
|
|
echo " stop - Stop the service"
|
|
echo " restart - Restart the service"
|
|
echo " status - Show service status and health check"
|
|
echo " logs - Show recent service logs"
|
|
echo " enable - Enable auto-start on boot"
|
|
echo " disable - Disable auto-start on boot"
|
|
exit 1
|
|
;;
|
|
esac
|