-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathenv.sample
More file actions
365 lines (312 loc) · 13.9 KB
/
Copy pathenv.sample
File metadata and controls
365 lines (312 loc) · 13.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# DevMind Environment Configuration File
# ====================================
# This is a sample environment configuration file for the DevMind project.
# Copy this file to .env and modify the values according to your environment.
# Do not commit the .env file to version control.
# ============================================================================
# ⚠️ IMPORTANT: Boolean Value Convention
# ============================================================================
# All boolean environment variables MUST use lowercase "true" or "false"
#
# ✅ Correct: DJANGO_DEBUG=true, CORS_ALLOW_ALL_ORIGINS=false
# ❌ Incorrect: DJANGO_DEBUG=True, CORS_ALLOW_ALL_ORIGINS=1, USE_MIRROR=yes
#
# Reason: Ensures consistent behavior across Shell scripts and Python code.
# Only "true" and "false" (lowercase) are accepted as valid boolean values.
# ============================================================================
# ============================================================================
# Django Configuration
# ============================================================================
SECRET_KEY="t=_0ah$18mgana9zi$i$5%(6wbvxc-&*zh4e_j2_@l58l)==0+"
DJANGO_DEBUG=false
ALLOWED_HOSTS=localhost,127.0.0.1
CSRF_TRUSTED_ORIGINS='http://localhost:8000,http://127.0.0.1:8000'
CORS_ALLOW_ALL_ORIGINS=false
CORS_ALLOWED_ORIGINS='http://localhost:3000,http://127.0.0.1:3000'
DJANGO_LOG_LEVEL=INFO
# ============================================================================
# Deployment / Frontend Build Configuration
# ============================================================================
# Production image tag used by docker-compose.yml.
# Required when running the production compose stack.
APP_VERSION=1.0.0
# Backend init static collection.
# Set to false when staticfiles are already collected in the mounted volume.
BACKEND_INIT_COLLECTSTATIC=true
# Frontend runtime/build configuration
VITE_API_BASE_URL=http://localhost:8000
VITE_APP_TITLE=DevMind
VITE_APP_VERSION=1.0.0
VITE_API_TIMEOUT=30000
# Default admin user configuration
# Created only when running docker/create-superuser.sh or
# python manage.py create_default_superuser.
DJANGO_SUPERUSER_USERNAME=admin
DJANGO_SUPERUSER_EMAIL=admin@example.com
# Password can contain special characters like $, (, ), etc.
# For passwords with special characters, use double quotes to prevent shell interpretation
# Example: DJANGO_SUPERUSER_PASSWORD="MyPass123($$)"
DJANGO_SUPERUSER_PASSWORD=adminpassword
# ============================================================================
# Database Configuration
# ============================================================================
# Option 1: SQLite (Recommended for development)
DB_ENGINE=sqlite
SQLITE_PATH=db.sqlite3
# Option 2: MySQL
# DB_ENGINE=mysql
# MYSQL_USER=username
# MYSQL_PASSWORD=password
# MYSQL_HOST=localhost
# MYSQL_PORT=3306
# MYSQL_DATABASE=db
# MYSQL_ROOT_PASSWORD=rootpassword
# Option 3: PostgreSQL
# Note: PostgreSQL does NOT have a "root" user like MySQL/MariaDB
# - Default superuser is "postgres" (equivalent to MySQL's "root")
# - POSTGRES_USER: Superuser name (default: "postgres")
# - POSTGRES_PASSWORD: Superuser password (REQUIRED - like MYSQL_ROOT_PASSWORD)
# - POSTGRES_HOST: Use "postgresql" in Docker, "localhost" for local
# - POSTGRES_PORT: Default is 5432
# - POSTGRES_DB: Initial database name
# DB_ENGINE=postgresql
# POSTGRES_USER=postgres
# POSTGRES_PASSWORD=your_secure_password
# POSTGRES_HOST=postgresql
# POSTGRES_PORT=5432
# POSTGRES_DB=devmind
# Option 4: Direct DATABASE_URL (overrides DB_ENGINE settings)
# DATABASE_URL=sqlite:///db.sqlite3
# DATABASE_URL=mysql://user:password@host:port/database
# DATABASE_URL=postgresql://user:password@host:port/database
# Celery Configuration
# =====================
# Celery Broker URL for task queue
CELERY_BROKER_URL=redis://redis:6379/0
# Celery Result Backend
CELERY_RESULT_BACKEND=redis://redis:6379/0
# Celery Log Level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
CELERY_LOG_LEVEL=INFO
# Celery Worker Concurrency
# Number of concurrent worker processes/threads
# For I/O-bound tasks (network requests, file operations), higher concurrency is beneficial
# Default: number of CPU cores (auto-detected)
# Recommended: 2-4x CPU count for I/O-bound tasks, 1x CPU count for CPU-bound tasks
# Example: CELERY_CONCURRENCY=8 (for 4-core CPU with I/O-bound tasks)
CELERY_CONCURRENCY=
# Celery Worker Prefetch Multiplier
# Controls how many messages are prefetched by each concurrent worker process
# For long-running tasks (like article collection), set to 1 for fair distribution
# For short-running tasks, higher values (4-10) can improve throughput
# Default: 1 (optimized for long-running I/O-bound tasks)
CELERY_WORKER_PREFETCH_MULTIPLIER=1
# Celery Max Tasks Per Child
# Maximum number of tasks a worker process can execute before being replaced
# Helps mitigate memory leaks in long-running workers
# Default: 1000
CELERY_MAX_TASKS_PER_CHILD=1000
# Celery Max Memory Per Child (in KB)
# Maximum resident memory a worker process can consume before being replaced
# Default: 256000 (256 MB)
CELERY_MAX_MEMORY_PER_CHILD=256000
# ============================================================================
# Cache Configuration
# ============================================================================
CACHE_BACKEND=redis
# CACHE_BACKEND options: redis, memcached, database, locmem
# CACHE_REDIS_URL=redis://redis:6379/1 # Optional: dedicated cache Redis URL
DEVMIND_CACHE_PATH=/var/cache/devmind
# ============================================================================
# Storage Configuration
# ============================================================================
# Unified persistent storage root (container path). One volume for all modules.
# data_collector attachments: DATA_COLLECTOR_ROOT/raw_data/{uuid}/
STORAGE_ROOT=/opt/storage
DATA_COLLECTOR_ROOT=/opt/storage/data_collector
# Proxy Configuration
# =====================
# HTTP proxy
HTTP_PROXY=http://proxy.example.com:8080
# HTTPS proxy
HTTPS_PROXY=http://proxy.example.com:8080
# ============================================================================
# Exchange Rate Configuration
# ============================================================================
# Used by the operations dashboard to convert USD-based cost into CNY.
# Apply for an API key at https://www.exchangerate-api.com/ and keep it in .env.
# Exchange rates are cached for 1 hour server-side.
EXCHANGE_RATE_API_KEY=
# Timeout in seconds for exchange rate fetch requests
EXCHANGE_RATE_API_TIMEOUT=10
# ============================================================================
# Accounts & Authentication Configuration
# ============================================================================
# Email backend for notifications
# smtp: production, console: development (prints to terminal)
EMAIL_BACKEND=django.core.mail.backends.smtp.EmailBackend
# SMTP server settings (for sending notification emails)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_HOST_USER=your-email@example.com
EMAIL_HOST_PASSWORD=your-app-password
EMAIL_USE_TLS=true
EMAIL_USE_SSL=false
DEFAULT_FROM_EMAIL=noreply@devmind.local
# Django Site Configuration (Required for OAuth)
# The domain where your application is hosted
# Development: localhost:8000 or 127.0.0.1:8000
# Production: yourdomain.com or your-ip:port
SITE_DOMAIN=localhost:8000
SITE_NAME=DevMind
# OAuth Protocol Configuration
# Development: 'http' (default), Production: 'https'
# Ensures OAuth callback URLs use the correct protocol
ACCOUNT_DEFAULT_HTTP_PROTOCOL=http
# Registration token expiry time in hours
REGISTRATION_TOKEN_EXPIRY_HOURS=24
# Password reset token validity (in seconds)
# Django default is 3 days (259200 seconds)
# We set it to 1 day (86400 seconds) for better security
PASSWORD_RESET_TIMEOUT=86400
# Frontend URL (for OAuth redirects and email links)
FRONTEND_URL=http://localhost:3000
# Google OAuth Configuration
# Set redirect URI in Google Cloud Console to:
# http://localhost:8000/accounts/google/login/callback/
GOOGLE_OAUTH_CLIENT_ID=your_google_client_id
GOOGLE_OAUTH_CLIENT_SECRET=your_google_client_secret
# ============================================================================
# AI Services Configuration (LLM)
# ============================================================================
# LLM Provider Selection
# Options: 'openai' or 'azure_openai' (default: 'azure_openai')
LLM_PROVIDER=azure_openai
# OpenAI Configuration (when LLM_PROVIDER=openai)
# =====================
# API base URL for OpenAI
# Default: https://api.openai.com/v1/
# For custom endpoints or proxies, change this value
OPENAI_API_BASE=https://api.openai.com/v1/
# API key for authentication
# Security: Never commit this to version control
# How to get: OpenAI Platform → API Keys
OPENAI_API_KEY=your_openai_api_key
# Model name to use
# Examples: 'gpt-4', 'gpt-4-turbo', 'gpt-3.5-turbo', 'gpt-4o', 'gpt-4o-mini', 'gpt-5-nano'
# Default: gpt-5-nano (cost-effective)
OPENAI_MODEL=gpt-5-nano
# Maximum tokens for LLM response
# Range: 1-128000 (varies by model, e.g., gpt-5-nano supports up to 128k)
# Default: 60000 (increased for reasoning models)
# Note: Reasoning models need extra tokens for reasoning + output
OPENAI_MAX_TOKENS=60000
# Temperature for response randomness
# Range: 0.0-2.0
# Default: 0.7 (balanced)
# 0.0: Deterministic, consistent responses
# 2.0: Creative, varied responses
OPENAI_TEMPERATURE=0.7
# Azure OpenAI Configuration (when LLM_PROVIDER=azure_openai)
# =====================
# API base URL from Azure OpenAI resource
# Format: https://{your-resource-name}.openai.azure.com/
AZURE_OPENAI_API_BASE=https://your-openai-endpoint.openai.azure.com/
# API key for authentication
# Security: Never commit this to version control
# How to get: Azure Portal → OpenAI Resource → Keys and Endpoint
AZURE_OPENAI_API_KEY=your-azure-openai-api-key
# Deployment name created in Azure OpenAI Studio
# Example: 'gpt-4', 'gpt-35-turbo', 'gpt-4o', 'gpt-4o-mini', 'gpt-5-nano'
# Default: gpt-5-nano (cost-effective)
AZURE_OPENAI_DEPLOYMENT=gpt-5-nano
# API version for Azure OpenAI service
# Format: YYYY-MM-DD (e.g., '2024-10-01-preview')
AZURE_OPENAI_API_VERSION=2024-10-01-preview
# Maximum tokens for LLM response
# Range: 1-4096 (varies by model)
# Default: 4000
AZURE_OPENAI_MAX_TOKENS=12000
# Temperature for response randomness
# Range: 0.0-2.0 (for most models)
# Default: 0.7 (balanced)
# 0.0: Deterministic, consistent responses
# 2.0: Creative, varied responses
AZURE_OPENAI_TEMPERATURE=0.7
# LLM output language preference
# Examples: 'English', 'Chinese', 'Spanish', 'French'
# Default: English
LLM_OUTPUT_LANGUAGE=English
# ============================================================================
# Nginx Port Configuration
# ============================================================================
# HTTP port for nginx (default: 10080)
# Example: NGINX_HTTP_PORT=80 (for standard HTTP)
NGINX_HTTP_PORT=10080
# HTTPS port for nginx (default: 10443)
# Example: NGINX_HTTPS_PORT=443 (for standard HTTPS)
NGINX_HTTPS_PORT=10443
# Notes:
# 1. For development, use the default SQLite configuration
# 2. For production, uncomment and configure the PostgreSQL or MySQL DATABASE_URL
# 3. PostgreSQL Docker configuration is used in docker-compose.yaml
# 4. PostgreSQL user system:
# - No "root" user (unlike MySQL/MariaDB)
# - Default superuser is "postgres" (equivalent to MySQL's "root")
# - POSTGRES_USER sets the superuser name (default: "postgres")
# - POSTGRES_PASSWORD is REQUIRED for the superuser (like MYSQL_ROOT_PASSWORD)
# 5. Make sure to use strong passwords and secure keys in production
# 6. Do not commit sensitive information (keys, passwords, etc.) to version control
# 7. It's recommended to use different configuration files for different environments
# (development, testing, production)
# 8. Port configuration: Set NGINX_HTTP_PORT and NGINX_HTTPS_PORT in .env file
# to expose nginx on different ports. Defaults are 10080 (HTTP) and 10443 (HTTPS)
# ============================================================================
# Feishu Approval Integration
# ============================================================================
# Required for recharge approval sync / submission flows.
FEISHU_APP_ID=
FEISHU_APP_SECRET=
FEISHU_APPROVAL_CODE=
# Optional Feishu endpoints / verification / user resolution
FEISHU_APPROVAL_BASE_URL=https://www.feishu.cn
FEISHU_AUTH_BASE_URL=https://open.feishu.cn
FEISHU_CALLBACK_VERIFICATION_TOKEN=
FEISHU_USER_ID=
FEISHU_USER_IDENTIFIER=
# ============================================================================
# Cloud Billing Alert Configuration
# ============================================================================
# Minimum cost threshold for sending cost/growth alerts.
# Alerts will only be sent when the current cost exceeds this value.
# Set to 0 to disable this check (default: 0).
# Example: CLOUD_BILLING_ALERT_MIN_COST_THRESHOLD=100
CLOUD_BILLING_ALERT_MIN_COST_THRESHOLD=0
# ============================================================================
# Langfuse Observability
# ============================================================================
# Enable Langfuse tracing for agent runs.
LANGFUSE_ENABLED=false
LANGFUSE_PUBLIC_KEY=
LANGFUSE_SECRET_KEY=
LANGFUSE_BASE_URL=http://localhost:3000
LANGFUSE_SAMPLE_RATE=1.0
LANGFUSE_TIMEOUT=10
# ============================================================================
# Sentry Error Tracking
# ============================================================================
# Enable Sentry error tracking.
SENTRY_ENABLED=false
# Sentry DSN (Data Source Name). Get from Sentry project settings.
SENTRY_DSN=
# Environment name (production, staging, development).
SENTRY_ENVIRONMENT=production
# Release version (typically git commit hash).
SENTRY_RELEASE=
# Sample rate for tracing (0.0 to 1.0, default: 0.1).
SENTRY_TRACES_SAMPLE_RATE=0.1
# Sample rate for profiling (0.0 to 1.0, default: 0.05).
SENTRY_PROFILING_SAMPLE_RATE=0.05
# Include personal identifiable information in errors.
SENTRY_SEND_DEFAULT_PII=false
# Request timeout in seconds.
SENTRY_TIMEOUT=5