Files
blackbird/core/services.yaml
T
qing c9e8d04815 fsys: 迁移 static.ini 至 CLI args,移除 confs 依赖
- fsys/src/fsys.cpp: 移除 parse_ini/IniMap/confs RPC 调用,改为
  boost::program_options 14 项 CLI 参数,配置优先级 CLI > env > 默认值
- fsys/Makefile: 添加 -lboost_program_options
- core/services.yaml: fsys 全部参数迁入 CLI args
- confs/configs/static.ini: 已删除
- README.md: 更新 fsys 配置说明,移除 static.ini 表行,更新安全约定
2026-08-10 10:08:29 +00:00

226 lines
5.5 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.
# core/services.yaml
# 声明式服务启动配置
#
# 字段说明:
# name 服务唯一标识(用于日志和未来注册中心)
# cmd 启动命令
# args 传递给 _run.sh 的命令行参数列表(可选)
# env 启动前设置的环境变量(可选)
# depends_on 依赖的服务名列表(未来 DAG 拓扑排序用,当前仅记录)
# sleep_before 启动前等待秒数(替代散落在 _run.sh 中的 sleep)
services:
# --- 数据层(最先启动) ---
- name: db2
cmd: bash /opt/micro_servers/db2/_run.sh
args:
- "--instance"
- "db2"
- "--log-level"
- "info"
# --- 配置全部经 CLI 传递(原 confs/configs/db.ini 迁入) ---
- "--host"
- "127.0.0.1"
- "--port"
- "8005"
- "--workers"
- "4"
- "--db-url"
- "sqlite:///database.db"
- "--retention-days"
- "30"
- "--max-records"
- "1000000"
- "--cleanup-interval"
- "3600"
depends_on: []
sleep_before: 0
# --- AI 审核 ---
- name: ai_review
cmd: bash /opt/micro_servers/ai_review/_run.sh
args: ["--instance", "ai_review", "--log-level", "info"]
depends_on: [db2]
sleep_before: 2
# --- 文件服务 ---
- name: dnfs2
cmd: bash /opt/micro_servers/dnfs2/_run.sh
args:
- "--instance"
- "dnfs2"
- "--log-level"
- "info"
- "--host"
- "127.0.0.1"
- "--port"
- "8006"
- "--db-host"
- "127.0.0.1"
- "--db-port"
- "8005"
- "--db-timeout"
- "10"
- "--review-url"
- "http://127.0.0.1:8007/review"
- "--review-timeout"
- "10"
- "--gateway-url"
- "http://127.0.0.1:8443/whoami"
- "--gateway-timeout"
- "5"
depends_on: [db2, ai_review]
sleep_before: 0
# --- 邮件服务 ---
# smtp3 已修复 .env 加载 + TLS SNI,待生产验证后切换
- name: smtp
cmd: bash /opt/micro_servers/smtp/_run.sh
args: ["--instance", "smtp", "--log-level", "info"]
depends_on: []
sleep_before: 2
# --- 前端静态资源 ---
- name: fsys
cmd: bash /opt/micro_servers/fsys/_run.sh
args:
- "--instance"
- "fsys"
- "--log-level"
- "info"
# --- 配置全部经 CLI 传递(原 confs/configs/static.ini 迁入) ---
- "--addr"
- "127.0.0.1"
- "--port"
- "9200"
- "--threads"
- "4"
- "--root"
- "./public"
- "--ssl-enabled"
- "false"
- "--cert-file"
- "cert.pem"
- "--key-file"
- "key.pem"
- "--cors-origins"
- "https://qsont.me,https://yhdet.top"
- "--db-host"
- "127.0.0.1"
- "--db-port"
- "8005"
- "--dnfs-url"
- "http://127.0.0.1:8006"
depends_on: []
sleep_before: 0
# --- 安全链路 ---
- name: waf
cmd: bash /opt/micro_servers/waf/_run.sh
args: ["--instance", "waf", "--log-level", "info"]
depends_on: [ca, gateway]
sleep_before: 0
- name: ca
cmd: bash /opt/micro_servers/ca/_run.sh
args:
- "--instance"
- "ca"
- "--log-level"
- "info"
# --- v1.1.0:配置全部经 CLI 传递(原 confs/configs/ca.ini 迁入) ---
- "--host"
- "127.0.0.1"
- "--port"
- "8443"
- "--upstream-gateway"
- "http://127.0.0.1:8445"
- "--token-keep-time"
- "3600"
- "--token-refresh-grace-multiplier"
- "2"
- "--token-max-refresh"
- "10"
# 管理员白名单(分号分隔):登录命中时 Token 写入 is_admin=true
- "--admin-users"
- "1776177662@qq.com;277665039@qq.com"
- "--cors-origins"
- "https://qsont.me;https://www.qsont.me;http://127.0.0.1:8443;http://localhost:8443"
- "--ws-proxy-routes"
- "/ws/aibox=ws://127.0.0.1:8765"
- "--db-host"
- "127.0.0.1"
- "--db-port"
- "8005"
- "--captcha-host"
- "127.0.0.1"
- "--captcha-port"
- "8009"
- "--smtp-host"
- "127.0.0.1"
- "--smtp-port"
- "8008"
depends_on: [db2]
sleep_before: 2
- name: gateway
cmd: bash /opt/micro_servers/gateway/_run.sh
args: ["--instance", "gateway", "--log-level", "info"]
depends_on: [db2]
sleep_before: 2
# --- 验证码 ---
- name: captcha2
cmd: bash /opt/micro_servers/captcha2/_run.sh
args:
- "--instance"
- "captcha2"
- "--log-level"
- "info"
# --- 配置全部经 CLI 传递(原 confs/configs/captcha.ini 迁入) ---
- "--addr"
- "127.0.0.1"
- "--port"
- "8009"
- "--workers"
- "4"
- "--len"
- "4"
- "--ttl"
- "300"
- "--font-path"
- "/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf"
- "--max-store"
- "10000"
- "--rate-limit"
- "600"
depends_on: []
sleep_before: 0
# --- AI 工具箱 ---
- name: aibox
cmd: bash /opt/micro_servers/aibox/_run.sh
args: []
depends_on: []
sleep_before: 0
# --- 端口重定向(最后启动) ---
- name: redirect80
cmd: bash /opt/micro_servers/redirect80/_run.sh
args:
- "--instance"
- "redirect80"
- "--log-level"
- "info"
# --- 配置全部经 CLI 传递(原 confs/configs/redirect80.ini 迁入) ---
- "--host"
- "0.0.0.0"
- "--port"
- "80"
- "--redirect-port"
- "443"
- "--redirect-code"
- "301"
depends_on: [waf]
sleep_before: 0