修改默认值

This commit is contained in:
xiaobai committed 2026-03-24 17:51:23 +08:00
1 parent a1867fd03e
commit 6faee25ba7
4 files changed
+38 -19

No files matched your search

+11 -5
View File
@@ -13,6 +13,12 @@ from maintain.paths_config import CPA_AUTHS_DIR
ROOT = Path(__file__).resolve().parent.parent
DB_PATH = ROOT / "maintain" / "data" / "maintain.db"
ACCOUNTS_OAUTH = ROOT / "accounts" / "oauth"
DEFAULT_CLIPROXY_BASE = os.getenv("CLIPROXY_MANAGEMENT_BASE", "http://192.168.31.188:8317/").strip()
DEFAULT_CLIPROXY_KEY = (
os.getenv("CLIPROXY_MANAGEMENT_KEY")
or os.getenv("MANAGEMENT_KEY")
or ""
).strip()
_lock = threading.Lock()
@@ -117,8 +123,8 @@ def init_db() -> None:
"dingtalk_webhook": "",
"dingtalk_secret": "",
# Cliproxy 管理端巡检(与 Web 管理台「探测模型」同源)
"cliproxy_management_base": "",
"cliproxy_management_key": "",
"cliproxy_management_base": DEFAULT_CLIPROXY_BASE,
"cliproxy_management_key": DEFAULT_CLIPROXY_KEY,
"cliproxy_probe_timeout_sec": "30",
"cliproxy_sweeper_threshold": "3",
"cliproxy_sweeper_run_mode": "delete",
@@ -251,9 +257,9 @@ def pick_random_proxy_url() -> Optional[str]:
def cliproxy_inspect_configured() -> bool:
return bool(get_setting("cliproxy_management_base", "").strip()) and bool(
get_setting("cliproxy_management_key", "").strip()
)
base = get_setting("cliproxy_management_base", DEFAULT_CLIPROXY_BASE).strip()
key = get_setting("cliproxy_management_key", DEFAULT_CLIPROXY_KEY).strip()
return bool(base) and bool(key)
def _oauth_json_is_codex_candidate(data: dict[str, Any], *, strict_codex_type: bool) -> bool: