diff --git a/pipeline_service/deploy_account.py b/pipeline_service/deploy_account.py index de9d859..0e15b5d 100644 --- a/pipeline_service/deploy_account.py +++ b/pipeline_service/deploy_account.py @@ -23,9 +23,15 @@ logger = logging.getLogger("pipeline.deploy_account") DEPLOY_ENV_BASE = "/d/pipeline/deploy_envs" # bwrap 可执行文件(未安装时为 None,降级为目录隔离) +# 检测顺序:系统 PATH → 环境变量 → 已知安装位置 BWRAP = shutil.which("bwrap") -if not BWRAP and os.path.exists("/d/pipeline/bin/bwrap"): - BWRAP = "/d/pipeline/bin/bwrap" +for _p in ( + os.environ.get("BWRAP_PATH", ""), + "/d/pipeline/bin/bwrap", + "/d/pipeline/pipeline-app/bin/bwrap", +): + if not BWRAP and _p and os.path.exists(_p): + BWRAP = _p # 账号名合法字符(目录安全,防路径穿越) _SAFE_RE = re.compile(r"[^a-zA-Z0-9_-]")