fix(redis): silence Redis internal logging and optimize connection pool settings to reduce mutex contention feat(userlist): enhance user list component with avatar support and improved styling test(load): add production-style load test script for WebSocket connections and Redis PubSub stress testing chore(loadtest): create script to run load tests with pprof profiling for performance analysis
76 lines
2.3 KiB
Plaintext
76 lines
2.3 KiB
Plaintext
# Backend Environment Variables
|
|
# Copy this file to .env.local for local development
|
|
|
|
# ===================
|
|
# REQUIRED VARIABLES
|
|
# ===================
|
|
|
|
# Database Configuration
|
|
# Format: postgres://username:password@host:port/database?sslmode=disable
|
|
DATABASE_URL=postgres://collab:collab123@localhost:5432/collaboration?sslmode=disable
|
|
|
|
# JWT Secret - Use a strong random string (min 32 characters)
|
|
# Generate with: openssl rand -hex 32
|
|
JWT_SECRET=your-secret-key-change-this-in-production
|
|
|
|
# ===================
|
|
# SERVER CONFIGURATION
|
|
# ===================
|
|
|
|
# Server port (default: 8080)
|
|
# Can be overridden with --port flag: go run cmd/server/main.go --port 8081
|
|
PORT=8080
|
|
|
|
# Environment: development, staging, production
|
|
# Controls: cookie security (Secure flag), logging verbosity
|
|
ENVIRONMENT=development
|
|
|
|
# Backend URL (used to auto-construct OAuth callback URLs)
|
|
# If not set, defaults to http://localhost:${PORT}
|
|
# Set explicitly for production: https://api.yourdomain.com
|
|
BACKEND_URL=http://localhost:8080
|
|
|
|
# Frontend URL (for OAuth redirects after login)
|
|
FRONTEND_URL=http://localhost:5173
|
|
|
|
# ===================
|
|
# CORS CONFIGURATION
|
|
# ===================
|
|
|
|
# Comma-separated list of allowed origins
|
|
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
|
|
|
|
# ===================
|
|
# OAUTH CONFIGURATION
|
|
# ===================
|
|
|
|
# Google OAuth (https://console.cloud.google.com/)
|
|
GOOGLE_CLIENT_ID=your-google-client-id
|
|
GOOGLE_CLIENT_SECRET=your-google-client-secret
|
|
# Redirect URL - auto-derived from BACKEND_URL if not set
|
|
# GOOGLE_REDIRECT_URL=http://localhost:8080/api/auth/google/callback
|
|
|
|
# GitHub OAuth (https://github.com/settings/developers)
|
|
GITHUB_CLIENT_ID=your-github-client-id
|
|
GITHUB_CLIENT_SECRET=your-github-client-secret
|
|
# Redirect URL - auto-derived from BACKEND_URL if not set
|
|
# GITHUB_REDIRECT_URL=http://localhost:8080/api/auth/github/callback
|
|
|
|
# ===================
|
|
# OPTIONAL SERVICES
|
|
# ===================
|
|
|
|
# Redis (for future use)
|
|
REDIS_URL=redis://localhost:6379
|
|
|
|
# ===================
|
|
# PROFILING (pprof)
|
|
# ===================
|
|
# Enable pprof endpoints at /debug/pprof/* (non-production only)
|
|
# ENABLE_PPROF=1
|
|
# Only allow requests from localhost/loopback (recommended)
|
|
# PPROF_LOCAL_ONLY=true
|
|
# Optional: contention profiling (adds overhead; best for short windows)
|
|
# PPROF_BLOCK_RATE=1
|
|
# PPROF_MUTEX_FRACTION=1
|