|
| 1 | +# ============================================================================= |
| 2 | +# MyBMAD Dashboard — Environment Variables |
| 3 | +# ============================================================================= |
| 4 | +# Copy this file to .env and fill in your values: |
| 5 | +# cp .env.example .env |
| 6 | +# |
| 7 | +# Or use the setup script to auto-generate secrets: |
| 8 | +# bash scripts/setup.sh |
| 9 | +# |
| 10 | +# Never commit .env or .env.local to version control. |
| 11 | +# ============================================================================= |
| 12 | + |
| 13 | +# --- Database --- |
| 14 | +# PostgreSQL connection string. |
| 15 | +# If using the included docker-compose.yml, the default below works out of the box. |
| 16 | +# Format: postgresql://<user>:<password>@<host>:<port>/<database> |
| 17 | +DATABASE_URL=postgresql://bmad:bmad_dev_password@localhost:5433/bmad_dashboard |
| 18 | + |
| 19 | +# --- Authentication (Better Auth) --- |
| 20 | +# Random secret used to sign session tokens. Must be a long random string. |
| 21 | +# Generate with: openssl rand -base64 32 |
| 22 | +BETTER_AUTH_SECRET= |
| 23 | + |
| 24 | +# Base URL where the app is running. |
| 25 | +# For local development, use http://localhost:3000 |
| 26 | +BETTER_AUTH_URL=http://localhost:3000 |
| 27 | + |
| 28 | +# --- Registration Control --- |
| 29 | +# Allow new users to sign up via email/password (default: false). |
| 30 | +# For first deployment: set to true, create your account, then disable. |
| 31 | +# Or use: pnpm db:create-admin --email admin@example.com --password secret --name Admin |
| 32 | +# ALLOW_REGISTRATION=true |
| 33 | + |
| 34 | +# --- Local Filesystem (self-hosted only) --- |
| 35 | +# Enable local folder imports. Only works when the Next.js server runs on the |
| 36 | +# same machine as the user's files (self-hosted deployment). |
| 37 | +# ENABLE_LOCAL_FS=true |
| 38 | + |
| 39 | +# --- GitHub OAuth App (optional — omit to disable GitHub login) --- |
| 40 | +# Required for "Login with GitHub". Create an OAuth App at: |
| 41 | +# https://github.com/settings/developers → "New OAuth App" |
| 42 | +# |
| 43 | +# Application name: MyBMAD (or anything you like) |
| 44 | +# Homepage URL: http://localhost:3000 |
| 45 | +# Authorization callback: http://localhost:3000/api/auth/callback/github |
| 46 | +# |
| 47 | +# After creating the app, copy the Client ID and generate a Client Secret. |
| 48 | +GITHUB_CLIENT_ID= |
| 49 | +GITHUB_CLIENT_SECRET= |
| 50 | + |
| 51 | +# --- GitHub Personal Access Token (optional) --- |
| 52 | +# Without a PAT, GitHub API allows 60 requests/hour. |
| 53 | +# With a PAT, you get 5,000 requests/hour — highly recommended. |
| 54 | +# |
| 55 | +# Create one at: https://github.com/settings/tokens → "Generate new token (classic)" |
| 56 | +# Required scopes: |
| 57 | +# - "public_repo" for public repositories only |
| 58 | +# - "repo" for private repositories |
| 59 | +GITHUB_PAT= |
| 60 | + |
| 61 | +# --- Cache Revalidation --- |
| 62 | +# Random secret to protect the /api/revalidate endpoint. |
| 63 | +# Generate with: openssl rand -hex 32 |
| 64 | +REVALIDATE_SECRET= |
| 65 | + |
| 66 | +# --- Session (optional, defaults shown) --- |
| 67 | +# SESSION_EXPIRES_IN=604800 # 7 days in seconds |
| 68 | +# SESSION_UPDATE_AGE=86400 # 1 day in seconds |
| 69 | + |
| 70 | +# ============================================================================= |
| 71 | +# PRODUCTION DEPLOYMENT (docker/docker-compose.prod.yml) |
| 72 | +# ============================================================================= |
| 73 | +# In production, TWO environment files are used: |
| 74 | +# |
| 75 | +# .env — Docker Compose interpolation (parse time) |
| 76 | +# Variables used by Docker Compose: DOMAIN, ACME_EMAIL, POSTGRES_* |
| 77 | +# |
| 78 | +# .env.local — Runtime variables injected into the Next.js container |
| 79 | +# Contains: BETTER_AUTH_SECRET, BETTER_AUTH_URL, GITHUB_CLIENT_ID, |
| 80 | +# GITHUB_CLIENT_SECRET, DATABASE_URL (production) |
| 81 | +# (Copy the top variables from this file into .env.local with production values) |
| 82 | +# ============================================================================= |
| 83 | + |
| 84 | +# Domain for Traefik routing and Let's Encrypt certificates |
| 85 | +# DOMAIN=yourdomain.example.com |
| 86 | + |
| 87 | +# Email for Let's Encrypt certificate notifications |
| 88 | +# ACME_EMAIL=admin@example.com |
| 89 | + |
| 90 | +# PostgreSQL credentials (used by both the postgres service AND DATABASE_URL) |
| 91 | +# POSTGRES_DB=bmad_dashboard |
| 92 | +# POSTGRES_USER=bmad |
| 93 | +# POSTGRES_PASSWORD=change_me_in_production |
| 94 | + |
| 95 | +# Production DATABASE_URL (uses internal Docker network, port 5432) |
| 96 | +# DATABASE_URL=postgresql://bmad:change_me_in_production@postgres:5432/bmad_dashboard |
| 97 | + |
| 98 | +# BETTER_AUTH_URL must match your production domain |
| 99 | +# BETTER_AUTH_URL=https://yourdomain.example.com |
0 commit comments