1
0
mirror of https://github.com/Bluemangoo/sekai-unpacker.git synced 2026-05-06 20:44:47 +08:00
sekai-unpacker/sekai-unpacker-server.example.yaml
2026-05-04 15:26:22 +08:00

284 lines
9.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ==========================================
# Sekai Unpacker 服务器配置示例
# sekai-unpacker-server.example.yaml
# ==========================================
# 日志级别: DEBUG, INFO, WARN, ERROR
log_level: "INFO"
# 说明:`server`/`client` 是 TCP 连接方向,不是进程身份。
# - `server`: 本地监听并接受远端连入
# - `client`: 主动连出到远端
# 当前文件默认展示“server 进程常用监听模式”,也可同时/单独启用 `client`。
# ==========================================
# 服务器监听配置
# ==========================================
# 可配置多个监听地址和端口
server:
# 主服务器配置
- url: "127.0.0.1:3333" # 监听地址和端口
token: "your_secure_token_here" # 认证令牌,对端必须提供相同的令牌
# ========== TLS 证书配置(可选) ==========
# 如配置证书和密钥,服务器将支持 TLS 加密握手
# 如未配置,服务器仅接受明文握手
# 注意:加密仅应用于 Identity 交换阶段H2 通信保持明文
# cert: "/path/to/certificate.pem" # TLS 证书文件路径
# key: "/path/to/private.key" # TLS 私钥文件路径
# 例子:
# cert: "D:\\certs\\_.example.com-chain.pem"
# key: "D:\\certs\\_.example.com-key.pem"
# 可配置多个监听地址和端口
# - url: "0.0.0.0:3334"
# token: "alternative_token"
# cert: "/path/to/another-cert.pem"
# key: "/path/to/another-key.pem"
# ==========================================
# 可选:反向连接场景(本进程主动连出)
# ==========================================
# client:
# - url: "upstream.example.com:3333" # 远端监听地址和端口
# token: "reverse_link_token" # 需与对端 server.token 一致
# # host: "upstream.example.com" # [可选] 启用 TLS 握手时填写
# ==========================================
# 资源执行配置
# ==========================================
execution:
# HTTP 代理设置(可选)
# 如需通过代理服务器访问资源源,配置此项
# proxy: "http://proxy.example.com:8080"
# proxy: "socks5://proxy.example.com:1080"
# 资源下载和处理的超时时间(秒)
timeout_seconds: 300
# 是否允许客户端取消正在执行的任务
allow_cancel: true
# ========== 重试策略 ==========
retry:
# 最大重试次数(网络错误时)
attempts: 4
# 初始退避时间(毫秒)
# 首次失败后等待 1000ms 再重试
initial_backoff_ms: 1000
# 最大退避时间(毫秒)
# 后续每次重试的等待时间翻倍,但不超过此值
max_backoff_ms: 4000
# ==========================================
# 工具配置
# ==========================================
tools:
# ========== FFmpeg 工具 ==========
# 用于视频和音频的转换和处理
# 留空或 "ffmpeg" 表示使用系统 PATH 中的 ffmpeg
# 如 FFmpeg 未在 PATH 中,请指定完整路径
ffmpeg_path: "ffmpeg"
# 例子:
# ffmpeg_path: "C:\\Program Files\\ffmpeg\\bin\\ffmpeg.exe"
# ffmpeg_path: "/usr/bin/ffmpeg"
# ========== AssetStudio CLI 工具(可选) ==========
# 用于解析 Unity AssetBundle 文件
# 如不配置,某些资源的精细解析功能可能不可用
# asset_studio_cli_path: "D:\\Workspace\\AssetStudio\\AssetStudioCLI\\bin\\Release\\net9.0\\AssetStudioModCLI.exe"
# asset_studio_cli_path: "/opt/AssetStudioCLI"
# ==========================================
# 并发配置
# ==========================================
# 各处理阶段的并发数量配置
# 数值越大,处理速度越快,但对系统资源占用也越大
concurrency:
# 同时下载的资源文件数(好像没用到)
download: 4
# 同时上传/传输的资源文件数(好像没用到)
upload: 4
# ACB 音频包解析的并发数
acb: 8
# USM 视频解析的并发数(好像没用到)
usm: 4
# HCA 音频解码的并发数(通常可设置较大值)
hca: 16
# ==========================================
# 地区配置
# ==========================================
# 定义支持的资源地区及其对应的数据源
regions:
# ==========================================
# 日本服务器配置
# ==========================================
jp:
# 是否启用该地区
enabled: true
# ========== 资源提供者配置 ==========
provider:
# 提供者类型colorful_palette 或 nuverse
kind: colorful_palette
# 资源包元信息 API 地址模板
# {env}环境标识production/staging 等)
# {hash}:配置哈希值
# {asset_version}:资源版本
# {asset_hash}:资源包哈希
asset_info_url_template: "https://{env}-{hash}-assetbundle-info.sekai.colorfulpalette.org/api/version/{asset_version}/{asset_hash}/os/ios"
# 资源包下载地址模板
# {bundle_path}:资源包路径
asset_bundle_url_template: "https://{env}-{hash}-assetbundle.sekai.colorfulpalette.org/{asset_version}/{asset_hash}/ios/{bundle_path}"
# 配置文件名(如 production
profile: "production"
# 配置对应的哈希值映射表
profile_hashes:
production: "cf2d2388"
# staging: "12345678"
# 是否需要 Cookie
# 某些源需要 Cookie 才能访问(防盗链)
required_cookies: true
# 获取 Cookie 的 Bootstrap URL可选
# 如配置,服务器会先访问此 URL 获取 Cookie
# cookie_bootstrap_url: "https://example.com/bootstrap"
# ========== 加密配置 ==========
# 资源包的 AES 加密参数
crypto:
# AES 密钥(十六进制字符串)
aes_key_hex: "6732666343305a637a4e394d544a3631"
# AES 初始向量(十六进制字符串)
aes_iv_hex: "6d737833495630693958453575595a31"
# ========== 运行时配置 ==========
runtime:
# 资源对应的 Unity 版本
# 用于正确解析 AssetBundle
unity_version: "2022.3.21f1"
# ==========================================
# 中国服务器配置
# ==========================================
cn:
enabled: true
provider:
# Nuverse 提供者(国服使用)
kind: nuverse
# 获取资源版本的 API 地址
# {app_version}:应用版本
asset_version_url: "https://lf3-mkcncdn-tos.dailygn.com/obj/rt-game-lf/gdl_app_5236/Mainland/{app_version}/Release/cn_online/ios/version"
# 资源包元信息 API 地址模板
# {asset_version}:资源版本
asset_info_url_template: "https://lf3-mkcncdn-tos.dailygn.com/obj/sf-game-lf/gdl_app_5236/AssetBundle/{app_version}/Release/cn_online/ios{asset_version}/AssetBundleInfoNew.json"
# 资源包下载地址模板
# {app_version}:应用版本
# {bundle_path}:资源包路径
asset_bundle_url_template: "https://lf3-mkcncdn-tos.dailygn.com/obj/sf-game-lf/gdl_app_5236/AssetBundle/{app_version}/Release/cn_online/{bundle_path}"
# 是否需要 Cookie
required_cookies: false
# cookie_bootstrap_url: null
crypto:
aes_key_hex: "6732666343305a637a4e394d544a3631"
aes_iv_hex: "6d737833495630693958453575595a31"
runtime:
unity_version: "2022.3.21f1"
# ==========================================
# 其他地区配置示例(禁用)
# ==========================================
# tw:
# enabled: false
# provider:
# kind: colorful_palette
# asset_info_url_template: "https://{env}-{hash}-assetbundle-info.sekai.colorfulpalette.org/api/version/{asset_version}/{asset_hash}/os/ios"
# asset_bundle_url_template: "https://{env}-{hash}-assetbundle.sekai.colorfulpalette.org/{asset_version}/{asset_hash}/ios/{bundle_path}"
# profile: "production"
# profile_hashes:
# production: "cf2d2388"
# required_cookies: true
# crypto:
# aes_key_hex: "6732666343305a637a4e394d544a3631"
# aes_iv_hex: "6d737833495630693958453575595a31"
# runtime:
# unity_version: "2022.3.21f1"
# ==========================================
# 配置说明
# ==========================================
#
# 【服务器配置】
# - 可配置多个监听地址,支持多个客户端连接
# - 每个监听配置需要不同的 token 来区分认证
# - cert 和 key 配置是可选的:
# * 配置了:支持 TLS 加密握手 + 明文握手(双模式)
# * 未配置:仅支持明文握手
# - 如需主动连出,可额外配置 `client` 区块
#
# 【认证机制】
# - client 中的 token 必须与某个 server 配置中的 token 匹配
# - 握手时会验证 token不匹配则拒绝连接
#
# 【TLS 加密】
# - 加密范围Identity 交换(身份验证)阶段
# - H2 通信(实际数据传输)始终不加密,基于 TCP 流
# - 证书应该是 X.509 格式的 PEM 编码文件
#
# 【资源源配置】
# - 支持两种提供者:
# * colorful_palette日服资源源
# * nuverse国服资源源
# - 每个提供者有不同的 API 地址格式
#
# 【并发控制】
# - 合理设置并发数可提升处理速度
# - 过高可能导致网络压力或系统资源不足
# - 建议download/upload 4-8hca 16其他 4-8
#
# 【版本信息】
# - 客户端会根据 region 字段从服务器获取该地区的配置
# - 确保客户端 profiles 中的 region 值与服务器的地区名称一致
#
# 【禁用地区】
# - 将 enabled 设为 false 可禁用某个地区
# - 禁用的地区客户端无法同步
#
# 【代理配置】
# - 如果服务器需要通过代理访问资源源,在 execution.proxy 中配置
# - 支持 HTTP、HTTPS、SOCKS5 代理
#
# 【工具路径】
# - 确保 ffmpeg 和 AssetStudioCLI 可从配置的路径访问
# - 如在 PATH 中,可直接写命令名称
# - 否则需要提供完整的绝对路径
#
# 【角色说明】
# - 角色由连接方向决定,不由可执行文件名称决定
# - 同一进程可只开 `client`、只开 `server`,或两者同时开启