A community based topic aggregation platform built on atproto
1# Coves Local Development Environment Configuration
2# This file contains all environment variables for the local atProto development stack
3# DO NOT commit secrets to version control in production!
4
5# =============================================================================
6# PostgreSQL Configuration (Development Database)
7# =============================================================================
8# Development database for Coves AppView (runs on port 5435)
9POSTGRES_HOST=localhost
10POSTGRES_PORT=5435
11POSTGRES_DB=coves_dev
12POSTGRES_USER=dev_user
13POSTGRES_PASSWORD=dev_password
14
15# =============================================================================
16# PDS (Personal Data Server) Configuration
17# =============================================================================
18# PDS runs on port 3001 (to avoid conflict with production PDS on :3000)
19PDS_HOSTNAME=localhost
20PDS_PORT=3001
21
22# DID PLC Directory (use Bluesky's for development)
23PDS_DID_PLC_URL=https://plc.directory
24
25# JWT Secret (for signing tokens - change in production!)
26PDS_JWT_SECRET=local-dev-jwt-secret-change-in-production
27
28# Admin password for PDS management
29PDS_ADMIN_PASSWORD=admin
30
31# Handle domains (users will get handles like alice.local.coves.dev)
32# Communities will use .communities.coves.social
33PDS_SERVICE_HANDLE_DOMAINS=.local.coves.dev,.communities.coves.social
34
35# PLC Rotation Key (k256 private key in hex format - for local dev only)
36# This is a randomly generated key for testing - DO NOT use in production
37PDS_PLC_ROTATION_KEY=af514fb84c4356241deed29feb392d1ee359f99c05a7b8f7bff2e5f2614f64b2
38
39# =============================================================================
40# AppView Configuration (Your Go Application)
41# =============================================================================
42# AppView runs on port 8081 (to avoid conflicts)
43APPVIEW_PORT=8081
44
45# PDS Firehose URL (WebSocket connection - direct to PDS, no relay)
46FIREHOSE_URL=ws://localhost:3001/xrpc/com.atproto.sync.subscribeRepos
47
48# PDS URL (for XRPC calls)
49PDS_URL=http://localhost:3001
50
51# =============================================================================
52# Test Database Configuration
53# =============================================================================
54# Test database runs on port 5434 (separate from dev on 5433)
55POSTGRES_TEST_DB=coves_test
56POSTGRES_TEST_USER=test_user
57POSTGRES_TEST_PASSWORD=test_password
58POSTGRES_TEST_PORT=5434
59
60# =============================================================================
61# Jetstream Configuration (Read-Forward User Indexing)
62# =============================================================================
63# Jetstream WebSocket URL for real-time atProto events
64#
65# Production: Use Bluesky's public Jetstream (indexes entire network)
66# JETSTREAM_URL=wss://jetstream2.us-east.bsky.network/subscribe?wantedCollections=app.bsky.actor.profile
67#
68# Local E2E Testing: Use local Jetstream (indexes only local PDS)
69# 1. Start local Jetstream: docker-compose --profile jetstream up pds jetstream
70# 2. Use this URL:
71JETSTREAM_URL=ws://localhost:6008/subscribe
72
73# Optional: Filter events to specific PDS
74# JETSTREAM_PDS_FILTER=http://localhost:3001
75
76# =============================================================================
77# Identity Resolution Configuration
78# =============================================================================
79# PLC Directory URL for DID resolution
80IDENTITY_PLC_URL=https://plc.directory
81
82# Cache TTL for resolved identities (Go duration format: 24h, 1h30m, etc.)
83IDENTITY_CACHE_TTL=24h
84
85# =============================================================================
86# OAuth Configuration
87# =============================================================================
88# OAuth client private key (ES256 keypair - generate with: go run cmd/genjwks/main.go)
89# DO NOT commit this to version control in production!
90#
91# Supports two formats:
92# 1. Plain JSON (easier for local development):
93# OAUTH_PRIVATE_JWK={"alg":"ES256","crv":"P-256",...}
94#
95# 2. Base64 encoded (recommended for production to avoid shell escaping):
96# OAUTH_PRIVATE_JWK=base64:eyJhbGciOiJFUzI1NiIsImNydiI6IlAtMjU2Ii...
97# Generate with: echo '{"alg":...}' | base64 -w 0
98#
99OAUTH_PRIVATE_JWK={"alg":"ES256","crv":"P-256","d":"9tCMceYSgyZfO5KYOCm3rWEhXLqq2l4LjP7-PJtJKyk","kid":"oauth-client-key","kty":"EC","use":"sig","x":"EOYWEgZ2d-smTO6jh0f-9B7YSFYdlrvlryjuXTCrOjE","y":"_FR2jBcWNxoJl5cd1eq9sYtAs33No9AVtd42UyyWYi4"}
100
101# Cookie secret for session encryption (generate with: openssl rand -hex 32)
102# Also supports base64: prefix for consistency
103OAUTH_COOKIE_SECRET=f1132c01b1a625a865c6c455a75ee793572cedb059cebe0c4c1ae4c446598f7d
104
105# AppView public URL (used for OAuth callback and client metadata)
106# Dev: http://127.0.0.1:8081 (use 127.0.0.1 instead of localhost per RFC 8252)
107# Prod: https://coves.social
108APPVIEW_PUBLIC_URL=http://127.0.0.1:8081
109
110# =============================================================================
111# Coves Instance PDS Authentication
112# =============================================================================
113# The Coves instance needs a PDS account to write community records
114# Create this account once: curl -X POST http://localhost:3001/xrpc/com.atproto.server.createAccount
115PDS_INSTANCE_HANDLE=testuser123.local.coves.dev
116PDS_INSTANCE_PASSWORD=test-password-123
117
118# =============================================================================
119# Development Settings
120# =============================================================================
121# Environment
122ENV=development
123NODE_ENV=development
124IS_DEV_ENV=true
125
126# Logging
127LOG_LEVEL=debug
128LOG_ENABLED=true
129
130# =============================================================================
131# PLC Directory Configuration
132# =============================================================================
133# URL for PLC (Public Ledger of Credentials) directory
134# Only used when IS_DEV_ENV=false (production)
135#
136# When IS_DEV_ENV=true: Generate did:plc:xxx locally WITHOUT registering (no PLC needed)
137# When IS_DEV_ENV=false: Generate did:plc:xxx AND register with PLC_DIRECTORY_URL
138#
139# Production: https://plc.directory (currently Bluesky's, will transfer to third party)
140PLC_DIRECTORY_URL=https://plc.directory
141
142# =============================================================================
143# Notes
144# =============================================================================
145# All local development configuration in one file!
146# - Dev PostgreSQL: port 5435
147# - Test PostgreSQL: port 5434 (via --profile test)
148# - PDS: port 3001 (avoids conflict with production on :3000)
149# - AppView: port 8081
150# - PDS is self-contained (SQLite + CAR files)
151# - PostgreSQL is only for Coves AppView indexing
152# - AppView subscribes directly to PDS firehose (no relay needed)
153# - PDS firehose: ws://localhost:3001/xrpc/com.atproto.sync.subscribeRepos