From 8cb9121a7f7bc8e3688882c754f4c13ecce4678b Mon Sep 17 00:00:00 2001 From: thanawat saiyota Date: Mon, 15 Jun 2026 18:03:33 +0700 Subject: [PATCH] add prefix --- main.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 6dd9a87..8b2f19c 100644 --- a/main.py +++ b/main.py @@ -23,6 +23,7 @@ BASE_DIR = Path("/usr/src/app/taobin_project") # BASE_DIR = Path("/taobin_project") SERVICE_NAME = os.getenv("SERVICE_NAME") +PREFIX = os.getenv("PREFIX", "") GIT_REPO_SERVER_URL = os.getenv("GIT_REPO_SERVER_URL") FRONTEND_NOTIFY_URL = os.getenv("FRONTEND_NOTIFY_URL") @@ -168,6 +169,10 @@ def _enable_legacy_ssh(transport): def open_adv_sftp(cfg: dict): """Open an SFTP session to a country's adv FTP server. Caller must close both.""" + if not cfg.get("host"): + raise HTTPException(500, "ADV SFTP host not configured") + if not cfg.get("remote_dir"): + raise HTTPException(500, f"ADV SFTP remote_dir not configured for host {cfg.get('host')}") if not cfg.get("password"): raise HTTPException(500, f"ADV SFTP password not configured for host {cfg.get('host')}") transport = paramiko.Transport((cfg["host"], cfg["port"])) @@ -709,4 +714,4 @@ async def upload_inter_images( return { "uploaded": saved, "git_commit": git_response - } \ No newline at end of file + }