initial
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# Client-side env vars that apps consume (copied into apps/mobile/.env and apps/desktop/.env).
|
||||
# Server-side vars (POSTGRES_PASSWORD, JWT_SECRET, SERVICE_ROLE_KEY, SMTP_*, etc.) live in
|
||||
# the Supabase compose .env on the VPS — do NOT mix them with client vars.
|
||||
|
||||
# Public URL of the self-hosted Supabase gateway (served by Caddy).
|
||||
SUPABASE_URL=https://supabase.example.com
|
||||
|
||||
# Anon public key (safe to ship to clients).
|
||||
SUPABASE_ANON_KEY=replace_me
|
||||
|
||||
# Deep-link scheme used for magic-link redirects.
|
||||
AUTH_REDIRECT_URL=chatapp://auth/callback
|
||||
@@ -0,0 +1,42 @@
|
||||
# Supabase Self-Hosting
|
||||
|
||||
We do NOT vendor the Supabase docker-compose here — we track the official repo instead.
|
||||
|
||||
## Bootstrap on a fresh Hetzner VPS (Debian/Ubuntu)
|
||||
|
||||
```bash
|
||||
# 1. Install Docker + Compose plugin
|
||||
curl -fsSL https://get.docker.com | sh
|
||||
sudo usermod -aG docker $USER
|
||||
|
||||
# 2. Clone Supabase's official self-host setup
|
||||
git clone --depth 1 https://github.com/supabase/supabase.git
|
||||
cd supabase/docker
|
||||
|
||||
# 3. Seed env
|
||||
cp .env.example .env
|
||||
# Edit .env: set POSTGRES_PASSWORD, JWT_SECRET, ANON_KEY, SERVICE_ROLE_KEY, SMTP creds,
|
||||
# SITE_URL, API_EXTERNAL_URL, STUDIO_DEFAULT_ORGANIZATION etc.
|
||||
|
||||
# 4. Pull + run
|
||||
docker compose pull
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
## Our repo owns
|
||||
|
||||
- `migrations/` — SQL migrations applied via Supabase CLI (`supabase db push`) to the self-hosted DB.
|
||||
- `.env.example` — the subset of Supabase env vars our client code depends on.
|
||||
- This README.
|
||||
|
||||
## Reverse proxy
|
||||
|
||||
Caddy setup lives in a separate directory (not part of this milestone). The public edge
|
||||
terminates TLS and routes `/auth/*`, `/rest/*`, `/realtime/*`, `/storage/*`, `/functions/*`
|
||||
to the compose stack, and `/` to Supabase Studio (ACL-restricted).
|
||||
|
||||
## Security notes
|
||||
|
||||
- Rotate JWT_SECRET at first boot; never reuse the example.
|
||||
- SERVICE_ROLE_KEY never ships to any client — only edge functions / admin scripts.
|
||||
- Enable RLS on every user-facing table. Invite-only enforced via `invites` table + policy.
|
||||
@@ -0,0 +1,9 @@
|
||||
# Placeholder.
|
||||
#
|
||||
# We do NOT vendor Supabase's compose file — it changes often and shipping a fork
|
||||
# means tracking upstream manually. Instead, follow the setup in ./README.md:
|
||||
# clone https://github.com/supabase/supabase and run `docker compose up -d` in
|
||||
# `supabase/docker`. SQL migrations from ./migrations apply on top.
|
||||
#
|
||||
# If we ever need compose overrides (extra services, custom volumes), add a
|
||||
# `docker-compose.override.yml` next to this file and document it in README.
|
||||
Reference in New Issue
Block a user