Files
Nexus/docs/design/plans/2026-06-24-ip-domain-detect-schedule.md
T
r 6859846b7c sync: 主项目全量同步(含 btpanel 一键登录回归修复与前端构建产物)
- bootstrap 失败恢复 SSH 临时登录回退
- ssh_bootstrap 真安装检测与 config 目录自愈
- axs Gitea 发布源切换为 https://axs.kuma1xn.vip
2026-07-08 23:52:40 +08:00

1.4 KiB
Raw Blame History

IP 域名自动探测 — 实施说明

日期: 2026-06-24

涉及文件

文件 动作
server/utils/site_host.py 新增:IP 判定与站点 host 解析
server/utils/nginx_domain_detect.py 新增:远程 nginx 域名探测命令
server/application/server_batch_common.py 扩展:探测并写 site_url
server/application/services/ip_domain_detect_schedule.py 新增
server/background/ip_domain_detect_loop.py 新增
server/application/services/server_batch_service.py 新增 op detect-domain
server/config.py 新增配置项
server/main.py 注册 loop
tests/test_*.py 单元测试
docs/changelog/2026-06-24-ip-domain-detect-schedule.md changelog

实现步骤

  1. site_host.py 镜像前端 serverSiteUrl.ts 逻辑。
  2. build_nginx_domain_detect_command 扫描 Baota vhost 文件名 + server_name。
  3. detect_and_save_site_url SSH 执行并更新 extra_attrs
  4. schedule 列出候选 → start_batch_job(op="detect-domain")
  5. main 注册 loopconfig 默认 23:30。

测试要点

  • cron 23:30 北京时区匹配
  • list_ip_only_without_site_server_ids 过滤逻辑
  • nginx 命令含 quote、跳过 IP basename
  • schedule 幂等(already_ran_today

回滚

  • .envIP_DOMAIN_DETECT_ENABLED=false 并重启 API;或删除新增 loop 注册。