|
| 1 | +# ============================================================================= |
| 2 | +# Sprout Backend — Local Development Environment |
| 3 | +# ============================================================================= |
| 4 | +# Copy this file to .env and adjust as needed: |
| 5 | +# cp .env.example .env |
| 6 | +# |
| 7 | +# All defaults here work with `docker compose up` out of the box. |
| 8 | +# |
| 9 | +# Service ports (defaults): |
| 10 | +# MySQL → localhost:3306 |
| 11 | +# Redis → localhost:6379 |
| 12 | +# Typesense → localhost:8108 |
| 13 | +# Adminer → localhost:8082 (DB browser UI) |
| 14 | +# |
| 15 | +# Note: If port 8082 conflicts, change the adminer port in docker-compose.yml |
| 16 | +# ============================================================================= |
| 17 | + |
| 18 | +# ----------------------------------------------------------------------------- |
| 19 | +# Database (MySQL 8.0) |
| 20 | +# ----------------------------------------------------------------------------- |
| 21 | +DATABASE_URL=mysql://sprout:sprout_dev@localhost:3306/sprout |
| 22 | +MYSQL_ROOT_PASSWORD=sprout_dev |
| 23 | +MYSQL_USER=sprout |
| 24 | +MYSQL_PASSWORD=sprout_dev |
| 25 | +MYSQL_DATABASE=sprout |
| 26 | + |
| 27 | +# ----------------------------------------------------------------------------- |
| 28 | +# Redis 7 |
| 29 | +# ----------------------------------------------------------------------------- |
| 30 | +REDIS_URL=redis://localhost:6379 |
| 31 | + |
| 32 | +# ----------------------------------------------------------------------------- |
| 33 | +# Typesense (search) |
| 34 | +# ----------------------------------------------------------------------------- |
| 35 | +TYPESENSE_API_KEY=sprout_dev_key |
| 36 | +TYPESENSE_URL=http://localhost:8108 |
| 37 | + |
| 38 | +# ----------------------------------------------------------------------------- |
| 39 | +# Relay (WebSocket server) |
| 40 | +# ----------------------------------------------------------------------------- |
| 41 | +# Bind address for the relay (host:port) |
| 42 | +SPROUT_BIND_ADDR=0.0.0.0:3000 |
| 43 | +# Public WebSocket URL — used in NIP-42 auth challenges |
| 44 | +RELAY_URL=ws://localhost:3000 |
| 45 | +# Set to true in production to require bearer token authentication |
| 46 | +SPROUT_REQUIRE_AUTH_TOKEN=false |
| 47 | + |
| 48 | +# ----------------------------------------------------------------------------- |
| 49 | +# Auth |
| 50 | +# ----------------------------------------------------------------------------- |
| 51 | +# Set to false for dev (accepts NIP-42 without JWT, allows X-Pubkey header). |
| 52 | +# Set to true in production to require bearer token authentication. |
| 53 | +SPROUT_REQUIRE_AUTH_TOKEN=false |
| 54 | + |
| 55 | +# JWKS endpoint for verifying JWT access tokens. |
| 56 | +# Claim that carries the user's Nostr public key (hex, 32 bytes). |
| 57 | +OKTA_PUBKEY_CLAIM=nostr_pubkey |
| 58 | + |
| 59 | +# ── Keycloak (local OAuth testing — stands in for Okta in prod) ────────────── |
| 60 | +# Keycloak is NOT a production dependency. It lets you test the full OAuth |
| 61 | +# flow locally without needing an Okta tenant. Run `docker compose up -d` |
| 62 | +# then `./scripts/setup-keycloak.sh` to create the realm, client, and users. |
| 63 | +# |
| 64 | +# Admin UI: http://localhost:8180 (admin / admin) |
| 65 | +# Get a token: |
| 66 | +# curl -s -X POST http://localhost:8180/realms/sprout/protocol/openid-connect/token \ |
| 67 | +# -d 'client_id=sprout-desktop&grant_type=password&username=tyler&password=password123' \ |
| 68 | +# | jq -r .access_token |
| 69 | +OKTA_JWKS_URI=http://localhost:8180/realms/sprout/protocol/openid-connect/certs |
| 70 | +OKTA_ISSUER=http://localhost:8180/realms/sprout |
| 71 | +OKTA_AUDIENCE=sprout-desktop |
| 72 | + |
| 73 | +# ── Okta (production / staging) ────────────────────────────────────────────── |
| 74 | +# Uncomment and fill in when deploying against a real Okta tenant. |
| 75 | +# OKTA_JWKS_URI=https://dev-example.okta.com/oauth2/default/v1/keys |
| 76 | +# OKTA_ISSUER=https://dev-example.okta.com/oauth2/default |
| 77 | +# OKTA_AUDIENCE=sprout-api |
| 78 | +# OKTA_PUBKEY_CLAIM=nostr_pubkey |
| 79 | + |
| 80 | +# ----------------------------------------------------------------------------- |
| 81 | +# Logging / Tracing |
| 82 | +# ----------------------------------------------------------------------------- |
| 83 | +RUST_LOG=sprout_relay=debug,sprout_db=debug,sprout_auth=debug,sprout_pubsub=debug,tower_http=debug |
| 84 | + |
| 85 | +# OTLP tracing endpoint (optional — leave unset to disable) |
| 86 | +# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 |
| 87 | + |
| 88 | +# ----------------------------------------------------------------------------- |
| 89 | +# sqlx (offline mode for Docker builds — set to true in CI/Docker) |
| 90 | +# ----------------------------------------------------------------------------- |
| 91 | +SQLX_OFFLINE=false |
| 92 | + |
| 93 | +# ----------------------------------------------------------------------------- |
| 94 | +# Huddle (LiveKit integration) |
| 95 | +# ----------------------------------------------------------------------------- |
| 96 | +# LIVEKIT_API_KEY=devkey |
| 97 | +# LIVEKIT_API_SECRET=devsecret |
| 98 | +# LIVEKIT_URL=ws://localhost:7880 |
0 commit comments