#!/bin/bash # Script to generate Supabase JWT secrets and keys for local development # This generates the anon key and service role key based on the JWT secret set -e # Default values (can be overridden by environment variables) JWT_SECRET="${JWT_SECRET:-$(openssl rand -base64 32)}" POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-your-super-secret-and-long-postgres-password}" # Generate JWT tokens (anon and service_role) # These are simplified versions - in production, use Supabase's key generation ANON_KEY="${ANON_KEY:-[REDACTED]}" SERVICE_KEY="${SERVICE_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU}" echo "Supabase Configuration for Docker Compose" echo "=========================================" echo "" echo "Add these to your .env file or export them:" echo "" echo "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" echo "JWT_SECRET=${JWT_SECRET}" echo "ANON_KEY=${ANON_KEY}" echo "SERVICE_KEY=${SERVICE_KEY}" echo "" echo "For the web app (.env in management-dashboard-web-app/):" echo "VITE_SUPABASE_URL=http://localhost:54321" echo "VITE_SUPABASE_ANON_KEY=${ANON_KEY}" echo ""