fix: preserve scoped ssh env for frontend rebuild

This commit is contained in:
Codex
2026-06-02 10:27:30 +00:00
parent db3092ad29
commit 960886b9cd
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -160,6 +160,8 @@ export function writeComposeEnv(config: UniDeskConfig, freshLogPrefix: boolean):
UNIDESK_DATABASE_VOLUME: config.database.volume,
UNIDESK_DATABASE_VOLUME_SIZE: config.database.volumeSize,
UNIDESK_PROVIDER_TOKEN: config.providerGateway.token,
UNIDESK_SSH_CLIENT_TOKEN: runtimeSecret("UNIDESK_SSH_CLIENT_TOKEN"),
UNIDESK_SSH_CLIENT_ROUTE_ALLOWLIST: runtimeSecret("UNIDESK_SSH_CLIENT_ROUTE_ALLOWLIST") || "G14,G14:*,D601,D601:*",
UNIDESK_PROVIDER_ID: config.providerGateway.id,
UNIDESK_PROVIDER_NAME: config.providerGateway.name,
UNIDESK_PROVIDER_LABELS_JSON: labels,
@@ -1250,6 +1250,9 @@ export async function runSshArgvGuidanceContract(): Promise<JsonRecord> {
const composeSource = readFileSync(new URL("../docker-compose.yml", import.meta.url), "utf8");
assertCondition(composeSource.includes('PROVIDER_TOKEN: "${UNIDESK_PROVIDER_TOKEN}"'), "frontend compose service must receive provider token for the ssh proxy", composeSource);
assertCondition(composeSource.includes('UNIDESK_SSH_CLIENT_TOKEN: "${UNIDESK_SSH_CLIENT_TOKEN:-}"') && composeSource.includes("UNIDESK_SSH_CLIENT_ROUTE_ALLOWLIST"), "frontend compose service must receive scoped ssh client token and route allowlist", composeSource);
const dockerCliSource = readFileSync(new URL("./src/docker.ts", import.meta.url), "utf8");
assertCondition(dockerCliSource.includes('UNIDESK_SSH_CLIENT_TOKEN: runtimeSecret("UNIDESK_SSH_CLIENT_TOKEN")') && dockerCliSource.includes('UNIDESK_SSH_CLIENT_ROUTE_ALLOWLIST: runtimeSecret("UNIDESK_SSH_CLIENT_ROUTE_ALLOWLIST")'), "server rebuild must preserve scoped ssh client runtime env instead of dropping it from docker-compose.env", dockerCliSource);
const devCoreManifest = readFileSync(new URL("../src/components/microservices/k3sctl-adapter/k3s/dev/unidesk-dev-core.k8s.yaml", import.meta.url), "utf8");
assertCondition(devCoreManifest.includes("name: frontend-dev") && devCoreManifest.includes("name: PROVIDER_TOKEN"), "dev frontend manifest must receive provider token for the ssh proxy", devCoreManifest);