mirror of
https://github.com/sligter/LandPPT.git
synced 2026-09-01 15:54:37 +08:00
452 lines
16 KiB
Bash
452 lines
16 KiB
Bash
# LandPPT Configuration Example
|
|
# Copy this file to .env and configure your settings
|
|
|
|
# =============================================================================
|
|
# AI Provider Configuration
|
|
# =============================================================================
|
|
|
|
# Default AI provider to use (openai, anthropic, google, azure_openai, ollama)
|
|
# For production use, configure one of the real AI providers
|
|
DEFAULT_AI_PROVIDER=openai
|
|
|
|
# Model role overrides (optional)
|
|
DEFAULT_MODEL_PROVIDER=
|
|
DEFAULT_MODEL_NAME=
|
|
OUTLINE_MODEL_PROVIDER=
|
|
OUTLINE_MODEL_NAME=
|
|
CREATIVE_MODEL_PROVIDER=
|
|
CREATIVE_MODEL_NAME=
|
|
IMAGE_PROMPT_MODEL_PROVIDER=
|
|
IMAGE_PROMPT_MODEL_NAME=
|
|
SLIDE_GENERATION_MODEL_PROVIDER=
|
|
SLIDE_GENERATION_MODEL_NAME=
|
|
EDITOR_ASSISTANT_MODEL_PROVIDER=
|
|
EDITOR_ASSISTANT_MODEL_NAME=
|
|
TEMPLATE_GENERATION_MODEL_PROVIDER=
|
|
TEMPLATE_GENERATION_MODEL_NAME=
|
|
POLISH_MODEL_PROVIDER=
|
|
POLISH_MODEL_NAME=
|
|
|
|
# OpenAI Configuration
|
|
# Get your API key from: https://platform.openai.com/api-keys
|
|
OPENAI_API_KEY=your_openai_api_key_here
|
|
OPENAI_MODEL=gpt-3.5-turbo
|
|
OPENAI_BASE_URL=https://api.openai.com/v1
|
|
OPENAI_USE_RESPONSES_API=false
|
|
OPENAI_ENABLE_REASONING=false
|
|
OPENAI_REASONING_EFFORT=medium
|
|
|
|
# Anthropic Configuration
|
|
# Get your API key from: https://console.anthropic.com/
|
|
ANTHROPIC_API_KEY=your_anthropic_api_key_here
|
|
ANTHROPIC_MODEL=claude-3-haiku-20240307
|
|
|
|
# Google Gemini Configuration
|
|
# Get your API key from: https://aistudio.google.com/app/apikey
|
|
GOOGLE_API_KEY=your_google_api_key_here
|
|
GOOGLE_BASE_URL=https://generativelanguage.googleapis.com
|
|
GOOGLE_MODEL=gemini-1.5-flash
|
|
|
|
# Azure OpenAI Configuration
|
|
# Set up Azure OpenAI service and get your credentials
|
|
AZURE_OPENAI_API_KEY=your_azure_openai_key_here
|
|
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
|
|
AZURE_OPENAI_DEPLOYMENT_NAME=your_deployment_name
|
|
AZURE_OPENAI_API_VERSION=2024-02-15-preview
|
|
|
|
# Ollama Configuration (for local models)
|
|
# Install Ollama from: https://ollama.ai/
|
|
# Then run: ollama pull llama2
|
|
OLLAMA_BASE_URL=http://localhost:11434
|
|
OLLAMA_MODEL=llama2
|
|
|
|
# Tavily API Configuration (for research functionality)
|
|
# Get your API key from: https://tavily.com/
|
|
TAVILY_API_KEY=your_tavily_api_key_here
|
|
# Optional custom Tavily endpoint for proxies or private gateways
|
|
# TAVILY_BASE_URL=https://gateway.example.com/tavily
|
|
TAVILY_MAX_RESULTS=10
|
|
TAVILY_SEARCH_DEPTH=advanced
|
|
# Optional: Comma-separated domains to include/exclude
|
|
# TAVILY_INCLUDE_DOMAINS=wikipedia.org,arxiv.org
|
|
# TAVILY_EXCLUDE_DOMAINS=example.com
|
|
|
|
# SearXNG Configuration (for research functionality)
|
|
# SearXNG instance host URL (e.g., http://localhost:8888 or https://searx.example.com)
|
|
SEARXNG_HOST=
|
|
SEARXNG_MAX_RESULTS=10
|
|
SEARXNG_LANGUAGE=auto
|
|
SEARXNG_TIMEOUT=30
|
|
|
|
# Research Configuration
|
|
# Available providers: tavily, searxng, both
|
|
RESEARCH_PROVIDER=tavily
|
|
# Enable deep content extraction from web pages
|
|
RESEARCH_ENABLE_CONTENT_EXTRACTION=true
|
|
# Maximum content length to extract from each page
|
|
RESEARCH_MAX_CONTENT_LENGTH=5000
|
|
# Timeout for content extraction requests (seconds)
|
|
RESEARCH_EXTRACTION_TIMEOUT=30
|
|
|
|
# PDF to PPTX Conversion Configuration
|
|
# Apryse SDK License Key for PDF to PowerPoint conversion
|
|
# Get your license key from: https://docs.apryse.com/
|
|
APRYSE_LICENSE_KEY=your_apryse_license_key_here
|
|
|
|
# SiliconFlow API Configuration (for AI image generation)
|
|
# Get your API key from: https://siliconflow.cn/
|
|
SILICONFLOW_API_KEY=your_siliconflow_api_key_here
|
|
|
|
# Pixabay API Configuration (for network image search)
|
|
# Get your API key from: https://pixabay.com/api/docs/
|
|
PIXABAY_API_KEY=your_pixabay_api_key_here
|
|
|
|
# Unsplash API Configuration (for network image search)
|
|
# Get your access key from: https://unsplash.com/developers
|
|
UNSPLASH_ACCESS_KEY=your_unsplash_access_key_here
|
|
|
|
# Pollinations API Configuration (for AI image generation)
|
|
# Docs: https://enter.pollinations.ai/api/docs#tag/genpollinationsai/GET/image/{prompt}
|
|
# Get your API key from: https://enter.pollinations.ai
|
|
POLLINATIONS_API_BASE=https://gen.pollinations.ai
|
|
POLLINATIONS_API_KEY=your_pollinations_api_key_here
|
|
# Model selection example: flux, zimage, turbo, gptimage
|
|
POLLINATIONS_MODEL=flux
|
|
# Optional defaults
|
|
POLLINATIONS_NEGATIVE_PROMPT=worst quality, blurry
|
|
POLLINATIONS_ENHANCE=false
|
|
POLLINATIONS_SAFE=false
|
|
|
|
# =============================================================================
|
|
# AI Generation Parameters
|
|
# =============================================================================
|
|
|
|
# Maximum tokens to generate (adjust based on your needs and costs)
|
|
MAX_TOKENS=8192
|
|
|
|
# Temperature for generation (0.0 = deterministic, 1.0 = creative)
|
|
TEMPERATURE=0.7
|
|
|
|
# Top-p sampling parameter (nucleus sampling)
|
|
TOP_P=1.0
|
|
|
|
# Unified timeout (seconds) for LLM API requests
|
|
LLM_TIMEOUT_SECONDS=600
|
|
|
|
# =============================================================================
|
|
# Application Configuration
|
|
# =============================================================================
|
|
|
|
# =============================================================================
|
|
# Docker Build Configuration (optional)
|
|
# =============================================================================
|
|
#
|
|
# These variables are consumed by `docker compose build` via build args (see `docker-compose*.yaml`).
|
|
# Use them when Debian apt downloads are slow/unreliable (e.g., behind a firewall or on unstable networks).
|
|
#
|
|
# Defaults (official Debian):
|
|
# APT_DEBIAN_URL=http://deb.debian.org/debian
|
|
# APT_SECURITY_URL=http://deb.debian.org/debian-security
|
|
#
|
|
# Example mirrors (Mainland China, pick one):
|
|
# APT_DEBIAN_URL=http://mirrors.aliyun.com/debian
|
|
# APT_SECURITY_URL=http://mirrors.aliyun.com/debian-security
|
|
# APT_DEBIAN_URL=http://mirrors.tuna.tsinghua.edu.cn/debian
|
|
# APT_SECURITY_URL=http://mirrors.tuna.tsinghua.edu.cn/debian-security
|
|
#
|
|
# Note: `fonts-noto-cjk` is installed in the image for consistent CJK subtitle rendering.
|
|
|
|
# Server settings
|
|
HOST=0.0.0.0
|
|
PORT=8000
|
|
DEBUG=false
|
|
RELOAD=false
|
|
WORKERS=2
|
|
# Note: when using `docker-compose.yml`, these values are passed into the container env.
|
|
|
|
# Uvicorn multi-worker watchdog (seconds). Increase if heavy background tasks (e.g. video export)
|
|
# cause workers to be considered "unresponsive" and get SIGTERM'd.
|
|
UVICORN_TIMEOUT_WORKER_HEALTHCHECK=60
|
|
|
|
# Background task liveness (Valkey multi-worker)
|
|
# If a RUNNING/PENDING task hasn't updated within this window, it is considered stale and released.
|
|
BG_TASK_STALE_SECONDS=3600
|
|
# Heartbeat interval for RUNNING tasks (updates updated_at in Valkey to prevent stale locks).
|
|
BG_TASK_HEARTBEAT_SECONDS=30
|
|
|
|
# Security settings
|
|
SECRET_KEY=your-very-secure-secret-key-change-this-in-production
|
|
ACCESS_TOKEN_EXPIRE_MINUTES=20160
|
|
|
|
# Machine-to-machine API auth (for n8n / automation)
|
|
# Option A (single key): bind one API key to one user
|
|
LANDPPT_API_KEY=
|
|
LANDPPT_API_KEY_USER=admin
|
|
# Option B (multiple keys): comma/semicolon/newline separated
|
|
# Formats: user:key or user=key (items without user bind to LANDPPT_API_KEY_USER)
|
|
# LANDPPT_API_KEYS=admin:prod-key,robot:workflow-key
|
|
LANDPPT_API_KEYS=
|
|
# Local bootstrap admin for empty databases; override or disable for production.
|
|
LANDPPT_BOOTSTRAP_ADMIN_ENABLED=true
|
|
LANDPPT_BOOTSTRAP_ADMIN_USERNAME=admin
|
|
LANDPPT_BOOTSTRAP_ADMIN_PASSWORD=admin123
|
|
# API docs are enabled by default; set to false to disable /docs, /redoc, and /openapi.json
|
|
LANDPPT_ENABLE_API_DOCS=true
|
|
# Allow passing session_id via X-Session-Id header (disabled by default; prefer API keys for automation)
|
|
LANDPPT_ALLOW_HEADER_SESSION_AUTH=false
|
|
|
|
# File upload settings
|
|
MAX_FILE_SIZE=10485760
|
|
UPLOAD_DIR=uploads
|
|
|
|
# =============================================================================
|
|
# ComfyUI Configuration (optional, for narration TTS via ComfyUI API)
|
|
# =============================================================================
|
|
|
|
# ComfyUI server base URL
|
|
COMFYUI_BASE_URL=http://127.0.0.1:8188
|
|
# Workflow JSON template path (repository-relative inside the container)
|
|
COMFYUI_TTS_WORKFLOW_PATH=tests/Qwen3-TD-TTS.json
|
|
# Max wait time (seconds) for one TTS prompt
|
|
COMFYUI_TTS_TIMEOUT_SECONDS=600
|
|
|
|
# =============================================================================
|
|
# Xiaomi Mimo Configuration (optional, for narration TTS voice design)
|
|
# =============================================================================
|
|
|
|
MIMO_API_KEY=
|
|
MIMO_BASE_URL=https://api.xiaomimimo.com/v1
|
|
MIMO_TTS_MODEL=mimo-v2.5-tts-voicedesign
|
|
MIMO_TTS_CLONE_MODEL=mimo-v2.5-tts-voiceclone
|
|
MIMO_TTS_VOICE_PROMPT=年轻、放松、语速偏快,像 Tom 猫那种俏皮又有点夸张的卡通感;说话轻快自然、有活力,吐字清楚,不要正式播音腔。
|
|
|
|
# Custom TTS API Configuration (GET endpoint: text/speaker/speed/novasr)
|
|
CUSTOM_TTS_API_URL=http://localhost:9880/
|
|
CUSTOM_TTS_API_SPEAKER=TOM女
|
|
CUSTOM_TTS_API_SPEED=1
|
|
CUSTOM_TTS_API_NOVASR=1
|
|
|
|
# =============================================================================
|
|
# Database Configuration
|
|
# =============================================================================
|
|
|
|
# SQLite (default for development)
|
|
DATABASE_URL=sqlite:///./landppt.db
|
|
|
|
# PostgreSQL (recommended for production)
|
|
# DATABASE_URL=postgresql://landppt:landppt@localhost:5432/landppt
|
|
# For Docker: DATABASE_URL is auto-generated from POSTGRES_* variables
|
|
|
|
# Startup database migrations
|
|
LANDPPT_AUTO_MIGRATE_ON_STARTUP=true
|
|
LANDPPT_AUTO_MIGRATE_FAIL_FAST=true
|
|
LANDPPT_AUTO_MIGRATE_LOCK_TIMEOUT_SECONDS=300
|
|
LANDPPT_AUTO_MIGRATE_LOCK_STALE_SECONDS=900
|
|
|
|
# Docker PostgreSQL Configuration (used by docker-compose.yml)
|
|
POSTGRES_DB=landppt
|
|
POSTGRES_USER=landppt
|
|
POSTGRES_PASSWORD=your-secure-postgres-password-here
|
|
|
|
# =============================================================================
|
|
# Cache Configuration
|
|
# =============================================================================
|
|
|
|
# Cache TTL in seconds
|
|
CACHE_TTL=3600
|
|
|
|
# Cache backend: memory (default) or valkey
|
|
CACHE_BACKEND=memory
|
|
|
|
# Valkey URL (only used when CACHE_BACKEND=valkey)
|
|
VALKEY_URL=valkey://localhost:6379
|
|
# For Docker: VALKEY_URL=valkey://valkey:6379
|
|
|
|
# Docker Valkey Configuration
|
|
VALKEY_PORT=6379
|
|
|
|
# =============================================================================
|
|
# Credits System Configuration
|
|
# =============================================================================
|
|
|
|
# Enable credits/points system
|
|
ENABLE_CREDITS_SYSTEM=false
|
|
|
|
# Default credits for new users
|
|
DEFAULT_CREDITS_FOR_NEW_USERS=100
|
|
|
|
# =============================================================================
|
|
# Email SMTP Configuration
|
|
# =============================================================================
|
|
|
|
# Email provider: smtp | resend
|
|
EMAIL_PROVIDER=smtp
|
|
|
|
# SMTP server host
|
|
SMTP_HOST=smtp.example.com
|
|
|
|
# SMTP server port (465 for SSL, 587 for TLS)
|
|
SMTP_PORT=465
|
|
|
|
# SMTP authentication
|
|
SMTP_USER=your-email@example.com
|
|
SMTP_PASSWORD=your-smtp-password
|
|
|
|
# Sender information
|
|
SMTP_FROM_EMAIL=noreply@example.com
|
|
SMTP_FROM_NAME=LandPPT
|
|
|
|
# Use SSL connection (true for port 465, false for port 587)
|
|
SMTP_USE_SSL=true
|
|
|
|
# =============================================================================
|
|
# Resend Email Configuration (used when EMAIL_PROVIDER=resend)
|
|
# =============================================================================
|
|
|
|
RESEND_API_KEY=
|
|
RESEND_FROM_EMAIL=
|
|
RESEND_FROM_NAME=LandPPT
|
|
|
|
# =============================================================================
|
|
# User Registration Configuration
|
|
# =============================================================================
|
|
|
|
# Enable user self-registration (can be toggled by admin)
|
|
ENABLE_USER_REGISTRATION=true
|
|
|
|
# Verification code expiration time in minutes
|
|
VERIFICATION_CODE_EXPIRE_MINUTES=10
|
|
|
|
# Rate limiting for registration-related requests (per IP)
|
|
REGISTRATION_IP_RATE_LIMIT_PER_HOUR=100
|
|
|
|
# Cloudflare Turnstile (anti-bot) for registration
|
|
# Create a Turnstile widget at: https://dash.cloudflare.com/
|
|
# TURNSTILE_ENABLED=true
|
|
# TURNSTILE_SITE_KEY=your_site_key
|
|
# TURNSTILE_SECRET_KEY=your_secret_key
|
|
TURNSTILE_ENABLED=false
|
|
TURNSTILE_SITE_KEY=
|
|
TURNSTILE_SECRET_KEY=
|
|
|
|
# =============================================================================
|
|
# Feature Flags
|
|
# =============================================================================
|
|
|
|
# Enable network mode for enhanced content (future feature)
|
|
ENABLE_NETWORK_MODE=true
|
|
|
|
# Enable local model support
|
|
ENABLE_LOCAL_MODELS=false
|
|
|
|
# Enable streaming responses (future feature)
|
|
ENABLE_STREAMING=true
|
|
|
|
# =============================================================================
|
|
# Image Service Configuration
|
|
# =============================================================================
|
|
|
|
# Enable image service functionality
|
|
ENABLE_IMAGE_SERVICE=false
|
|
|
|
# Enable local image hosting
|
|
ENABLE_LOCAL_IMAGES=false
|
|
|
|
# Enable network image search
|
|
ENABLE_NETWORK_SEARCH=true
|
|
|
|
# Enable AI image generation
|
|
ENABLE_AI_GENERATION=false
|
|
|
|
# Per-user local image hosting quota (MB). Set <= 0 to disable quota.
|
|
IMAGE_USER_STORAGE_QUOTA_MB=100
|
|
|
|
# Smart image selection for local images
|
|
LOCAL_IMAGES_SMART_SELECTION=true
|
|
|
|
# Enable smart image selection across all sources
|
|
ENABLE_SMART_IMAGE_SELECTION=true
|
|
|
|
# Maximum images per slide configuration
|
|
MAX_LOCAL_IMAGES_PER_SLIDE=2
|
|
MAX_NETWORK_IMAGES_PER_SLIDE=1
|
|
MAX_AI_IMAGES_PER_SLIDE=2
|
|
MAX_TOTAL_IMAGES_PER_SLIDE=1
|
|
|
|
# Default providers
|
|
# Available AI image providers: dalle, stable_diffusion, siliconflow, gemini, openai_image, pollinations
|
|
DEFAULT_AI_IMAGE_PROVIDER=pollinations
|
|
DEFAULT_NETWORK_SEARCH_PROVIDER=pixabay
|
|
|
|
# SearXNG Configuration
|
|
SEARXNG_HOST=
|
|
|
|
# AI image generation quality (standard, high)
|
|
AI_IMAGE_QUALITY=standard
|
|
|
|
# Gemini image gen_generation
|
|
GEMINI_IMAGE_API_KEY=your_google_api_key_here
|
|
GEMINI_IMAGE_API_BASE=https://generativelanguage.googleapis.com/v1beta
|
|
GEMINI_IMAGE_MODEL=
|
|
|
|
# OpenAI(comptability) image generation configuration
|
|
OPENAI_IMAGE_MODEL=dall-e-3
|
|
OPENAI_IMAGE_API_BASE=https://api.openai.com/v1
|
|
OPENAI_IMAGE_MODEL=
|
|
OPENAI_IMAGE_QUALITY=auto
|
|
OPENAI_IMAGE_API_KEY=your_openai_api_key_here
|
|
|
|
# =============================================================================
|
|
# Logging Configuration
|
|
# =============================================================================
|
|
|
|
# Log level (DEBUG, INFO, WARNING, ERROR)
|
|
LOG_LEVEL=INFO
|
|
|
|
# Log AI requests and responses (be careful with sensitive data)
|
|
# Set to true only for debugging, false for production
|
|
LOG_AI_REQUESTS=false
|
|
|
|
# =============================================================================
|
|
# Narration Video Export (Live Rendering)
|
|
# =============================================================================
|
|
|
|
# Per-slide ffmpeg transcode concurrency for live export (1/2/4...). Lower values are more stable in low-memory containers.
|
|
LANDPPT_NARRATION_VIDEO_TRANSCODE_PARALLELISM=1
|
|
|
|
# Per-slide browser recording concurrency. Keep low to reduce dropped frames/stutter.
|
|
LANDPPT_NARRATION_VIDEO_RECORD_PARALLELISM=1
|
|
|
|
LANDPPT_NARRATION_SCREENSHOT_DSF=2
|
|
|
|
# Live recording strategy:
|
|
# - full: record the full narration duration (keeps animations), optionally starting after a delay
|
|
# - pad: record a short segment then clone-pad (more stable, may lose animations after the segment)
|
|
LANDPPT_NARRATION_VIDEO_RECORD_MODE=pad
|
|
|
|
# Start capturing usable frames after this delay (ms) once the page is ready (e.g. 8000 to skip init).
|
|
LANDPPT_NARRATION_VIDEO_RECORD_START_DELAY_MS=0
|
|
|
|
# Safety cap for full-mode per-slide recording duration (ms).
|
|
LANDPPT_NARRATION_VIDEO_FULL_RECORD_MAX_MS=600000
|
|
|
|
# Extra trimming after the recorder-computed trim point (ms). Keep small (or 0) in full mode.
|
|
LANDPPT_NARRATION_VIDEO_EXTRA_TRIM_MS=200
|
|
|
|
# Record a fixed usable segment per slide (ms), then clone-pad the last frame to match narration duration.
|
|
LANDPPT_NARRATION_VIDEO_PAD_RECORD_MS=10000
|
|
|
|
# Cap per-slide recording duration after the slide is ready (ms).
|
|
LANDPPT_NARRATION_VIDEO_MAX_RECORD_MS=10000
|
|
|
|
# Live narration recording: forcing 30fps by default for smoother results with Playwright recorder.
|
|
# Set to 1 to keep 60fps (upsampled), at higher CPU cost.
|
|
LANDPPT_NARRATION_LIVE_ALLOW_60FPS=0
|
|
|
|
# CPU encoder tuning (used for narration video export)
|
|
# Suggested for stability: preset=ultrafast, threads=2, Docker memory >= 8GB.
|
|
LANDPPT_X264_PRESET=ultrafast
|
|
LANDPPT_X264_CRF=23
|
|
LANDPPT_X264_THREADS=2
|
|
|