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:
@@ -1,13 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
"""首次部署:自动生成中控通信密钥、登录会话密钥,并写入初始登录账号。
|
||||
"""首次部署:自动生成中控通信密钥,登录会话密钥,并写入初始登录账号.
|
||||
|
||||
- HUB_BRIDGE_TOKEN:中控 + 三实例(相同,仅空/占位时写入,不覆盖已有)
|
||||
- FLASK_SECRET_KEY:三实例(相同)
|
||||
- HUB_SESSION_SECRET:仅中控
|
||||
- APP_USERNAME=admin、APP_PASSWORD=admin123:实例(仅空时)
|
||||
- HUB_USERNAME=admin、HUB_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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user