qing
0954644ee3
redirect80: 移除confs依赖,配置全部经CLI传递(CLI > ENV > 默认值)
...
- redirect80.py: 移除 configparser/pymsg.RpcClient 导入和 confs 拉取逻辑,
配置改为三层加载(默认值 → 环境变量 → CLI 参数)
- core/services.yaml: redirect80 条目展开为完整 CLI 声明
(--host/--port/--redirect-port/--redirect-code)
- redirect80/README.md: 配置表新增 CLI 参数列,init.txt 章节重写为
services.yaml 示例
- README.md: 配置链路移除 redirect80,confs 配置表删除 redirect80.ini 行
与 ca v1.1.0 保持一致的配置模式,redirect80 不再依赖 confs 服务。
2026-08-10 06:40:46 +00:00
qing
aa3741b861
feat(liblogc): 统一集中式日志客户端库 + 全量迁移
...
新增:
- liblogc/: C++ 统一日志库 (libus_logc.so),支持 set_endpoint/set_service_name/set_level
- pymsg/pymsg/logc.py: Python 统一日志模块,基于 AsyncRpcQueue
C++ 迁移 (删除 6 份本地 LogC.hpp 副本):
- ca, gateway: <us/LogC.hpp> + set_service_name
- captcha2, confs2, smtp3: using qing::LogC + set_service_name
- core: ConfsLogC → qing::LogC (ConfsTask.cpp)
- 所有 Makefile 添加 -lus_logc
Python 迁移 (6 个 log_client.py → 4 行薄包装):
- smtp, redirect80, confs, captcha, dnfs, static
- 全部委托到 pymsg.logc.LogClient
Go (waf): 保持现状,自成体系
2026-08-10 04:51:43 +00:00
qing
4275f002e0
redirect80: CLI 标准化(argparse + log_client 级别过滤)
...
- 新增 --host/--port/--redirect-port/--redirect-code CLI 参数(覆盖 confs+ENV)
- 新增 --log-level debug|info|warn|error(log_client 加级别过滤)
- 新增 --instance 实例名(注册中心用)
- 自定义 --help 用法文本(argparse,confs 不可用时也能 --help)
- log_client: 新增 set_log_level() + push() 级别过滤
- 修复: redirect_code 配置项原加载但未使用,do_GET/do_HEAD 改为用 _config['redirect_code']
- 配置优先级: CLI > ENV > confs > 默认值
- services.yaml: redirect80 声明 --instance 和 --log-level
2026-08-10 11:45:27 +08:00
qing
08df3929b2
feat(core): services.yaml 启动配置 + _run.sh 统一参数透传
...
Step 1: init.txt → services.yaml
- 新增 InitParser (yaml-cpp), 支持 YAML/TXT 双模式解析, 向后兼容 init.txt
- 新增 services.yaml 声明式服务配置 (name/cmd/args/depends_on/sleep_before)
- 改造 pmc_mtd.cpp 集成 InitParser, 支持目录/.yaml/.txt 三种路径模式
- Makefile 添加 InitParser 编译目标 + -lyaml-cpp 链接
- setup 脚本添加 libyaml-cpp-dev / yaml-cpp-devel 依赖
- core/_run.sh 改为 -i . (目录模式, 自动查找 services.yaml → init.txt)
Step 2: 11 个 _run.sh 统一参数透传
- 8 个脚本改动: 追加 "$@" / 移除 sleep / 修引号
- waf 保留 -c config.yaml 作为脚本默认值
- services.yaml waf args 改为 [] 避免重复传递
- 开发方案文档: docs/reports/core_services_yaml_dev_doc.md
2026-08-10 03:16:28 +08:00
qing
c1724ccea9
fix(redirect80): extract .content from confs RPC response dict
...
RpcClient.call() returns the data dict, not a raw string.
configparser.read_string() expects str, hence TypeError.
Now uses .get("content") to unwrap the ini text.
2026-08-02 12:52:51 +08:00
qing
f9c02cd6ad
feat(redirect80): new HTTP→HTTPS redirect service on port 80
...
Pure Python stdlib http.server + ThreadingMixIn, zero web framework deps.
- GET/HEAD → 301, POST/PUT/DELETE/PATCH → 308
- Reads Host header, strips port, redirects to https://{host}{path}
- Config via confs (retry_on_refused, hard dependency) + env var override
- Logs via log_client → db Logs table (fail-safe async batch)
- Port 80 privilege via setcap cap_net_bind_service in _run.sh
2026-08-02 12:50:23 +08:00