Files
OCR/.env.example
egg d7f7166a2d feat: unify environment scripts with start.sh
- Add unified start.sh script with subcommands (all/backend/frontend)
- Add process management (--stop, --status)
- Remove separate start_backend.sh and start_frontend.sh
- Update setup_dev_env.sh with pre-flight checks and --cpu-only/--skip-db options
- Update .env.example to remove sensitive data and add DIFY translation config
- Add .pid/ to .gitignore for process management

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 12:48:52 +08:00

87 lines
2.3 KiB
Plaintext

# Tool_OCR - Environment Configuration Template
# Copy this file to .env.local and fill in your actual values
# ===== Database Configuration =====
MYSQL_HOST=your-mysql-host
MYSQL_PORT=3306
MYSQL_USER=your-username
MYSQL_PASSWORD=your-password
MYSQL_DATABASE=your-database
# ===== Application Configuration =====
# Server ports
BACKEND_PORT=8000
FRONTEND_PORT=5173
# Security (generate a random string for production)
SECRET_KEY=your-secret-key-here-please-change-this-to-random-string
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=1440
# ===== External Authentication Configuration =====
EXTERNAL_AUTH_API_URL=https://your-auth-api.example.com
EXTERNAL_AUTH_ENDPOINT=/api/auth/login
EXTERNAL_AUTH_TIMEOUT=30
TOKEN_REFRESH_BUFFER=300
# ===== Task Management Configuration =====
DATABASE_TABLE_PREFIX=tool_ocr_
ENABLE_TASK_HISTORY=true
TASK_RETENTION_DAYS=30
MAX_TASKS_PER_USER=1000
# ===== OCR Configuration =====
PADDLEOCR_MODEL_DIR=./models/paddleocr
OCR_LANGUAGES=ch,en,japan,korean
OCR_CONFIDENCE_THRESHOLD=0.5
MAX_OCR_WORKERS=4
# GPU Acceleration Configuration
FORCE_CPU_MODE=false
GPU_MEMORY_FRACTION=0.8
GPU_DEVICE_ID=0
# ===== File Upload Configuration =====
MAX_UPLOAD_SIZE=52428800
ALLOWED_EXTENSIONS=png,jpg,jpeg,pdf,bmp,tiff,doc,docx,ppt,pptx
UPLOAD_DIR=./uploads
TEMP_DIR=./uploads/temp
PROCESSED_DIR=./uploads/processed
IMAGES_DIR=./uploads/images
# ===== Export Configuration =====
STORAGE_DIR=./storage
MARKDOWN_DIR=./storage/markdown
JSON_DIR=./storage/json
EXPORTS_DIR=./storage/exports
# ===== PDF Generation Configuration =====
# Linux: /usr/bin/pandoc, macOS: /opt/homebrew/bin/pandoc
PANDOC_PATH=/usr/bin/pandoc
# Linux: /usr/share/fonts, macOS: /System/Library/Fonts
FONT_DIR=/usr/share/fonts
PDF_PAGE_SIZE=A4
PDF_MARGIN_TOP=20
PDF_MARGIN_BOTTOM=20
PDF_MARGIN_LEFT=20
PDF_MARGIN_RIGHT=20
# ===== Translation Configuration (DIFY API) =====
# Enable translation feature
ENABLE_TRANSLATION=true
# DIFY API endpoint
DIFY_API_URL=https://your-dify-instance.example.com
# DIFY API key (get from DIFY dashboard)
DIFY_API_KEY=your-dify-api-key
# ===== Background Tasks Configuration =====
TASK_QUEUE_TYPE=memory
# REDIS_URL=redis://localhost:6379/0
# ===== CORS Configuration =====
CORS_ORIGINS=http://localhost:5173,http://127.0.0.1:5173
# ===== Logging Configuration =====
LOG_LEVEL=INFO
LOG_FILE=./logs/app.log