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:
dekun
2026-07-26 23:05:58 +08:00
parent 9d3b36826c
commit 2b348854fe
9 changed files with 946 additions and 25 deletions
+6
View File
@@ -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: