mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 03:26:37 +08:00
145 lines
5.2 KiB
YAML
145 lines
5.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
|
||
max_cpu_threads: 2 # hard cap for Go CPU threads; raise only on powerful hosts
|
||
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:
|
||
# auto: Docker Compose 注入 PostgreSQL DSN 时用 PG;没有 DSN 时回退 SQLite。
|
||
# postgres: 强制使用 dsn;sqlite: 强制使用 db_path。
|
||
type: auto
|
||
dsn: "" # e.g. postgres://mediastation:mediastation@postgres:5432/mediastation?sslmode=disable
|
||
db_path: ./data/mediastation.db
|
||
wal_mode: true
|
||
busy_timeout: 5000
|
||
cache_size: -20000 # KB (negative)
|
||
max_open_conns: 4 # small WAL pool; keeps login/playback responsive during scans
|
||
max_idle_conns: 2
|
||
|
||
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: warn # warn by default; set info/debug temporarily for detailed diagnosis
|
||
format: console # console | json
|
||
output_path: "" # empty = {data_dir}/logs/app.log + warn.log + error.log; stdout/stderr disables file logs
|
||
enable_rotation: true
|
||
max_size_mb: 20
|
||
max_age_days: 30
|
||
max_backups: 10
|
||
|
||
cache:
|
||
cache_dir: ./cache
|
||
redis_url: "" # e.g. redis://redis:6379/0;为空则只使用进程内/磁盘缓存
|
||
redis_prefix: mediastationgo
|
||
media_ttl_seconds: 15
|
||
max_disk_usage_mb: 0 # 0 = unlimited
|
||
ttl_hours: 0
|
||
auto_cleanup: false
|
||
cleanup_interval_min: 60
|
||
|
||
search:
|
||
backend: "" # "" = DB/SQLite FTS;opensearch = OpenSearch 加速搜索
|
||
opensearch_url: "" # e.g. http://opensearch:9200
|
||
index: mediastation_media
|
||
username: ""
|
||
password: ""
|
||
|
||
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:
|
||
# Built-in MediaStationGo license server bridge.
|
||
# Open-source mode works without this and is limited to 20 users.
|
||
server_url: "https://mgosever.3jzs.com"
|
||
public_key: "MCowBQYDK2VwAyEABRXnXy+urjrbKit6Yu/HiezWgP0NdsZW3tsegJWRrtI=" # Ed25519 public key for protected license responses
|
||
hmac_secret: "" # legacy fallback only; prefer Ed25519 public_key
|
||
|
||
# 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: "国漫"
|
||
euus_anime: "欧美动漫"
|
||
variety: "综艺"
|
||
documentary: "纪录片"
|
||
children: "儿童"
|
||
uncategorized_tv: "未分类"
|