Supacloud
MCP Server for SupaCloud โ AI-native Supabase infrastructure management
Ask AI about Supacloud
Powered by Claude ยท Grounded in docs
I know everything about Supacloud. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
SupaCloud
English
SupaCloud is a next-generation, ultra-lightweight multi-tenant PaaS for self-hosting Supabase. Built on Pigsty, it enables you to run multiple isolated Supabase projects efficiently on a single server.
Key Features
- Multi-Tenant Architecture: Run multiple isolated Supabase projects with shared infrastructure
- Management API: Full REST API (60+ endpoints) for complete project lifecycle management
- Web Console: Modern SvelteKit management dashboard with authentication
- CLI Compatibility: Native support for the official
supabaseCLI (login, gen types, edge functions) - CLI Tools:
supacloudfor project users,supacloud-adminfor server operators - SupaCloud Pages: Frontend static site hosting with GitHub webhook auto-deploy
- Pigsty Powered: Enterprise-grade PostgreSQL with built-in monitoring (Grafana)
- One-Click Installation: Fully automated setup via
install.sh - JuiceFS Storage: Powered by PostgreSQL Large Objects (LO) for ultra-thin metadata
- Kong API Gateway: DB-backed Dynamic API Router, native ACME SSL, Gzip, Security Headers, Programmable Rate Limiting, and CORS
- Auto-scaling Engine: Rule-based vertical and horizontal scaling based on real-time metrics
- Bun Edge Runtime: Bun.js + Elysia Worker Pool for Edge Functions, with built-in Deno compatibility shim for legacy user code
- SSE Real-time Logs: Server-Sent Events streaming for live log tailing via
journalctl --follow - Native Queue Worker: Pure Bun.js PostgreSQL LISTEN/NOTIFY based asynchronous worker for AI inference and MQTT events
- WebSocket Task Notifications: Real-time task progress push via native Bun WebSocket
- DB Graceful Degradation: Exponential backoff retry + 503 Service Unavailable on transient DB failures
- Edge Function Preheating: Zero cold-start via worker module pre-import on deploy
- China OAuth: Built-in WeChat, Alipay, DingTalk login integration
- CI/CD Integration: GitHub webhook for automated deployments
- Comprehensive Tests: 17 unit tests + integration test suite
SupaCloud vs Supabase
SupaCloud is best understood as a self-hosted multi-tenant control plane for Supabase-style projects, not as a clone of Supabase Cloud.
Short version:
- SupaCloud: best when you want to run many isolated projects on your own servers with a built-in operator API, web console, project lifecycle management, task queue surface, and frontend hosting.
- Supabase Cloud: best when you want a fully managed platform, hosted backups/PITR, hosted logs explorer, and hosted branching.
- Supabase Self-Hosted: best when you want the official upstream stack on your own infra and are comfortable operating Docker/services directly.
Detailed feature comparison:
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Management API (:9090) โ
โ Bun + Elysia + TypeScript + Auto-scaling โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ JwtService โ โ DbService โ โ StorageSvc โ โ
โ โโโโโโโฌโโโโโโโ โโโโโโโฌโโโโโโโ โโโโโโโฌโโโโโโโ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ GatewaySvc โ โ ScalingSvc โ โ BackupSvc โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ RouterSvc โ โ FrontendSv โ โ DeploySvc โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ Shared Infrastructure โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ PostgreSQL โ โ Kong โ โ JuiceFS โ โ
โ โ (Pigsty) โ โ Gateway โ โ (PG-LO) โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโ โ
โ โ Grafana โ โ
โ โ (Monitor) โ โ
โ โโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Quick Start
Requirements
| Item | Minimum | Recommended |
|---|---|---|
| CPU | 2 cores | 4+ cores |
| RAM | 2GB | 4GB+ |
| Disk | 40GB | 100GB+ SSD |
| OS | CentOS 9, Ubuntu 22/24, Debian 12 | CentOS 9 |
Human Entrypoints
Project user CLI
npm install -g @supacloud/cli
supacloud-cli status
supacloud-cli project get
supacloud-cli project logs --log_type database
supacloud-cli frontend list --ref <project-ref>
supacloud-cli defaults to project context and auto-links from the current workspace .env when available.
The old supacloud command name remains a compatibility alias, but avoid it because the server binary is also named /usr/local/bin/supacloud.
SUPABASE_URLorSUPACLOUD_API_URLSUPABASE_SERVICE_ROLE_KEYorSUPACLOUD_API_TOKEN
Server admin CLI
npx @supacloud/admin status
npx @supacloud/admin ssh ping
npx @supacloud/admin ssh install --public_domain api.example.com --studio_domain studio.example.com
npx @supacloud/admin project create --name my-app
Use supacloud-admin for installation, upgrades, tenant runtime operations, and platform-wide project lifecycle control.
Server Installation
One-Click Installation (Recommended)
# China users (accelerated via gh-proxy.net)
curl -fsSL https://gh-proxy.net/https://raw.githubusercontent.com/zuohuadong/supacloud/main/setup.sh | sudo bash
# International users
curl -fsSL https://raw.githubusercontent.com/zuohuadong/supacloud/main/setup.sh | sudo bash
Standard Installation
# 1. Clone repository
git clone https://github.com/zuohuadong/supacloud.git
cd supacloud
# 2. Configure & Install
sudo bash install.sh --ip 1.2.3.4 --domain api.example.com --s3 juicefs
# 3. Enable CLI
source /etc/profile.d/supacloud.sh
Production Upgrades
Production servers upgrade by replacing the released Linux binary at /usr/local/bin/supacloud; they do not need to git pull application source during normal upgrades.
sudo supacloud upgrade --yes
The upgrade command tries https://ghproxy.net/ before direct GitHub access, which is the recommended path for mainland China servers. Override it when needed:
sudo SUPACLOUD_GITHUB_PROXY=https://ghproxy.net/ supacloud upgrade --yes
sudo SUPACLOUD_GITHUB_PROXY=direct supacloud upgrade --yes
Published release assets:
supacloud-linux-amd64andsupacloud-linux-arm64are the production install/upgrade binaries.supacloud-macos-amd64andsupacloud-macos-arm64are published for local development and diagnostics.
Docker Compose Self-Host (PostgreSQL 18)
cd docker/self-host
python3 init-env.py --public-url https://api.example.com --studio-url https://studio.example.com > .env
docker compose up -d --build
The compose stack is isolated under docker/self-host and ships a PostgreSQL 18 image with common extensions preinstalled.
Available CLI Options:
| Option | Description | Example |
|---|---|---|
--ip | Server Internal IP | --ip 10.0.0.5 |
--domain | API/Public Domain | --domain supa.com |
--studio | Studio Dashboard Domain | --studio studio.com |
--s3 | Storage Type | juicefs, minio, or external |
--password | Master Password | --password mysecret |
Management
User CLI: supacloud-cli
The supacloud-cli command is project-scoped by default and is intended for deploy/build/log/database workflows around a single project:
supacloud-cli status
supacloud-cli project get
supacloud-cli project logs --log_type database
supacloud-cli project tasks
supacloud-cli database query --sql "select now()"
supacloud-cli database query --ref <ref> --file ./queries/vector-search.sql
supacloud-cli database push_migrations --ref <ref> --dir supabase/migrations --dry_run
supacloud-cli auth list_providers --ref <ref>
supacloud-cli frontend list --ref <ref>
supacloud-cli edge_functions list --ref <ref>
supacloud-cli storage list_buckets --ref <ref>
For complex SQL, pgvector queries, and single-request transaction blocks, prefer --file instead of shell-escaped inline SQL.
BEGIN;
INSERT INTO audit_events(message) VALUES ('started');
INSERT INTO audit_events(message) VALUES ('finished');
COMMIT;
SupaCloud supports transaction blocks inside one SQL request and wraps migrations in a transaction. It does not expose long-lived HTTP transaction sessions such as /transaction/begin and /transaction/commit; application-side long transactions should use the direct Postgres DSN with pg, postgres.js, or equivalent drivers.
pgvector example:
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE documents (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
content text NOT NULL,
embedding vector(1536)
);
CREATE INDEX documents_embedding_hnsw_idx
ON documents
USING hnsw (embedding vector_cosine_ops);
SELECT id, content
FROM documents
ORDER BY embedding <=> '[0.1,0.2,0.3]'::vector
LIMIT 5;
supacloud intentionally does not own platform installation, upgrades, SSH diagnostics, tenant runtime management, or destructive project lifecycle commands.
Admin CLI: supacloud-admin
The supacloud-admin CLI is for server and platform operators:
supacloud-admin status
supacloud-admin ssh ping
supacloud-admin ssh install --public_domain api.example.com --studio_domain studio.example.com
supacloud-admin ssh diagnose
supacloud-admin project list
supacloud-admin project create --name my-app
supacloud-admin project delete --ref <ref>
supacloud-admin project pause --ref <ref>
supacloud-admin platform metrics
Management API
The REST API runs on port 9090 with Swagger documentation at /swagger.
# Create project
curl -X POST http://localhost:9090/v1/projects \
-H "Authorization: Bearer $MASTER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "My Project", "region": "local"}'
# List projects
curl http://localhost:9090/v1/projects \
-H "Authorization: Bearer $MASTER_TOKEN"
# Get API keys
curl http://localhost:9090/v1/projects/<ref>/api-keys \
-H "Authorization: Bearer $MASTER_TOKEN"
Core API Endpoints:
| Method | Endpoint | Description |
|---|---|---|
| GET | /v1/projects | List all projects |
| POST | /v1/projects | Create project |
| GET | /v1/projects/:ref | Get project details |
| PATCH | /v1/projects/:ref | Update project |
| DELETE | /v1/projects/:ref | Delete project (soft) |
| POST | /v1/projects/:ref/pause | Pause project |
| POST | /v1/projects/:ref/restore | Restore project |
| GET | /v1/projects/:ref/status | Get status |
| GET | /v1/projects/:ref/health | Get health |
| POST | /v1/projects/:ref/restart | Restart services |
| GET | /v1/projects/:ref/settings | Get settings |
| PUT | /v1/projects/:ref/settings | Update settings |
| GET | /v1/projects/:ref/api-keys | Get API keys |
| POST | /v1/projects/:ref/rotate-keys | Rotate API keys |
| GET | /v1/projects/:ref/types/typescript | Generate TS types |
| PATCH | /v1/projects/:ref/config/auth | Configure Auth & Providers |
| GET | /v1/projects/:ref/secrets | List Edge Function Secrets |
| POST | /v1/projects/:ref/secrets | Upsert Secrets |
| DELETE | /v1/projects/:ref/secrets/:name | Delete Secret |
| GET | /v1/oauth/authorize | CLI OAuth Login |
Extended API Endpoints:
| Category | Endpoints | Description |
|---|---|---|
| Database | /v1/projects/:ref/database/* | SQL query, schema inspection, migrations |
| Auth | /v1/projects/:ref/config/auth | OAuth providers, WeChat/Alipay/DingTalk |
| Frontend | /v1/projects/:ref/frontend/* | Pages hosting, deployments, custom domains |
| Webhook | /v1/webhooks/github | GitHub webhook for CI/CD auto-deploy |
| Storage | /v1/storage/* | Bucket management, file upload, S3 migration |
| Extensions | /v1/extensions/* | PostgreSQL extension marketplace |
| Scaling | /v1/projects/:ref/scaling/* | Vertical upgrade & horizontal replicas |
| Backups | /v1/projects/:ref/backups/* | Database backup & restore |
| Monitor | /v1/monitor/* | Database monitoring & health |
| Security | /v1/security/* | Firewall rules & SSL certificates |
| Deploy | /v1/deploy/* | Edge Function deployment |
| Tasks | /v1/projects/:ref/tasks/* | Background task monitoring |
| Logs SSE | GET /v1/projects/:ref/logs/stream | Real-time log streaming via Server-Sent Events |
| Rate Limit | GET/PUT /v1/projects/:ref/gateway/rate-limit | Programmable per-project rate limiting (Kong Admin API) |
| WebSocket | ws://host/ws/tasks | Real-time task progress notifications |
Runtime Switching
# Switch Edge Runtime deployment mode
./switch.sh runtime embedded # Managed by supacloud.service
./switch.sh runtime external # Standalone supacloud-edge-runtime.service
# Switch storage backend
./switch.sh storage juicefs # or: minio, external
# Show current configuration
./switch.sh status
Edge Runtime Architecture:
SupaCloud (:9090) Edge Runtime (:9000)
โโโ Management API โโโ supacloud.service manages by default
โโโ Web Console โโโ Elysia Server
โโโ SSE Log Stream โโโ Worker Thread Pool (4 threads)
โโโ WebSocket /ws/tasks โโโ Deno Compat Shim
โโโ Static Assets (ETag) โโโ URL Import Plugin
โโโ /preheat (zero cold-start)
Kong Gateway (API-driven, native OpenResty):
Global plugins: ACME SSL, Gzip, Security Headers, Access Logs
Per-route plugins: CORS, Rate Limiting, JWT, IP Restriction
/api/* โ :9090
/functions/* โ :9090 (sdk-proxy, async enqueue + sync relay)
Default installs use EDGE_RUNTIME_MODE=embedded, meaning supacloud.service starts the Bun Edge Runtime child process itself. A separate supacloud-edge-runtime.service is available for EDGE_RUNTIME_MODE=external, but you should not run both modes at the same time.
Background Function Routing
Public Edge Function traffic now enters through the Management API first:
/functions/v1/*is routed to:9090sdk-proxydecides whether the call should:- enqueue a background task and return
202 Accepted - or relay synchronously to the Bun Edge Runtime
- enqueue a background task and return
- browser and
supabase-jscallers can keep using the stockfunctions.invoke()API
This gives SupaCloud a stable control point for:
- async enqueue
- retries / timeout defaults
- idempotency
- request envelope capture
- per-function background route policy
For supabase-js compatibility, foreground invokes still use the standard:
await supabase.functions.invoke("my-function", { body: {...} })
Background execution is activated through server-side function config via background_routes.
background_routes is the preferred production model for heavy paths like:
/generate/crop/generate/matting/generate/video
because it does not depend on the browser successfully forwarding custom headers.
Realtime Routing And Recovery
Realtime traffic also enters through the Management API first:
/realtime/v1/websocketis routed to:9090- the Management API owns the websocket upgrade and proxies upstream Realtime traffic
- Kong should not point browser websocket traffic directly at the Elixir Realtime container
This avoids tenant/path mismatches such as:
/realtime/v1/websocketbeing rewritten into the wrong upstream/socketpath- browser websocket requests being interpreted as the wrong tenant
If Realtime subscriptions fail after installation or migration, SupaCloud now includes one-off reconciliation commands:
cd packages/management-api
bun run realtime:reconcile
bun run realtime:reconcile-schema
Use them to:
- register any missing Realtime tenants
- repair tenant connection metadata
- grant required
realtimeschema privileges in project databases - add
public.tasksto thesupabase_realtimepublication and setREPLICA IDENTITY FULL
For new installs, install.sh now generates a valid REALTIME_DB_ENC_KEY, which prevents the historical Bad key size failure during tenant registration.
| Feature | Current Bun Runtime |
|---|---|
| Memory (200 functions) | ~140MB |
| Cold start | < 10ms (with preheat: 0ms) |
| Warm latency | <1ms |
| Deno code compat | โ via shim |
| Isolation | Worker Thread |
CLI Entry Points
For human operators, the CLI split is now:
@supacloud/cli/supacloud-cli: project-scoped user CLI with.envauto-link defaults- Preferred command:
supacloud-cli. The baresupacloudname is only a backward-compatible alias because/usr/local/bin/supacloudis the server binary. @supacloud/admin/supacloud-admin: server and platform administration CLI
Project Structure
supacloud/
โโโ install.sh # One-click deployment script
โโโ setup.sh # Remote setup bootstrap
โโโ switch.sh # Runtime/storage switching tool
โโโ supacloud # CLI management tool (shell wrapper)
โโโ config.env # Global configuration
โโโ packages/
โ โโโ management-api/ # REST API server (Bun + Elysia)
โ โ โโโ src/
โ โ โ โโโ routes/ # 19 route modules (projects, auth, frontend, webhook, ws, logs, etc.)
โ โ โ โโโ services/ # 20 service modules
โ โ โ โโโ cli/ # CLI subcommands (lifecycle, project)
โ โ โ โโโ db/ # Database layer, migrations, withRetry & graceful degradation
โ โ โ โโโ middleware/ # Auth middleware
โ โ โ โโโ infra/ # Health checker
โ โ โ โโโ install.ts # Interactive installer
โ โ โ โโโ upgrade.ts # Upgrade wizard
โ โ โ โโโ doctor.ts # System diagnostics
โ โ โโโ tests/ # Unit (17) & integration tests
โ โโโ cli/ # Project user CLI
โ โ โโโ src/
โ โโโ admin/ # Platform admin CLI
โ โ โโโ src/
โ โโโ edge-runtime/ # Bun Edge Functions runtime
โ โ โโโ server.ts # Elysia server (:9000) + /preheat endpoint
โ โ โโโ worker-pool.ts # Fixed-size Worker Thread Pool + preheat()
โ โ โโโ worker-executor.ts # Function loader + LRU cache + preheat msg
โ โ โโโ deno-compat.ts # Deno API compatibility shim
โ โ โโโ url-import-plugin.ts# Bun Plugin: URL import interception
โ โ โโโ shims/ # Deno std library replacements
โ โโโ web-console/ # SvelteKit management dashboard
โ โโโ src/ # Components, routes, assets
โโโ scripts/
โ โโโ lib/ # Shell script modules
โ โโโ db_manager.sh # Database lifecycle
โ โโโ gateway_manager.sh # Kong gateway configuration
โ โโโ tenant_runtime.sh # Tenant PostgREST & GoTrue runtime
โ โโโ function_manager.sh # Edge Functions management
โ โโโ s3_manager.sh # Storage backend management
โ โโโ jwt_manager.sh # JWT key generation
โ โโโ backup_manager.sh # Backup operations
โ โโโ ha_manager.sh # High availability
โ โโโ security_manager.sh # Firewall & SSL
โ โโโ storage_manager.sh # Storage operations
โ โโโ extension_manager.sh# PostgreSQL extensions
โ โโโ global_router.ts # Global routing logic
โ โโโ worker_runner.ts # Background worker
โโโ infra/
โ โโโ os/ # OS-level configurations
โ โโโ postgres/ # PostgreSQL configurations
โโโ docs/ # 14 documentation files
โ โโโ deploy-guide.md # Deployment guide
โ โโโ architecture-multi-tenant.md # Architecture design
โ โโโ china-oauth-integration.md # China OAuth (WeChat, etc.)
โ โโโ ... # See docs/README.md for full index
โโโ .github/
โโโ workflows/ # CI/CD (build-studio, management-api, release)
Configuration
Key settings in config.env:
| Variable | Description | Default |
|---|---|---|
SUPABASE_PUBLIC_DOMAIN | Global API gateway domain | Production required; installer can auto-generate |
SUPABASE_STUDIO_DOMAIN | Global console domain | Auto-derived from API domain if empty |
S3_STORAGE_TYPE | Storage backend | juicefs |
EDGE_RUNTIME | Functions runtime | bun |
PG_VERSION | PostgreSQL version | 18 |
PIGSTY_VERSION | Pigsty version | latest |
ENABLE_ANALYTICS | Logflare analytics | true |
Documentation
- Documentation Index
- Deployment Guide
- Multi-Tenant Architecture
- China OAuth Integration
- Pigsty Documentation
- Supabase Self-Hosting
ไธญๆ
SupaCloud ๆฏไธบ Supabase ็งๆๅ้จ็ฝฒๆ้ ็ไธไธไปฃ่ถ ่ฝป้็บงๅค็งๆท PaaS ๅนณๅฐใๅบไบ Pigsty ๆๅปบ๏ผๅฏๅจๅๅฐๆๅกๅจไธ้ซๆ่ฟ่กๅคไธช้็ฆป็ Supabase ้กน็ฎใ
ๆ ธๅฟ็นๆง
- ๅค็งๆทๆถๆ: ๅ ฑไบซๅบ็ก่ฎพๆฝ๏ผ่ฟ่กๅคไธช้็ฆป็ Supabase ้กน็ฎ
- Management API: ๅฎๆด็ REST API๏ผ60+ ไธช็ซฏ็น๏ผ็ฎก็้กน็ฎๅๅจ่พน้ ็ฝฎ็ๅฝๅจๆ
- Web ็ฎก็้ขๆฟ: ็ฐไปฃ SvelteKit ็ฎก็้ขๆฟ๏ผๅ ็ฝฎ็ปๅฝ่ฎค่ฏ
- CLI ็ๆๅ ผๅฎน: ๅฎๅ จๅ ผๅฎน Supabase ๅฎๆนๅฝไปค่กไฝ็ณป๏ผ็ปๅฝ้ดๆใๆฐๆฎๅบ็ฑปๅๆจๅฏผใไบๅฝๆฐๅๅธ๏ผ
- CLI ๅทฅๅ
ท:
supacloud้ขๅ้กน็ฎไฝฟ็จ่ ๏ผsupacloud-admin้ขๅๆๅกๅจ็ฎก็ๅ - SupaCloud Pages: ๅ็ซฏ้ๆ็ซ็นๆ็ฎก๏ผๆฏๆ GitHub Webhook ่ชๅจ้จ็ฝฒ
- Pigsty ้ฉฑๅจ: ไผไธ็บง PostgreSQL๏ผๅ ็ฝฎ Grafana ็ๆง
- ไธ้ฎ้จ็ฝฒ: ้่ฟ
install.shๅ จ่ชๅจๅฎ่ฃ - JuiceFS ๅญๅจ: ๅบไบ PostgreSQL Large Objects (LO) ๅ็ซฏ๏ผๆ่ด่ฝป้
- Kong ๆทฑๅบฆ้ๆ: DB-backed ๅ็ๅจๆ่ทฏ็ฑ๏ผๅ จ็จ API ้ฉฑๅจ๏ผๅ็ ACME SSLใGzip ๅ็ผฉใๅฎๅ จๅๅบๅคดใ็ผ็จๅผ้ๆต
- ่ชๅจๆฉ็ผฉๅฎน: ๅบไบ่ด่ฝฝๆๆ ็ๅ็ดๆๅไธๆฐดๅนณๅฏๆฌๆฉๅฑ
- Bun Edge Runtime: ๅบไบ Bun.js + Elysia Worker Pool๏ผๅ ็ฝฎ Deno ๅ ผๅฎนๅฑไปฅๅ ผๅฎนๆงๅฝๆฐไปฃ็
- SSE ๅฎๆถๆฅๅฟ: ๅบไบ Server-Sent Events ็ๅฎๆถๆฅๅฟๆต๏ผ
journalctl --followๆจ้ - ๅ็ๅผๆญฅ้ๅ: ๅบไบ PostgreSQL LISTEN/NOTIFY ็้ถไพ่ต้ซๅนถๅ่ฐๅบฆๅบๅบง๏ผๆฏๆ AI ๅคงๆจกๅไปปๅกไธ MQTT ๆถๆฏ้ๅ
- WebSocket ไปปๅก้็ฅ: ๅบไบ Bun ๅ็ WebSocket ็ๅฎๆถไปปๅก่ฟๅบฆๆจ้
- DB ไผ้ ้็บง: ๆๆฐ้้ฟ้่ฏ + 503 Service Unavailable๏ผPostgreSQL ็ญๆไธๅฏ็จๆถไธไธข่ฏทๆฑ
- Edge Function ้ข็ญ: ้จ็ฝฒๅ่ชๅจ้ขๅฏผๅ ฅๆจกๅ๏ผๆถ้ค้ฆๆฌก่ฏทๆฑๅทๅฏๅจ
- ๅฝๅ OAuth: ๅ ็ฝฎๅพฎไฟกใๆฏไปๅฎใ้้็ปๅฝ้ๆ
- CI/CD ้ๆ: GitHub Webhook ่ชๅจๅ้จ็ฝฒ
- ๅฎๅๆต่ฏ: 17 ไธชๅๅ ๆต่ฏ + ้ๆๆต่ฏๅฅไปถ
SupaCloud ไธ Supabase ็ๅบๅซ
SupaCloud ๆดๅ็กฎ็ๅฎไฝๆฏ๏ผ้ขๅ่ชๆ็ฎกๅบๆฏ็ๅค็งๆท Supabase ๆงๅถๅนณ้ข๏ผ่ไธๆฏ Supabase Cloud ็้ๅๅคๅปใ
็ฎ็็ป่ฎบ๏ผ
- SupaCloud: ้ๅไฝ ๅจ่ชๆๆๅกๅจไธๆ็ฎกๅคไธช้็ฆป้กน็ฎ๏ผๅนถ้่ฆๅ ็ฝฎๆงๅถๅฐใ้กน็ฎ็ๅฝๅจๆ APIใไปปๅก้ๅ่ฝๅๅๅ็ซฏๆ็ฎก่ฝๅใ
- Supabase Cloud: ้ๅไฝ ็ดๆฅ่ดญไนฐๆ็ฎกๅนณๅฐ๏ผ้่ฆๆ็ฎกๅคไปฝ/PITRใๆ็ฎกๆฅๅฟๅๅฎๆน Branchingใ
- Supabase Self-Hosted: ้ๅไฝ ่ฆๅฎๆนๅ็่ชๆ็ฎกๆ ๏ผๅนถๆฟๆ่ชๅทฑๆฟๆ Docker ไธๅบ็ก่ฎพๆฝ่ฟ็ปดใ
่ฏฆ็ปๅ่ฝๅฏนๆฏ๏ผ
ๆถๆ่ฎพ่ฎก
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Management API (:9090) โ
โ Bun + Elysia + TypeScript + ่ชๅจๆฉ็ผฉๅฎน โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ JwtService โ โ DbService โ โ StorageSvc โ โ
โ โโโโโโโฌโโโโโโโ โโโโโโโฌโโโโโโโ โโโโโโโฌโโโโโโโ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ GatewaySvc โ โ ScalingSvc โ โ BackupSvc โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ RouterSvc โ โ FrontendSv โ โ DeploySvc โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ ๅ
ฑไบซๅบ็ก่ฎพๆฝ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ PostgreSQL โ โ Kong โ โ JuiceFS โ โ
โ โ (Pigsty) โ โ ็ฝๅ
ณ โ โ (PG-LO) โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโ โ
โ โ Grafana โ โ
โ โ (็ๆง) โ โ
โ โโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
ๅฟซ้ๅผๅง
็ณป็ป่ฆๆฑ
| ้กน็ฎ | ๆไฝ้ ็ฝฎ | ๆจ่้ ็ฝฎ |
|---|---|---|
| CPU | 2 ๆ ธ | 4 ๆ ธ+ |
| ๅ ๅญ | 2GB | 4GB+ |
| ็ฃ็ | 40GB | 100GB+ SSD |
| ็ณป็ป | CentOS 9, Ubuntu 22/24, Debian 12 | CentOS 9 |
ไบบ็ฑปๅ ฅๅฃ
้กน็ฎไฝฟ็จ่ CLI
npm install -g @supacloud/cli
supacloud-cli status
supacloud-cli project get
supacloud-cli project logs --log_type database
supacloud-cli frontend list --ref <project-ref>
supacloud-cli ้ป่ฎคๆฏ้กน็ฎ็บง CLI๏ผไผไผๅ
ไปๅฝๅ็ฎๅฝ .env ่ชๅจ็ปๅฎ้กน็ฎใ
ๆง็ supacloud ๅฝไปคๅไป
ไฝไธบๅ
ผๅฎนๅซๅไฟ็๏ผ็ไบงๆๅกๅจไธ็ /usr/local/bin/supacloud ๆฏๆๅก็ซฏไบ่ฟๅถ๏ผๆๆกฃๅๅฎขๆทๆไฝๅบ้ฟๅ
ไฝฟ็จ่ฃธ supacloud ๆไปฃ้กน็ฎ CLIใ
SUPABASE_URLๆSUPACLOUD_API_URLSUPABASE_SERVICE_ROLE_KEYๆSUPACLOUD_API_TOKEN
ๆๅกๅจ็ฎก็ๅ CLI
npx @supacloud/admin status
npx @supacloud/admin ssh ping
npx @supacloud/admin ssh install --public_domain api.example.com --studio_domain studio.example.com
npx @supacloud/admin project create --name my-app
ๅฎ่ฃ
ใๅ็บงใSSH ่ฏๆญใtenant ่ฟ็ปดใๅนณๅฐ็บง้กน็ฎ็ฎก็้ฝๅบๆพๅจ supacloud-adminใ
ๅฎ่ฃ ้จ็ฝฒ
ไธ้ฎๅฎ่ฃ ๏ผๆจ่๏ผ
# ไธญๅฝ็จๆท (ไฝฟ็จ gh-proxy.net ๅ ้)
curl -fsSL https://gh-proxy.net/https://raw.githubusercontent.com/zuohuadong/supacloud/main/setup.sh | sudo bash
# ๅฝ้
็จๆท
curl -fsSL https://raw.githubusercontent.com/zuohuadong/supacloud/main/setup.sh | sudo bash
ๆๅจๅฎ่ฃ
# 1. ไธ่ฝฝไปฃ็ (ไธญๅฝ็จๆทไฝฟ็จๅ ้)
git clone https://gh-proxy.net/https://github.com/zuohuadong/supacloud.git
cd supacloud
# 2. ็ฏๅขๅๅงๅ (ๆฏๆๅฝไปค่กๅๆฐๆ่ฏปๅ config.env)
sudo bash install.sh --ip 1.2.3.4 --domain api.example.com --s3 juicefs
# 3. ๅฏ็จๅฝไปค่กๅทฅๅ
ท
source /etc/profile.d/supacloud.sh
็ไบง็ฏๅขๅ็บง
็ไบงๆๅกๅจๅ็บงๆถ็ดๆฅๆฟๆข /usr/local/bin/supacloud ไธญ็ Linux Release ไบ่ฟๅถๆไปถ๏ผๅธธ่งๅ็บงไธ้่ฆๅจๆๅกๅจไธ git pull ๆบ็ ใ
sudo supacloud upgrade --yes
ๅ็บงๅฝไปคไผไผๅ
ๅฐ่ฏ https://ghproxy.net/๏ผ็ถๅๅๅฐ่ฏ็ด่ฟ GitHub๏ผ้ๅๅฝๅ
ๆๅกๅจใไปฃ็ๅคฑๆๆถๅฏไปฅๆๅฎๅ
ถๅฎไปฃ็ๆๅผบๅถ็ด่ฟ๏ผ
sudo SUPACLOUD_GITHUB_PROXY=https://ghproxy.net/ supacloud upgrade --yes
sudo SUPACLOUD_GITHUB_PROXY=direct supacloud upgrade --yes
ๅๅธไบง็ฉ็บฆๅฎ๏ผ
supacloud-linux-amd64ๅsupacloud-linux-arm64็จไบ็ไบงๅฎ่ฃ ๅๅ็บงใsupacloud-macos-amd64ๅsupacloud-macos-arm64ไป ็จไบๆฌๅฐๅผๅใ่ฏๆญๅ้ช่ฏใ
ๅฝไปค่กๅๆฐ่ฏฆ่งฃ:
| ๅๆฐ | ่ฏดๆ | ็คบไพ |
|---|---|---|
--ip | ๆๅฎๅ ็ฝ IP | --ip 10.0.0.5 |
--domain | ๆๅฎ API ๅๅ | --domain supa.com |
--studio | ๆๅฎ Studio ๅๅ | --studio studio.com |
--s3 | ๆๅฎๅญๅจ็ฑปๅ | juicefsใminio ๆ external |
--password | ็ปไธ่ฎพ็ฝฎๅๅงๅฏ็ | --password mysecret |
้กน็ฎ็ฎก็
็จๆท CLI๏ผsupacloud-cli
supacloud-cli ้ป่ฎคๆฏ้กน็ฎ็บง CLI๏ผ็จไบๅด็ปๅไธช้กน็ฎ็้จ็ฝฒใๆฅๅฟใๆฐๆฎๅบไธ่ตๆบ็ฎก็๏ผ
supacloud-cli status
supacloud-cli project get
supacloud-cli project logs --log_type database
supacloud-cli project tasks
supacloud-cli database query --sql "select now()"
supacloud-cli database query --ref <ref> --file ./queries/vector-search.sql
supacloud-cli database push_migrations --ref <ref> --dir supabase/migrations --dry_run
supacloud-cli auth list_providers --ref <ref>
supacloud-cli frontend list --ref <ref>
supacloud-cli edge_functions list --ref <ref>
supacloud-cli storage list_buckets --ref <ref>
ๅคๆ SQLใpgvector ๆฅ่ฏขใๅ่ฏทๆฑไบๅกๅๅปบ่ฎฎไฝฟ็จ --file๏ผไธ่ฆไพ่ต shell ๅญ็ฌฆไธฒ่ฝฌไนใ
BEGIN;
INSERT INTO audit_events(message) VALUES ('started');
INSERT INTO audit_events(message) VALUES ('finished');
COMMIT;
SupaCloud ๆฏๆๅไธช SQL ่ฏทๆฑๅ
็ไบๅกๅ๏ผไนไผๅจ migration endpoint ๅ
้จไฝฟ็จไบๅก๏ผไธๅปบ่ฎฎๆไพ /transaction/beginใ/transaction/queryใ/transaction/commit ่ฟ็ฑป้ฟ่ฟๆฅ HTTP ไบๅก APIใๅบ็จไพง้ฟไบๅก่ฏทไฝฟ็จ Postgres ็ด่ฟ DSN ้
ๅ pgใpostgres.js ็ญ้ฉฑๅจใ
pgvector ็คบไพ๏ผ
CREATE EXTENSION IF NOT EXISTS vector;
CREATE TABLE documents (
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
content text NOT NULL,
embedding vector(1536)
);
CREATE INDEX documents_embedding_hnsw_idx
ON documents
USING hnsw (embedding vector_cosine_ops);
SELECT id, content
FROM documents
ORDER BY embedding <=> '[0.1,0.2,0.3]'::vector
LIMIT 5;
supacloud ๆๆไธๆฟ่ฝฝๅนณๅฐๅฎ่ฃ
ใๅ็บงใSSH ่ฏๆญใtenant runtime ็ฎก็๏ผไปฅๅ้กน็ฎๅๅปบ/ๅ ้ค/ๆๅ่ฟ็ฑปๅนณๅฐ็บงๅฝไปคใ
็ฎก็ๅ CLI๏ผsupacloud-admin
supacloud-admin status
supacloud-admin ssh ping
supacloud-admin ssh install --public_domain api.example.com --studio_domain studio.example.com
supacloud-admin ssh diagnose
supacloud-admin project list
supacloud-admin project create --name my-app
supacloud-admin project delete --ref <ref>
supacloud-admin project pause --ref <ref>
supacloud-admin platform metrics
Management API
REST API ่ฟ่กๅจ 9090 ็ซฏๅฃ๏ผSwagger ๆๆกฃๅฐๅ๏ผ/swagger
# ๅๅปบ้กน็ฎ
curl -X POST http://localhost:9090/v1/projects \
-H "Authorization: Bearer $MASTER_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "ๆ็้กน็ฎ", "region": "local"}'
# ๅๅบ้กน็ฎ
curl http://localhost:9090/v1/projects \
-H "Authorization: Bearer $MASTER_TOKEN"
# ่ทๅ API ๅฏ้ฅ
curl http://localhost:9090/v1/projects/<ref>/api-keys \
-H "Authorization: Bearer $MASTER_TOKEN"
ๆ ธๅฟ API ็ซฏ็น๏ผ
| ๆนๆณ | ็ซฏ็น | ่ฏดๆ |
|---|---|---|
| GET | /v1/projects | ่ทๅ้กน็ฎๅ่กจ |
| POST | /v1/projects | ๅๅปบ้กน็ฎ |
| GET | /v1/projects/:ref | ่ทๅ้กน็ฎ่ฏฆๆ |
| PATCH | /v1/projects/:ref | ๆดๆฐ้กน็ฎ |
| DELETE | /v1/projects/:ref | ๅ ้ค้กน็ฎ๏ผ่ฝฏๅ ้ค๏ผ |
| POST | /v1/projects/:ref/pause | ๆๅ้กน็ฎ |
| POST | /v1/projects/:ref/restore | ๆขๅค้กน็ฎ |
| GET | /v1/projects/:ref/status | ่ทๅ็ถๆ |
| GET | /v1/projects/:ref/health | ่ทๅๅฅๅบท็ถๆ |
| POST | /v1/projects/:ref/restart | ้ๅฏๆๅก |
| GET | /v1/projects/:ref/settings | ่ทๅ้ ็ฝฎ |
| PUT | /v1/projects/:ref/settings | ๆดๆฐ้ ็ฝฎ |
| GET | /v1/projects/:ref/api-keys | ่ทๅ API ๅฏ้ฅ |
| POST | /v1/projects/:ref/rotate-keys | ่ฝฎๆข API ๅฏ้ฅ |
| GET | /v1/projects/:ref/types/typescript | ่ชๅจ็ๆ TypeScript ็ฑปๅ |
| PATCH | /v1/projects/:ref/config/auth | ่ชๅฎไน้ดๆๅไธๆน OAuth |
| GET | /v1/projects/:ref/secrets | ็ฎก็ Edge Functions Secrets |
| GET | /v1/oauth/authorize | ๆๆๅฎๆน CLI OAuth ็ปๅฝ |
ๆฉๅฑ API ็ซฏ็น๏ผ
| ๅ็ฑป | ็ซฏ็น | ่ฏดๆ |
|---|---|---|
| ๆฐๆฎๅบ | /v1/projects/:ref/database/* | SQL ๆฅ่ฏขใSchema ๆฃๆฅใๆฐๆฎ่ฟ็งป |
| ้ดๆ | /v1/projects/:ref/config/auth | OAuth ็ปๅฝใๅพฎไฟก/ๆฏไปๅฎ/้้ |
| ๅ็ซฏๆ็ฎก | /v1/projects/:ref/frontend/* | Pages ๆ็ฎกใ่ชๅจ้จ็ฝฒใ่ชๅฎไนๅๅ |
| Webhook | /v1/webhooks/github | GitHub Webhook CI/CD ่ชๅจ้จ็ฝฒ |
| ๅญๅจ | /v1/storage/* | Bucket ็ฎก็ใๆไปถไธไผ ใS3 ่ฟ็งป |
| ๆฉๅฑ | /v1/extensions/* | PostgreSQL ๆฉๅฑๅธๅบ |
| ๆฉ็ผฉๅฎน | /v1/projects/:ref/scaling/* | ๅ็ดๅ็บงไธๆฐดๅนณๅฏๆฌ |
| ๅคไปฝ | /v1/projects/:ref/backups/* | ๆฐๆฎๅบๅคไปฝไธๆขๅค |
| ็ๆง | /v1/monitor/* | ๆฐๆฎๅบ็ๆงไธๅฅๅบทๆฃๆฅ |
| ๅฎๅ จ | /v1/security/* | ้ฒ็ซๅข่งๅไธ SSL ่ฏไนฆ |
| ้จ็ฝฒ | /v1/deploy/* | Edge Function ้จ็ฝฒ |
| ไปปๅก | /v1/projects/:ref/tasks/* | ๅๅฐ AI/้็จๅผๆญฅไปปๅก็ๅฝๅจๆ่งๆตไธ็ๆง |
| ๆฅๅฟ SSE | GET /v1/projects/:ref/logs/stream | ๅฎๆถๆฅๅฟๆต๏ผServer-Sent Events๏ผ |
| ้ๆต | GET/PUT /v1/projects/:ref/gateway/rate-limit ๅ custom-rate-limits | ็ผ็จๅผๆถๆไธๅฎขๆท็ซฏ่ทฏ็ฑ่ชๅฎ้ๆต๏ผKong Admin API ้ฉฑๅจ๏ผ |
| WebSocket | ws://host/ws/tasks | ๅฎๆถไปปๅก่ฟๅบฆๆจ้ |
่ฟ่กๆถๅๆข
# ๅๆข Edge Runtime ้จ็ฝฒๆจกๅผ
./switch.sh runtime embedded # ็ฑ supacloud.service ็ฎก็
./switch.sh runtime external # ็ฌ็ซ supacloud-edge-runtime.service
# ๅๆขๅญๅจๅ็ซฏ
./switch.sh storage juicefs # ๆ: minio, external
# ๆฅ็ๅฝๅ้
็ฝฎ
./switch.sh status
Edge Runtime ๆถๆ (Bun ๆจกๅผ):
SupaCloud (:9090) Edge Runtime (:9000)
โโโ Management API โโโ ้ป่ฎค็ฑ supacloud.service ็ฎก็
โโโ Web Console โโโ Elysia Server
โโโ SSE ๆฅๅฟๆต โโโ Worker ็บฟ็จๆฑ (4 ็บฟ็จ๏ผๅบๅฎ)
โโโ WebSocket /ws/tasks โโโ Deno ๅ
ผๅฎนๅฑ
โโโ ้ๆ่ตๆบ (ETag/304) โโโ URL Import ๆไปถ
โโโ /preheat (้ถๅทๅฏๅจ้ข็ญ)
Kong ็ฝๅ
ณ (API ้ฉฑๅจ๏ผๅ็ OpenResty):
ๅ
จๅฑๆไปถ: ACME SSL, Gzip ๅ็ผฉ, ๅฎๅ
จๅๅบๅคด, ่ฎฟ้ฎๆฅๅฟ
่ทฏ็ฑ็บงๆไปถ: CORS, ้ๆต, JWT, IP ้ๅถ
/api/* โ :9090 (็ฎก็ API)
/functions/* โ :9000 (Edge Runtime ็ด่ฟ)
้ป่ฎคๅฎ่ฃ
ไฝฟ็จ EDGE_RUNTIME_MODE=embedded๏ผไนๅฐฑๆฏ็ฑ supacloud.service ็ดๆฅๆ่ตท Bun Edge Runtime ๅญ่ฟ็จใEDGE_RUNTIME_MODE=external ๆถๅฏไปฅๆน็จ็ฌ็ซ็ supacloud-edge-runtime.service๏ผไฝไธค็งๆจกๅผไธ่ฝๅๆถ่ฟ่ก๏ผๅฆๅไผไบๆข 9000 ็ซฏๅฃใ
| ็นๆง | ๅฝๅ Bun Runtime |
|---|---|
| ๅ ๅญ (200 ๅฝๆฐ) | ~140MB |
| ๅทๅฏๅจ | < 10ms (้ข็ญๅ: 0ms) |
| ้ข็ญๅปถ่ฟ | <1ms |
| Deno ไปฃ็ ๅ ผๅฎน | โ ๅ ผๅฎนๅฑ |
| ้็ฆป็บงๅซ | Worker ็บฟ็จ |
| ็จๆทๅฝๆฐๆนๅจ | ้ถๆนๅจ |
CLI ๅ ฅๅฃ
้ขๅ็ไบบๆไฝ่ ็ๅฝไปค่ก็ฐๅทฒๆๅไธบ๏ผ
@supacloud/cli/supacloud-cli๏ผ้กน็ฎไฝฟ็จ่ CLI๏ผ้ป่ฎคไปๅฝๅ็ฎๅฝ.env่ชๅจ็ปๅฎ้กน็ฎ๏ผ่ฃธsupacloudไป ไธบๅ ผๅฎนๅซๅ@supacloud/admin/supacloud-admin๏ผๆๅกๅจ็ฎก็ๅ CLI๏ผๅค็ SSHใๅฎ่ฃ ใๅ็บงใ็งๆท่ฟ็ปด
้กน็ฎ็ปๆ
supacloud/
โโโ install.sh # ไธ้ฎ้จ็ฝฒ่ๆฌ
โโโ setup.sh # ่ฟ็จๅฎ่ฃ
ๅผๅฏผ
โโโ switch.sh # ่ฟ่กๆถ/ๅญๅจๅๆขๅทฅๅ
ท
โโโ supacloud # CLI ็ฎก็ๅทฅๅ
ท (Shell ๅ
ฅๅฃ)
โโโ config.env # ๅ
จๅฑ้
็ฝฎๆไปถ
โโโ packages/
โ โโโ management-api/ # REST API ๆๅก (Bun + Elysia)
โ โ โโโ src/
โ โ โ โโโ routes/ # 19 ไธช่ทฏ็ฑๆจกๅ (projects, auth, frontend, webhook, ws, logs ็ญ)
โ โ โ โโโ services/ # 20 ไธชๆๅกๆจกๅ
โ โ โ โโโ cli/ # CLI ๅญๅฝไปค (lifecycle, project)
โ โ โ โโโ db/ # ๆฐๆฎๅบๅฑใ่ฟ็งปใwithRetry ไผ้
้็บง
โ โ โ โโโ middleware/ # ่ฎค่ฏไธญ้ดไปถ
โ โ โ โโโ infra/ # ๅฅๅบทๆฃๆฅๅจ
โ โ โ โโโ install.ts # ไบคไบๅผๅฎ่ฃ
ๅจ
โ โ โ โโโ upgrade.ts # ๅ็บงๅๅฏผ
โ โ โ โโโ doctor.ts # ็ณป็ป่ฏๆญ
โ โ โโโ tests/ # ๅๅ
ๆต่ฏ (17) & ้ๆๆต่ฏ
โ โโโ cli/ # ้กน็ฎไฝฟ็จ่
CLI
โ โ โโโ src/
โ โโโ admin/ # ๆๅกๅจ็ฎก็ๅ CLI
โ โ โโโ src/
โ โโโ edge-runtime/ # Bun ไบๅฝๆฐ่ฟ่กๆถ
โ โ โโโ server.ts # Elysia ๆๅก (:9000) + /preheat ้ข็ญ็ซฏ็น
โ โ โโโ worker-pool.ts # ๅบๅฎๅคงๅฐ Worker ็บฟ็จๆฑ + preheat()
โ โ โโโ worker-executor.ts # ๅฝๆฐๅ ่ฝฝๅจ + LRU ็ผๅญ + ้ข็ญๆถๆฏ
โ โ โโโ deno-compat.ts # Deno API ๅ
ผๅฎนๅฑ
โ โ โโโ url-import-plugin.ts# Bun Plugin: URL import ๆฆๆช
โ โ โโโ shims/ # Deno ๆ ๅๅบๆฟไปฃๅฎ็ฐ
โ โโโ web-console/ # SvelteKit ็ฎก็้ขๆฟ
โ โโโ src/ # ็ปไปถ, ่ทฏ็ฑ, ่ตๆบ
โโโ scripts/
โ โโโ lib/ # Shell ่ๆฌๆจกๅ
โ โโโ db_manager.sh # ๆฐๆฎๅบ็ๅฝๅจๆ
โ โโโ gateway_manager.sh # Kong ็ฝๅ
ณ้
็ฝฎ
โ โโโ tenant_runtime.sh # ็งๆท PostgREST & GoTrue ่ฟ่กๆถ
โ โโโ function_manager.sh # ไบๅฝๆฐ็ฎก็
โ โโโ s3_manager.sh # ๅญๅจๅ็ซฏ็ฎก็
โ โโโ jwt_manager.sh # JWT ๅฏ้ฅ็ๆ
โ โโโ backup_manager.sh # ๅคไปฝๆไฝ
โ โโโ ha_manager.sh # ้ซๅฏ็จ
โ โโโ security_manager.sh # ้ฒ็ซๅข & SSL
โ โโโ storage_manager.sh # ๅญๅจๆไฝ
โ โโโ extension_manager.sh# PostgreSQL ๆฉๅฑ
โ โโโ global_router.ts # ๅ
จๅฑ่ทฏ็ฑ้ป่พ
โ โโโ worker_runner.ts # ๅๅฐ Worker
โโโ infra/
โ โโโ os/ # ๆไฝ็ณป็ป้
็ฝฎ
โ โโโ postgres/ # PostgreSQL ้
็ฝฎ
โโโ docs/ # 14 ็ฏๆๆฏๆๆกฃ
โ โโโ deploy-guide.md # ้จ็ฝฒๆๅ
โ โโโ architecture-multi-tenant.md # ๆถๆ่ฎพ่ฎก
โ โโโ china-oauth-integration.md # ๅฝๅ
OAuth ้ๆ
โ โโโ ... # ่ฏฆ่ง docs/README.md ๅฎๆด็ดขๅผ
โโโ .github/
โโโ workflows/ # CI/CD (build-studio, management-api, release)
้ ็ฝฎ่ฏดๆ
config.env ๅ
ณ้ฎ้
็ฝฎ้กน๏ผ
| ๅ้ | ่ฏดๆ | ้ป่ฎคๅผ |
|---|---|---|
SUPABASE_PUBLIC_DOMAIN | ๅ จๅฑ API ็ฝๅ ณๅๅ | ็ไบงๅฟ ๅกซ๏ผๅฎ่ฃ ๅจๅฏ่ชๅจ็ๆ |
SUPABASE_STUDIO_DOMAIN | ๅ จๅฑๆงๅถๅฐๅๅ | ๅฏ็็ฉบ๏ผ้ป่ฎคไป API ๅๅๆดพ็ |
S3_STORAGE_TYPE | ๅญๅจๅ็ซฏ | juicefs |
EDGE_RUNTIME | ไบๅฝๆฐ่ฟ่กๆถ | bun |
PG_VERSION | PostgreSQL ็ๆฌ | 18 |
PIGSTY_VERSION | Pigsty ็ๆฌ | latest |
ENABLE_ANALYTICS | Logflare ๅๆ | true |
ๅ่ๆๆกฃ
- ๆๆกฃ็ดขๅผ
- ้จ็ฝฒๆๅ
- ๅค็งๆทๆถๆ่ฎพ่ฎก
- ๅฝๅ OAuth ้ๆ
- Pigsty ๅฎๆนๆๆกฃ
- Supabase ่ชๆ็ฎกๆๆกฃ
License
MIT
