move folder and add supavisor

This commit is contained in:
jigoong
2026-03-03 00:41:48 +07:00
parent ecd2d56975
commit c01fea1c51
12 changed files with 4 additions and 1 deletions

70
02-supabase/setup.sh Normal file
View File

@@ -0,0 +1,70 @@
#!/bin/bash
# Supabase Setup Script
# This script downloads necessary configuration files and sets up Supabase
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "🚀 Setting up Supabase..."
# Create necessary directories
echo "📁 Creating directories..."
mkdir -p volumes/api
mkdir -p volumes/db
mkdir -p volumes/functions
mkdir -p volumes/logs
mkdir -p volumes/pooler
mkdir -p volumes/storage
mkdir -p volumes/snippets
# Download configuration files from Supabase repository
SUPABASE_REPO="https://raw.githubusercontent.com/supabase/supabase/master/docker"
echo "📥 Downloading configuration files..."
# Kong API Gateway configuration
curl -fsSL "$SUPABASE_REPO/volumes/api/kong.yml" -o volumes/api/kong.yml
# Database initialization scripts
curl -fsSL "$SUPABASE_REPO/volumes/db/realtime.sql" -o volumes/db/realtime.sql
curl -fsSL "$SUPABASE_REPO/volumes/db/webhooks.sql" -o volumes/db/webhooks.sql
curl -fsSL "$SUPABASE_REPO/volumes/db/roles.sql" -o volumes/db/roles.sql
curl -fsSL "$SUPABASE_REPO/volumes/db/jwt.sql" -o volumes/db/jwt.sql
curl -fsSL "$SUPABASE_REPO/volumes/db/_supabase.sql" -o volumes/db/_supabase.sql
curl -fsSL "$SUPABASE_REPO/volumes/db/logs.sql" -o volumes/db/logs.sql
curl -fsSL "$SUPABASE_REPO/volumes/db/pooler.sql" -o volumes/db/pooler.sql
# Vector logs configuration
curl -fsSL "$SUPABASE_REPO/volumes/logs/vector.yml" -o volumes/logs/vector.yml
# Pooler configuration
curl -fsSL "$SUPABASE_REPO/volumes/pooler/pooler.exs" -o volumes/pooler/pooler.exs
# Create .env file if it doesn't exist
if [ ! -f .env ]; then
echo "📝 Creating .env file from .env.example..."
cp .env.example .env
echo ""
echo "⚠️ IMPORTANT: Please edit .env file and update the following:"
echo " - POSTGRES_PASSWORD"
echo " - JWT_SECRET (generate with: openssl rand -base64 32)"
echo " - SECRET_KEY_BASE (generate with: openssl rand -base64 32)"
echo " - VAULT_ENC_KEY (generate with: openssl rand -base64 32)"
echo " - PG_META_CRYPTO_KEY (generate with: openssl rand -base64 32)"
echo " - LOGFLARE_PUBLIC_ACCESS_TOKEN (generate with: openssl rand -base64 32)"
echo " - LOGFLARE_PRIVATE_ACCESS_TOKEN (generate with: openssl rand -base64 32)"
echo " - DASHBOARD_USERNAME and DASHBOARD_PASSWORD"
echo ""
fi
echo "✅ Supabase setup completed!"
echo ""
echo "Next steps:"
echo "1. Edit .env file with your configuration"
echo "2. Ensure shared_data_network exists: cd ../00-network && bash create-network.sh"
echo "3. Start Supabase: docker compose up -d"
echo "4. Access Supabase Studio at: http://localhost:3010"
echo "5. Access Supabase API at: http://localhost:8100"