import os
from dotenv import load_dotenv

load_dotenv()

class Config:
    SECRET_KEY = os.getenv('SECRET_KEY', 'dev-secret-key')
    UPLOAD_FOLDER = 'uploads'
    MAX_CONTENT_LENGTH = 16 * 1024 * 1024  # 16MB max file size
    
    # OCR配置
    TESSERACT_PATH = os.getenv('TESSERACT_PATH', '')
    
    # 数据库配置
    DATABASE_URI = os.getenv('DATABASE_URI', 'sqlite:///data.db')
    
    # 网页抓取配置
    USER_AGENT = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36'
    
    # 支持的文件类型
    ALLOWED_EXTENSIONS = {
        'pdf', 'txt', 'doc', 'docx',
        'jpg', 'jpeg', 'png', 'gif', 'bmp',
        'xlsx', 'xls', 'csv', 'json',
        'db', 'sqlite'
    }