Skip to content

Commit 0196ef4

Browse files
committed
refactor: Organize and enhance .env.example structure and comments
1 parent 0297342 commit 0196ef4

1 file changed

Lines changed: 85 additions & 50 deletions

File tree

.env.example

Lines changed: 85 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,61 +3,77 @@
33
# ==============================================================================
44
# Documentation: https://docs.bugsink.com/
55

6-
# -- Common Settings --
6+
# ==============================================================================
7+
# BASIC SETTINGS
8+
# ==============================================================================
9+
10+
# -- Stack Identity --
711
STACK_NAME=error-observability_app_example_com
812
BUGSINK_VERSION=2
9-
10-
TIME_ZONE=UTC
11-
# -- Site Configuration --
12-
# Customize your Bugsink instance name
1313
SITE_TITLE=Error Observability [COMPANY NAME]
14+
TIME_ZONE=UTC
1415

15-
# -- Database Settings --
16-
# PostgreSQL 18 with SSD/NVMe tuning
17-
POSTGRES_VERSION=18
18-
DATABASE_POOLMAXSIZE=100
19-
DATABASE_PASSWORD=CHANGE_ME_SECURE_PASSWORD
16+
# -- Security Secrets --
17+
# Generate with: openssl rand -base64 50
18+
SECRET_KEY=GENERATE_WITH_openssl_rand_base64_50
19+
20+
# ==============================================================================
21+
# NETWORK & PROXY
22+
# ==============================================================================
2023

21-
# -- Network Settings --
24+
# -- Hostname --
25+
# DNS must resolve to this hostname
26+
SERVICE_HOSTNAME=error-observability.app.example.com
27+
28+
# -- Docker Network --
2229
# Unique subnet ID (1-254) to avoid conflicts with other stacks
2330
PRIVATESUBNET=252
31+
PROXY_NETWORK=traefik
2432

25-
# -- Development Settings --
33+
# -- Development --
2634
# Server port for local development (default: 8000)
2735
DEV_SERVER_PORT=8000
2836

29-
# -- Traefik Proxy Settings --
30-
# DNS must resolve to ${SERVICE_HOSTNAME}
31-
SERVICE_HOSTNAME=error-observability.app.example.com
32-
PROXY_NETWORK=traefik
37+
# ==============================================================================
38+
# DATABASE
39+
# ==============================================================================
3340

34-
# -- Application Secrets --
35-
# Generate with: openssl rand -base64 50
36-
SECRET_KEY=GENERATE_WITH_openssl_rand_base64_50
41+
# PostgreSQL configuration
42+
POSTGRES_VERSION=18
43+
DATABASE_POOLMAXSIZE=100
44+
DATABASE_PASSWORD=CHANGE_ME_SECURE_PASSWORD
45+
46+
# ==============================================================================
47+
# AUTHENTICATION & USERS
48+
# ==============================================================================
3749

3850
# -- Initial Admin User --
3951
# Format: email:password
40-
# Remove this variable after first start for security
52+
# IMPORTANT: Remove this variable after first start for security!
4153
CREATE_SUPERUSER=admin@example.com:CHANGE_ME_SECURE_PASSWORD
4254

43-
# -- User Registration & Permissions --
44-
# SINGLE_USER=true -> Disable all multi-user functionality
45-
# SINGLE_TEAM=true -> All users share one team
55+
# -- User Mode --
56+
# SINGLE_USER=true -> Disable all multi-user functionality
57+
# SINGLE_TEAM=true -> All users share one team
4658
SINGLE_USER=false
4759
SINGLE_TEAM=false
4860

49-
# USER_REGISTRATION options:
50-
# CB_ANYBODY -> Anyone can sign up (dangerous on public internet!)
51-
# CB_MEMBERS -> Any existing user can invite new users
52-
# CB_ADMINS -> Only admins can invite new users
53-
# CB_NOBODY -> User registration disabled entirely
61+
# -- User Registration --
62+
# Options: CB_ANYBODY -> Anyone can sign up (dangerous on public internet!)
63+
# CB_MEMBERS -> Any existing user can invite new users
64+
# CB_ADMINS -> Only admins can invite new users
65+
# CB_NOBODY -> User registration disabled entirely
5466
USER_REGISTRATION=CB_ADMINS
5567
USER_REGISTRATION_VERIFY_EMAIL=true
5668

57-
# TEAM_CREATION options: CB_MEMBERS, CB_ADMINS, CB_NOBODY
69+
# -- Team Creation --
70+
# Options: CB_MEMBERS, CB_ADMINS, CB_NOBODY
5871
TEAM_CREATION=CB_ADMINS
5972

60-
# -- SMTP Settings --
73+
# ==============================================================================
74+
# EMAIL / SMTP
75+
# ==============================================================================
76+
6177
# Required for notifications and password reset emails
6278
EMAIL_HOST=smtp.example.com
6379
EMAIL_PORT=587
@@ -69,23 +85,27 @@ EMAIL_TIMEOUT=5
6985
DEFAULT_FROM_EMAIL=Error Observability <error-observability@example.com>
7086
EMAIL_LOGGING=false
7187

72-
# -- Rate Limits & Maximums --
73-
# Tuned for multi-project instance (~100 projects)
88+
# ==============================================================================
89+
# RATE LIMITS & EVENT PROCESSING
90+
# ==============================================================================
91+
92+
# -- Rate Limits --
7493
# These are PER PROJECT limits, not global!
7594
#
7695
# Sizing guide:
7796
# Small (1-10 projects): 1000/5min, 5000/hour
7897
# Medium (10-50 projects): 2500/5min, 15000/hour
7998
# Large (50-200 projects): 2500/5min, 15000/hour (current)
8099
# XLarge (200+ projects): 1500/5min, 10000/hour (reduce per-project)
81-
#
100+
MAX_EVENTS_PER_PROJECT_PER_5_MINUTES=2500
101+
MAX_EVENTS_PER_PROJECT_PER_HOUR=15000
102+
# MAX_EMAILS_PER_MONTH=50000
103+
104+
# -- Event Size Limits --
82105
# Values in bytes: 1MB=1048576, 2MB=2097152, 20MB=20971520, 100MB=104857600
83106
MAX_EVENT_SIZE=2097152
84107
MAX_ENVELOPE_SIZE=104857600
85108
MAX_ENVELOPE_COMPRESSED_SIZE=20971520
86-
MAX_EVENTS_PER_PROJECT_PER_5_MINUTES=2500
87-
MAX_EVENTS_PER_PROJECT_PER_HOUR=15000
88-
# MAX_EMAILS_PER_MONTH=50000
89109

90110
# -- Background Worker --
91111
# TASK_ALWAYS_EAGER=true -> Process inline (dev only)
@@ -94,27 +114,42 @@ MAX_EVENTS_PER_PROJECT_PER_HOUR=15000
94114
TASK_ALWAYS_EAGER=false
95115
SNAPPEA_NUM_WORKERS=4
96116

97-
# -- Privacy & Debugging --
117+
# ==============================================================================
118+
# PRIVACY & DEBUGGING
119+
# ==============================================================================
120+
98121
# Disable telemetry to bugsink.com
99122
PHONEHOME=false
100123
DEBUG=false
101124

125+
# ==============================================================================
126+
# QUICK START GUIDE
127+
# ==============================================================================
128+
#
129+
# 1. Copy this file to .env:
130+
# cp .env.example .env
102131
#
103-
# URLs
104-
# =====
105-
# Application -> https://error-observability.app.example.com
132+
# 2. Update all CHANGE_ME values:
133+
# - DATABASE_PASSWORD
134+
# - SECRET_KEY (generate with: openssl rand -base64 50)
135+
# - CREATE_SUPERUSER
136+
# - EMAIL_HOST_PASSWORD
106137
#
107-
# Quick Start
108-
# ===========
109-
# 1. Copy this file to .env: cp .env.example .env
110-
# 2. Update all CHANGE_ME values
111-
# 3. Generate SECRET_KEY: openssl rand -base64 50
112-
# 4. Adjust SERVICE_HOSTNAME and PRIVATESUBNET
113-
# 5. Start: docker compose up -d
114-
# 6. Remove CREATE_SUPERUSER from .env after first login
138+
# 3. Adjust network settings:
139+
# - SERVICE_HOSTNAME
140+
# - PRIVATESUBNET
141+
#
142+
# 4. Start the stack:
143+
# docker compose up -d
144+
#
145+
# 5. Remove CREATE_SUPERUSER from .env after first login!
146+
#
147+
# ==============================================================================
148+
# SENTRY SDK INTEGRATION
149+
# ==============================================================================
115150
#
116-
# Sentry SDK Integration
117-
# ======================
118151
# DSN Format: https://<project-key>@<hostname>/<project-id>
119152
# Example: https://abc123@error-observability.app.example.com/1
120153
#
154+
# Application URL: https://error-observability.app.example.com
155+
#

0 commit comments

Comments
 (0)