Add DB+.env auto backup with download and upload restore in Settings.
Backups land under /root/eth_hedge_backups; restore accepts zip body for new-server migration and restarts the process. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -20,6 +20,12 @@ def _env_paths() -> list[Path]:
|
||||
return [root / ".env", Path.cwd() / ".env", Path.cwd().parent / ".env"]
|
||||
|
||||
|
||||
def resolve_env_file_path() -> Path:
|
||||
"""第一个已存在的 .env;都不存在则返回仓库根 .env 路径(可写入)。"""
|
||||
paths = _env_paths()
|
||||
return next((p for p in paths if p.is_file()), paths[0])
|
||||
|
||||
|
||||
def _ensure_loaded() -> None:
|
||||
global _username, _password
|
||||
if _username is not None and _password is not None:
|
||||
|
||||
Reference in New Issue
Block a user