Files
MeBox/config.example.yaml
T
2026-05-29 13:54:19 +08:00

128 lines
4.2 KiB
YAML

# ============================================================================
# MediaStationGo configuration template.
#
# Loading priority (low -> high):
# 1. Built-in defaults
# 2. config.yaml (this file, copied to the working directory)
# 3. config/*.yaml shard files (per-module)
# 4. Environment variables prefixed with MEDIASTATION_, e.g.
# MEDIASTATION_APP_PORT=8080
# MEDIASTATION_SECRETS_JWT_SECRET=...
#
# Copy this file to `config.yaml` and edit the values you actually need.
# ============================================================================
app:
port: 8080
debug: false
env: production
data_dir: ./data
web_dir: ./web/dist
ffmpeg_path: ffmpeg
ffprobe_path: ffprobe
vaapi_device: /dev/dri/renderD128
cors_origins: [] # leave empty to allow * in dev; set strict allow-list in prod
server_url: "" # public URL of the server (used for DLNA / casting)
database:
db_path: ./data/mediastation.db
wal_mode: true
busy_timeout: 5000
cache_size: -20000 # KB (negative)
max_open_conns: 1
max_idle_conns: 1
secrets:
# When empty, a 32-byte random secret is generated on first start and
# persisted to {data_dir}/.jwt_secret so existing sessions survive restarts.
jwt_secret: ""
tmdb_api_key: ""
tmdb_api_proxy: "" # e.g. https://api.tmdb-mirror.example
tmdb_image_proxy: "" # e.g. https://image.tmdb-mirror.example/t/p
bangumi_access_token: ""
thetvdb_api_key: ""
fanart_tv_api_key: ""
logging:
level: info # debug | info | warn | error
format: console # console | json
output_path: "" # empty = stdout
enable_rotation: false
max_size_mb: 100
max_age_days: 30
max_backups: 10
cache:
cache_dir: ./cache
max_disk_usage_mb: 0 # 0 = unlimited
ttl_hours: 0
auto_cleanup: false
cleanup_interval_min: 60
media:
movies_dir: ""
tv_dir: ""
anime_dir: ""
transcoder:
# Hardware encoder for HLS transcodes.
# "" software libx264 (default; runs anywhere)
# nvenc h264_nvenc (NVIDIA GPU, requires --gpus all)
# qsv h264_qsv (Intel iGPU, requires /dev/dri)
# vaapi h264_vaapi (Intel/AMD VAAPI, requires /dev/dri)
enabled: true # global HLS transcode switch; false = direct play only and no ffmpeg transcode jobs
hardware_accel: false # must be true before encoder below is used
encoder: ""
preset: veryfast
video_bitrate: 1500k
max_rate: 1800k
buf_size: 3000k
max_height: 720
segment_seconds: 4
realtime: true # throttle ffmpeg input to playback speed instead of transcoding the whole file at full speed
threads: 2 # software libx264 thread cap; set 0 to let ffmpeg decide
max_concurrent: 1 # maximum simultaneous HLS transcodes
idle_timeout_seconds: 120 # stop ffmpeg when the player stops requesting HLS segments
ai:
enabled: false
provider: openai # openai | deepseek | qwen | ollama
api_base: https://api.openai.com/v1
api_key: ""
model: gpt-4o-mini
timeout: 30
max_concurrent: 3
license:
# Optional private MediaStationLicenseServer bridge.
# Open-source mode works without this and is limited to 20 users.
server_url: "" # e.g. http://127.0.0.1:8001
hmac_secret: "" # must match LICENSE_HMAC_SECRET on the license server
# FlareSolverr 配置(用于绕过 Cloudflare/WAF 保护)
flaresolverr:
enabled: false
url: "http://localhost:8191" # FlareSolverr 服务地址
session: "mediastation" # 会话名称(可选,保持 cookie 持久化)
timeout: 60 # 请求超时(秒)
# 整理配置(智能分类)
organizer:
smart_classify: false # 是否启用智能分类整理
auto_after_download: false # 下载完成后是否自动整理;关闭时可在「整理与维护」手动整理
categories:
chinese_movie: "华语电影"
animation_movie: "动画电影"
foreign_movie: "外语电影"
euus_movie: "欧美电影"
jk_movie: "日韩电影"
domestic_tv: "国产剧"
euus_tv: "欧美剧"
jk_tv: "日韩剧"
jp_anime: "日番"
cn_anime: "国漫"
variety: "综艺"
documentary: "纪录片"
children: "儿童"
uncategorized_tv: "未分类"