forked from EduCraft/curriculum-project-hub
fix(hub): forward host HTTP(S)_PROXY into agent sandbox (v0.0.39)
Host egress requires the local forward proxy; sandbox env previously omitted PROXY vars so Bash/curl timed out on public image URLs. Pass HTTP(S)/ALL/NO_PROXY (+ lowercase) and NODE_USE_ENV_PROXY from the trusted service environment into the agent subprocess.
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@paradigm/hub",
|
||||
"version": "0.0.38",
|
||||
"version": "0.0.39",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@paradigm/hub",
|
||||
"version": "0.0.38",
|
||||
"version": "0.0.39",
|
||||
"dependencies": {
|
||||
"@alicloud/credentials": "^2.4.5",
|
||||
"@alicloud/docmind-api20220711": "^1.4.15",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@paradigm/hub",
|
||||
"version": "0.0.38",
|
||||
"version": "0.0.39",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"engines": {
|
||||
|
||||
@@ -21,6 +21,18 @@ const SAFE_HOST_ENV_KEYS = [
|
||||
"LOGNAME",
|
||||
"SHELL",
|
||||
"CPH_BIN",
|
||||
// Host egress is often only reachable via a local forward proxy. Without
|
||||
// these, sandboxed Bash/curl times out on public HTTPS (ADR-0018: network
|
||||
// open ≠ direct routing). Values come from the trusted service environment.
|
||||
"HTTP_PROXY",
|
||||
"HTTPS_PROXY",
|
||||
"ALL_PROXY",
|
||||
"NO_PROXY",
|
||||
"http_proxy",
|
||||
"https_proxy",
|
||||
"all_proxy",
|
||||
"no_proxy",
|
||||
"NODE_USE_ENV_PROXY",
|
||||
] as const;
|
||||
|
||||
const SANDBOX_HIDDEN_ENV_KEYS = [
|
||||
|
||||
@@ -26,6 +26,11 @@ describe("agent subprocess security policy", () => {
|
||||
PATH: "/usr/local/bin:/usr/bin:/bin",
|
||||
LANG: "C.UTF-8",
|
||||
CPH_BIN: "/usr/local/bin/cph",
|
||||
HTTP_PROXY: "http://127.0.0.1:7890",
|
||||
HTTPS_PROXY: "http://127.0.0.1:7890",
|
||||
ALL_PROXY: "socks5h://127.0.0.1:7890",
|
||||
NO_PROXY: "127.0.0.1,localhost,::1",
|
||||
NODE_USE_ENV_PROXY: "1",
|
||||
DATABASE_URL: "postgresql://platform-secret",
|
||||
FEISHU_APP_SECRET: "feishu-secret",
|
||||
HUB_SESSION_SECRET: "session-secret",
|
||||
@@ -41,6 +46,11 @@ describe("agent subprocess security policy", () => {
|
||||
ANTHROPIC_BASE_URL: "http://127.0.0.1:43123",
|
||||
ANTHROPIC_AUTH_TOKEN: "run-proxy-capability",
|
||||
ANTHROPIC_API_KEY: "",
|
||||
HTTP_PROXY: "http://127.0.0.1:7890",
|
||||
HTTPS_PROXY: "http://127.0.0.1:7890",
|
||||
ALL_PROXY: "socks5h://127.0.0.1:7890",
|
||||
NO_PROXY: "127.0.0.1,localhost,::1",
|
||||
NODE_USE_ENV_PROXY: "1",
|
||||
});
|
||||
expect(policy.env).not.toHaveProperty("DATABASE_URL");
|
||||
expect(policy.env).not.toHaveProperty("FEISHU_APP_SECRET");
|
||||
|
||||
Reference in New Issue
Block a user