4 Commits
Author SHA1 Message Date
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 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 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