Normalize fullwidth punctuation to ASCII across codebase.

Add scripts/normalize_ambiguous_unicode.py; fix corrupted patch_instance_theme_templates.py. Preserves curly quotes in string literals; removes Git homoglyph warnings on .env.example.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-07-08 23:42:26 +08:00
parent aaa72c7961
commit b733e551a0
392 changed files with 71522 additions and 71369 deletions
+11 -11
View File
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
"""首次部署自动生成中控通信密钥登录会话密钥并写入初始登录账号
"""首次部署:自动生成中控通信密钥,登录会话密钥,并写入初始登录账号.
- HUB_BRIDGE_TOKEN中控 + 三实例相同仅空/占位时写入不覆盖已有
- FLASK_SECRET_KEY三实例相同
- HUB_SESSION_SECRET仅中控
- APP_USERNAME=adminAPP_PASSWORD=admin123实例仅空时
- HUB_USERNAME=adminHUB_PASSWORD=admin123中控仅空时
- HUB_BRIDGE_TOKEN:中控 + 三实例(相同,仅空/占位时写入,不覆盖已有)
- FLASK_SECRET_KEY:三实例(相同)
- HUB_SESSION_SECRET:仅中控
- APP_USERNAME=admin,APP_PASSWORD=admin123:实例(仅空时)
- HUB_USERNAME=admin,HUB_PASSWORD=admin123:中控(仅空时)
已有非空且非占位符的值不会被覆盖长期密钥一次生成不轮换)。
已有非空且非占位符的值不会被覆盖(长期密钥一次生成,不轮换).
"""
from __future__ import annotations
@@ -47,7 +47,7 @@ def _should_set(current: str | None, placeholders: frozenset[str]) -> bool:
def main() -> int:
parser = argparse.ArgumentParser(description="Bootstrap deploy secrets")
parser.add_argument("--dry-run", action="store_true", help="只打印将写入的项不改文件")
parser.add_argument("--dry-run", action="store_true", help="只打印将写入的项,不改文件")
args = parser.parse_args()
hub_token = secrets.token_urlsafe(32)
@@ -88,7 +88,7 @@ def main() -> int:
planned.append((path, updates))
if not planned:
print("无需写入密钥与登录项均已配置")
print("无需写入:密钥与登录项均已配置.")
return 0
for path, updates in planned:
@@ -101,8 +101,8 @@ def main() -> int:
print(f"已写入 {rel}: {keys}")
if not args.dry_run:
print("完成初始登录admin / admin123若本次写入了密码项)。")
print("请 pm2 restart 中控与三实例使密钥生效")
print("完成.初始登录:admin / admin123(若本次写入了密码项).")
print("请 pm2 restart 中控与三实例使密钥生效.")
return 0