refactor: 配置收敛为运行目录单一带注释 .env,移除 config 目录与 JSON 运行时配置

This commit is contained in:
Nixevol
2026-07-09 11:31:48 +08:00
parent 3d4493a314
commit 0e3702f433
12 changed files with 153 additions and 239 deletions
+5 -5
View File
@@ -17,13 +17,12 @@
"""
from __future__ import annotations
import shutil
import sys
import threading
import time
from pathlib import Path
INSTALL_DEV_RUNTIME_DIR = Path(__file__).resolve().parent.parent / "apps/api/config-dev"
INSTALL_DEV_ENV_FILE = Path(__file__).resolve().parent.parent / "apps/api/.env.install-dev"
from _lib import (
build_env,
@@ -57,7 +56,8 @@ def main() -> None:
env = build_env(cfg)
if install_mode:
env["ARTVERIS_INSTALL_MODE"] = "1"
env["ARTVERIS_CONFIG_DIR"] = str(INSTALL_DEV_RUNTIME_DIR).replace("\\", "/")
# 安装向导把配置写到一个临时 .env(不污染仓库根 .env),退出调试后由脚本清理
env["ARTVERIS_ENV_FILE"] = str(INSTALL_DEV_ENV_FILE).replace("\\", "/")
env["INSTALL_PREFILL_SECRETS"] = "1"
env["INSTALL_MYSQL_HOST"] = local_host(db["host"])
env["INSTALL_MYSQL_PORT"] = str(db["port"])
@@ -72,8 +72,8 @@ def main() -> None:
ports = [app["api_port"], app["admin_port"], app["client_port"]]
kill_project_servers(ports=ports)
time.sleep(1.5)
if install_mode and INSTALL_DEV_RUNTIME_DIR.exists():
shutil.rmtree(INSTALL_DEV_RUNTIME_DIR)
if install_mode and INSTALL_DEV_ENV_FILE.exists():
INSTALL_DEV_ENV_FILE.unlink()
ensure_pnpm()
if "--install" in args: