fix: configure JD01 workspace git proxy

This commit is contained in:
Codex
2026-06-29 14:34:15 +00:00
parent 10c5daf618
commit 2f21b7836b
9 changed files with 308 additions and 22 deletions
+19
View File
@@ -8,6 +8,7 @@ import { resolveEgressProxySourceRef, type MasterShadowsocksSourceSpec } from ".
import type { RenderedCliResult } from "./output";
import { shQuote } from "./platform-infra-public-service";
import { fingerprintSecretValues, readEnvSourceFile, requiredEnvValue } from "./secrets";
import { transHostProxyEnvSummary } from "./trans-host-proxy";
const configPath = "config/platform-infra/host-proxy.yaml";
@@ -853,6 +854,9 @@ function targetSummary(target: HostProxyTarget): Record<string, unknown> {
serviceName: client.serviceName,
listen: `${client.listenHost}:${client.listenPort}`,
},
trans: {
hostProxyEnv: transHostProxyEnvSummary(target.id),
},
};
}
@@ -924,6 +928,8 @@ function renderPlan(result: Record<string, unknown>): RenderedCliResult {
"",
...table(["PROXY", "NO_PROXY_COUNT", "HYUEAPI", "VALUES"], [[text(env.proxyUrl), text(env.noProxyCount), "preserved", "printed=false"]]),
"",
...transHostProxyEnvTable(target),
"",
"NEXT",
` dry-run: ${text(next.dryRun, "")}`,
` apply: ${text(next.apply, "")}`,
@@ -955,6 +961,8 @@ function renderApply(result: Record<string, unknown>): RenderedCliResult {
"",
...table(["SERVICE_ACTIVE", "BINARY_SHA", "HOST_PROBE", "POD_PROBE", "VALUES"], [[text(client.serviceActive), text(client.binarySha256Ok), text(probe.status), text(podProbe.status, "skipped"), "printed=false"]]),
"",
...transHostProxyEnvTable(target),
"",
`NEXT\n ${text(record(result.next).status, "")}`,
];
return { ok: result.ok !== false, command: "platform-infra egress-proxy host apply", renderedText: lines.join("\n"), contentType: "text/plain" };
@@ -983,11 +991,22 @@ function renderStatus(result: Record<string, unknown>): RenderedCliResult {
"",
...table(["NO_PROXY_HYUEAPI", "NO_PROXY_WILDCARD", "VALUES"], [[text(noProxy.hyueapi), text(noProxy.wildcardHyueapi), "printed=false"]]),
"",
...transHostProxyEnvTable(target),
"",
"Disclosure: file content, Secret values and generated proxy config are not printed.",
];
return { ok: result.ok !== false, command: "platform-infra egress-proxy host status", renderedText: lines.join("\n"), contentType: "text/plain" };
}
function transHostProxyEnvTable(target: Record<string, unknown>): string[] {
const trans = record(target.trans);
const rule = record(trans.hostProxyEnv);
return table(
["TRANS_PROXY_ENV", "ENV_REF", "APPLY_TO", "ENV_FILE"],
[[text(rule.enabled, "false"), text(rule.envFileRef, ""), text(rule.applyTo, "disabled"), text(rule.envFile, "")]],
);
}
function option(args: string[], name: string): string | null {
const index = args.indexOf(name);
if (index === -1) return null;