add prefix

This commit is contained in:
thanawat saiyota 2026-06-15 18:03:33 +07:00
parent 5faebd423f
commit 8cb9121a7f

View file

@ -23,6 +23,7 @@ BASE_DIR = Path("/usr/src/app/taobin_project")
# BASE_DIR = Path("/taobin_project") # BASE_DIR = Path("/taobin_project")
SERVICE_NAME = os.getenv("SERVICE_NAME") SERVICE_NAME = os.getenv("SERVICE_NAME")
PREFIX = os.getenv("PREFIX", "")
GIT_REPO_SERVER_URL = os.getenv("GIT_REPO_SERVER_URL") GIT_REPO_SERVER_URL = os.getenv("GIT_REPO_SERVER_URL")
FRONTEND_NOTIFY_URL = os.getenv("FRONTEND_NOTIFY_URL") FRONTEND_NOTIFY_URL = os.getenv("FRONTEND_NOTIFY_URL")
@ -168,6 +169,10 @@ def _enable_legacy_ssh(transport):
def open_adv_sftp(cfg: dict): def open_adv_sftp(cfg: dict):
"""Open an SFTP session to a country's adv FTP server. Caller must close both.""" """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"): if not cfg.get("password"):
raise HTTPException(500, f"ADV SFTP password not configured for host {cfg.get('host')}") raise HTTPException(500, f"ADV SFTP password not configured for host {cfg.get('host')}")
transport = paramiko.Transport((cfg["host"], cfg["port"])) transport = paramiko.Transport((cfg["host"], cfg["port"]))