Files
Deploy-Laboratory/scripts/01-08-update-verify-matrix.py
jack 8a54cac61f feat: CoreDNS IPv4 上游、03-03 Tomcat 修复、HAProxy 与验证脚本
- Ansible: 部署时自动配置 CoreDNS forward 为 IPv4,避免 ACME 解析失败
- 01-01/01-07: 文档增加 CoreDNS 设置说明
- 03-03: Tomcat webapps.dist 复制、HTTP/HTTPS 双 Ingress、显式 Dashboard IngressRoute
- traefik-dashboard-acme: tomcat-acme.yaml、404 排查说明
- HAProxy: 健康检查与 PROXY 配置拆分,18080/18443 部署与验证脚本

Made-with: Cursor
2026-03-22 19:02:46 +08:00

33 lines
1.3 KiB
Python
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.
#!/usr/bin/env python3
"""仅更新 docs/00-02-验证矩阵.md 中 01-08-openwrt-haproxy 条目(避免 sed 范围误伤)。"""
import re
import sys
from pathlib import Path
def main() -> int:
root = Path(__file__).resolve().parent.parent
matrix = root / "docs" / "00-02-验证矩阵.md"
if len(sys.argv) > 1:
matrix = Path(sys.argv[1])
today = sys.argv[2] if len(sys.argv) > 2 else __import__("datetime").date.today().isoformat()
text = matrix.read_text(encoding="utf-8")
pattern = re.compile(
r"(- `01-08-openwrt-haproxy\.md`\s*\n\s+- )状态:[^\n]+(\s*\n\s+- )备注:[^\n]+",
re.MULTILINE,
)
repl = (
rf"\1状态✅ 已验证\2备注ImmortalWrt + HAProxy 18080/18443经 `scripts/01-08-verify-haproxy.sh` "
rf"ssh onecloud 第三方 curl验证cfg 语法、HTTP/HTTPS 后端正确;可选 `--deploy-matrix http|tls` 一键部署矩阵({today})。"
)
new_text, n = pattern.subn(repl, text, count=1)
if n != 1:
print("[WARN] 未找到 01-08 条目或格式已变,跳过更新", file=sys.stderr)
return 1
matrix.write_text(new_text, encoding="utf-8", newline="\n")
print(f"[OK] 已更新 {matrix}")
return 0
if __name__ == "__main__":
sys.exit(main())