- Add DEPLOYMENT.md for 1Panel deployment guide with troubleshooting - Add README.md with project architecture and quick start guide - Update .gitignore to exclude development docs (openspec/, CLAUDE.md, etc.) - Unify port configuration via .env (BACKEND_PORT, FRONTEND_PORT, MINIO_API_PORT, MINIO_CONSOLE_PORT) - Update start-dev.sh and check-env.sh to read ports from .env 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
173 lines
6.9 KiB
Plaintext
173 lines
6.9 KiB
Plaintext
# =============================================================================
|
|
# Task Reporter - Backend Environment Configuration
|
|
# =============================================================================
|
|
# Copy this file to .env and fill in the required values.
|
|
# Required fields are marked with (Required), optional fields have defaults.
|
|
# =============================================================================
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Database Configuration
|
|
# -----------------------------------------------------------------------------
|
|
# (Required) MySQL database connection string
|
|
# Format: mysql+pymysql://user:password@host:port/database?charset=utf8mb4
|
|
# Note: All tables use 'tr_' prefix to avoid conflicts in shared database
|
|
DATABASE_URL=mysql+pymysql://user:password@localhost:3306/task_reporter?charset=utf8mb4
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Database Connection Pool Settings
|
|
# -----------------------------------------------------------------------------
|
|
# These settings control the SQLAlchemy connection pool for production scalability.
|
|
# Adjust based on expected concurrent users and MySQL max_connections setting.
|
|
|
|
# Number of persistent connections in the pool (default: 20)
|
|
DB_POOL_SIZE=20
|
|
|
|
# Maximum additional connections beyond pool_size when pool is exhausted (default: 30)
|
|
# Total max connections = DB_POOL_SIZE + DB_MAX_OVERFLOW = 50
|
|
DB_MAX_OVERFLOW=30
|
|
|
|
# Seconds to wait for an available connection before timeout error (default: 10)
|
|
DB_POOL_TIMEOUT=10
|
|
|
|
# Recycle connections after this many seconds to prevent stale connections (default: 1800 = 30 min)
|
|
DB_POOL_RECYCLE=1800
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Security Configuration
|
|
# -----------------------------------------------------------------------------
|
|
# (Required) Fernet encryption key for session token encryption
|
|
# Generate with: python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
|
|
FERNET_KEY=
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Server Configuration
|
|
# -----------------------------------------------------------------------------
|
|
# Server bind address (default: 0.0.0.0)
|
|
HOST=0.0.0.0
|
|
|
|
# Server port (default: 8000)
|
|
PORT=8000
|
|
|
|
# Debug mode - set to False in production (default: False)
|
|
DEBUG=True
|
|
|
|
# Log level: DEBUG, INFO, WARNING, ERROR, CRITICAL (default: INFO)
|
|
LOG_LEVEL=INFO
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# CORS Configuration
|
|
# -----------------------------------------------------------------------------
|
|
# (Required for production) Comma-separated list of allowed CORS origins
|
|
# Example: http://localhost:3000,https://your-domain.com
|
|
# WARNING: Never use "*" in production - always specify allowed origins
|
|
CORS_ORIGINS=http://localhost:3000
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# System Administration
|
|
# -----------------------------------------------------------------------------
|
|
# System administrator email with special permissions (bypass room membership checks)
|
|
# Leave empty if no system admin is needed
|
|
SYSTEM_ADMIN_EMAIL=
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# AD Authentication API
|
|
# -----------------------------------------------------------------------------
|
|
# (Required) Active Directory authentication API URL
|
|
AD_API_URL=https://pj-auth-api.vercel.app/api/auth/login
|
|
|
|
# AD API request timeout in seconds (default: 10)
|
|
AD_API_TIMEOUT_SECONDS=10
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Session Settings
|
|
# -----------------------------------------------------------------------------
|
|
# Session inactivity timeout in days (default: 3)
|
|
SESSION_INACTIVITY_DAYS=3
|
|
|
|
# Token refresh threshold in minutes (default: 5)
|
|
TOKEN_REFRESH_THRESHOLD_MINUTES=5
|
|
|
|
# Maximum token refresh attempts (default: 3)
|
|
MAX_REFRESH_ATTEMPTS=3
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Realtime Messaging Settings
|
|
# -----------------------------------------------------------------------------
|
|
# Message edit time limit in minutes - users can edit messages within this window (default: 15)
|
|
MESSAGE_EDIT_TIME_LIMIT_MINUTES=15
|
|
|
|
# Typing indicator timeout in seconds (default: 3)
|
|
TYPING_TIMEOUT_SECONDS=3
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# File Upload Limits
|
|
# -----------------------------------------------------------------------------
|
|
# Maximum image file size in MB (default: 10)
|
|
IMAGE_MAX_SIZE_MB=10
|
|
|
|
# Maximum document file size in MB (default: 20)
|
|
DOCUMENT_MAX_SIZE_MB=20
|
|
|
|
# Maximum log file size in MB (default: 5)
|
|
LOG_MAX_SIZE_MB=5
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# MinIO Object Storage Configuration
|
|
# -----------------------------------------------------------------------------
|
|
# MinIO server endpoint (default: localhost:9000)
|
|
MINIO_ENDPOINT=localhost:9000
|
|
|
|
# MinIO access key (default: minioadmin)
|
|
# IMPORTANT: Change this in production!
|
|
MINIO_ACCESS_KEY=minioadmin
|
|
|
|
# MinIO secret key (default: minioadmin)
|
|
# IMPORTANT: Change this in production!
|
|
MINIO_SECRET_KEY=minioadmin
|
|
|
|
# MinIO bucket name (default: task-reporter-files)
|
|
MINIO_BUCKET=task-reporter-files
|
|
|
|
# Use HTTPS for MinIO connection (default: false)
|
|
# Set to true in production with proper TLS configuration
|
|
MINIO_SECURE=false
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# DIFY AI Service Configuration
|
|
# -----------------------------------------------------------------------------
|
|
# DIFY API base URL for AI-powered report generation
|
|
DIFY_BASE_URL=https://dify.theaken.com/v1
|
|
|
|
# (Required for AI reports) DIFY API key - get from DIFY console
|
|
DIFY_API_KEY=
|
|
|
|
# DIFY API request timeout in seconds - AI generation can be slow (default: 120)
|
|
DIFY_TIMEOUT_SECONDS=120
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Report Generation Settings
|
|
# -----------------------------------------------------------------------------
|
|
# Maximum messages to include in report before summarization (default: 200)
|
|
REPORT_MAX_MESSAGES=200
|
|
|
|
# MinIO path prefix for generated reports (default: reports)
|
|
REPORT_STORAGE_PATH=reports
|
|
|
|
# -----------------------------------------------------------------------------
|
|
# Development Scripts Port Configuration
|
|
# -----------------------------------------------------------------------------
|
|
# These ports are used by start-dev.sh, start-prod.sh, and check-env.sh scripts.
|
|
# They should match the actual service ports configured above.
|
|
|
|
# Backend API port for scripts (default: 8000, should match PORT above)
|
|
BACKEND_PORT=8000
|
|
|
|
# Frontend development server port (default: 3000)
|
|
FRONTEND_PORT=3000
|
|
|
|
# MinIO S3 API port for Docker container (default: 9000)
|
|
MINIO_API_PORT=9000
|
|
|
|
# MinIO Web Console port for Docker container (default: 9001)
|
|
MINIO_CONSOLE_PORT=9001
|