Files
blackbird/core/services.yaml
T
qing fc4e1c4a61 feat(dnfs2): CLI 参数标准化 — --host/--log-level/--instance/--config/--help
- 新增 --host 作为 --addr 的规范化别名(两者完全等价)
- 新增 --log-level debug|info|warn|error,实现日志级别过滤
  * _log() 按 Config.log_level 过滤,低于设定级别的日志直接丢弃
  * 兼容现有大写 level 字符串(INFO/WARNING/ERROR)
- 新增 --instance 指定实例名(注册中心用,默认 dnfs2)
- 新增 --config 覆盖 confs 拉取的配置名(默认 dnfs.ini)
- 新增 --help/-h 打印用法并退出
- Config 优先级不变:CLI > env > confs > 默认值
- services.yaml 同步声明 --instance 和 --log-level
- 更新启动输出包含 instance/log-level/config 信息
2026-08-10 03:32:58 +08:00

88 lines
2.3 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
# 声明式服务启动配置(替代 init.txt)
# 如果本文件存在则优先使用,否则回退 init.txt
#
# 字段说明:
# name 服务唯一标识(用于日志和未来注册中心)
# cmd 启动命令(与 init.txt 每行格式一致)
# 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"]
depends_on: []
sleep_before: 0
# --- AI 审核 ---
- name: ai_review
cmd: bash /opt/micro_servers/ai_review/_run.sh
args: []
depends_on: [db2]
sleep_before: 2
# --- 文件服务 ---
- name: dnfs2
cmd: bash /opt/micro_servers/dnfs2/_run.sh
args: ["--instance", "dnfs2", "--log-level", "info"]
depends_on: [db2, ai_review]
sleep_before: 0
# --- 邮件服务 ---
- name: smtp
cmd: bash /opt/micro_servers/smtp/_run.sh
args: []
depends_on: []
sleep_before: 2
# --- 前端静态资源 ---
- name: fsys
cmd: bash /opt/micro_servers/fsys/_run.sh
args: ["--instance", "fsys", "--log-level", "info"]
depends_on: []
sleep_before: 0
# --- 安全链路 ---
- name: waf
cmd: bash /opt/micro_servers/waf/_run.sh
args: [] # -c config.yaml 保留在 _run.sh 作为默认值
depends_on: [ca, gateway]
sleep_before: 0
- name: ca
cmd: bash /opt/micro_servers/ca/_run.sh
args: []
depends_on: [db2]
sleep_before: 2
- name: gateway
cmd: bash /opt/micro_servers/gateway/_run.sh
args: []
depends_on: [db2]
sleep_before: 2
# --- 验证码 ---
- name: captcha2
cmd: bash /opt/micro_servers/captcha2/_run.sh
args: []
depends_on: []
sleep_before: 1
# --- 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: []
depends_on: [waf]
sleep_before: 0