add prefix
This commit is contained in:
parent
5faebd423f
commit
8cb9121a7f
1 changed files with 6 additions and 1 deletions
7
main.py
7
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
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue