A community based topic aggregation platform built on atproto
1# Coves Local Development Environment Configuration
2# Copy this to .env.dev and fill in your values
3#
4# Quick Start:
5# 1. cp .env.dev.example .env.dev
6# 2. Generate OAuth key: go run cmd/genjwks/main.go (copy output to OAUTH_PRIVATE_JWK)
7# 3. Generate cookie secret: openssl rand -hex 32
8# 4. make dev-up # Start Docker services
9# 5. make run # Start the server (uses -tags dev)
10
11# =============================================================================
12# Dev Mode Quick Reference
13# =============================================================================
14# REQUIRED for local OAuth to work with local PDS:
15# IS_DEV_ENV=true # Master switch for dev mode
16# PDS_URL=http://localhost:3001 # Local PDS for handle resolution
17# PLC_DIRECTORY_URL=http://localhost:3002 # Local PLC directory
18# APPVIEW_PUBLIC_URL=http://127.0.0.1:8081 # Use IP not localhost (RFC 8252)
19#
20# BUILD TAGS:
21# make run - Runs with -tags dev (includes localhost OAuth resolvers)
22# make build - Production binary (no dev code)
23# make build-dev - Dev binary (includes dev code)
24
25# =============================================================================
26# PostgreSQL Configuration
27# =============================================================================
28POSTGRES_HOST=localhost
29POSTGRES_PORT=5435
30POSTGRES_DB=coves_dev
31POSTGRES_USER=dev_user
32POSTGRES_PASSWORD=dev_password
33
34# Test database
35POSTGRES_TEST_DB=coves_test
36POSTGRES_TEST_USER=test_user
37POSTGRES_TEST_PASSWORD=test_password
38POSTGRES_TEST_PORT=5434
39
40# =============================================================================
41# PDS Configuration
42# =============================================================================
43PDS_HOSTNAME=localhost
44PDS_PORT=3001
45PDS_SERVICE_ENDPOINT=http://localhost:3000
46PDS_DID_PLC_URL=http://plc-directory:3000
47PDS_JWT_SECRET=local-dev-jwt-secret-change-in-production
48PDS_ADMIN_PASSWORD=admin
49PDS_SERVICE_HANDLE_DOMAINS=.local.coves.dev,.coves.social
50PDS_PLC_ROTATION_KEY=<generate-a-random-hex-key>
51
52# =============================================================================
53# AppView Configuration
54# =============================================================================
55APPVIEW_PORT=8081
56FIREHOSE_URL=ws://localhost:3001/xrpc/com.atproto.sync.subscribeRepos
57PDS_URL=http://localhost:3001
58APPVIEW_PUBLIC_URL=http://127.0.0.1:8081
59
60# =============================================================================
61# Jetstream Configuration
62# =============================================================================
63# User profile indexing - wantedCollections filters to profile events only
64JETSTREAM_URL=ws://localhost:6008/subscribe?wantedCollections=social.coves.actor.profile
65
66# =============================================================================
67# Identity Resolution
68# =============================================================================
69IDENTITY_CACHE_TTL=24h
70PLC_DIRECTORY_URL=http://localhost:3002
71
72# =============================================================================
73# OAuth Configuration (MUST GENERATE YOUR OWN)
74# =============================================================================
75# Generate with: go run cmd/genjwks/main.go
76OAUTH_PRIVATE_JWK=<generate-your-own-jwk>
77
78# Generate with: openssl rand -hex 32
79OAUTH_COOKIE_SECRET=<generate-your-own-secret>
80
81# OAuth Confidential Client Configuration (optional, for testing)
82# If both are set, Coves becomes a confidential OAuth client with 90-day session lifetime
83# (Public clients are limited to 14 days by the auth server)
84# Generate keys with: go run ./cmd/tools/generate-oauth-key
85
86# P-256 private key in multibase format (z-prefixed base58btc)
87# OAUTH_CLIENT_PRIVATE_KEY=z...
88
89# Key identifier (arbitrary string, used in JWT header)
90# OAUTH_CLIENT_KEY_ID=coves-dev-key-1
91
92# =============================================================================
93# Development Settings
94# =============================================================================
95ENV=development
96NODE_ENV=development
97IS_DEV_ENV=true
98LOG_LEVEL=debug
99LOG_ENABLED=true
100
101# Security settings (ONLY for local dev - set to false in production!)
102SKIP_DID_WEB_VERIFICATION=true
103AUTH_SKIP_VERIFY=true
104HS256_ISSUERS=http://localhost:3001
105
106# =============================================================================
107# Image Proxy Configuration
108# =============================================================================
109# On-the-fly image resizing with disk caching
110# Defaults to enabled - falls back to direct PDS URLs if proxy fails
111IMAGE_PROXY_ENABLED=true
112IMAGE_PROXY_BASE_URL=http://127.0.0.1:8081
113IMAGE_PROXY_CACHE_PATH=./cache/images
114IMAGE_PROXY_CACHE_MAX_GB=5
115# Optional: CDN URL for production (leave empty for local dev)
116# IMAGE_PROXY_CDN_URL=
117IMAGE_PROXY_FETCH_TIMEOUT_SECONDS=30
118IMAGE_PROXY_MAX_SOURCE_SIZE_MB=10
119
120# =============================================================================
121# OpenTelemetry Observability (Optional)
122# =============================================================================
123# Disabled by default. Enable for local Jaeger: docker compose --profile observability up
124OTEL_ENABLED=false
125# OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317
126# OTEL_SERVICE_NAME=coves-appview-dev