feat(gateway): allow secured LAN console access

This commit is contained in:
chick
2026-07-18 19:47:23 +08:00
parent e390069edb
commit d575ab4d9d
4 changed files with 133 additions and 6 deletions
+12 -1
View File
@@ -9,6 +9,8 @@ export interface CanaryRuntimeEnvironment {
readonly CANARY_DIST_DIR?: string;
readonly CANARY_PORT?: string;
readonly CANARY_UPSTREAM_PORT?: string;
readonly MULTI_SIMADMIN_GATEWAY_HOST?: string;
readonly MULTI_SIMADMIN_GATEWAY_ALLOWED_HOSTS?: string;
readonly MULTI_SIMADMIN_GATEWAY_TOKEN?: string;
readonly MULTI_SIMADMIN_CUTOVER_ACK?: string;
}
@@ -54,5 +56,14 @@ export function readProductionGatewayRuntimeOptions(
);
}
const options = readCanaryRuntimeOptions({ ...environment, CANARY_PORT: '8788' });
return Object.freeze({ ...options, ownsProductionPort: true });
const host = environment.MULTI_SIMADMIN_GATEWAY_HOST ?? options.host;
const allowedHosts = environment.MULTI_SIMADMIN_GATEWAY_ALLOWED_HOSTS?.split(',')
.map((value) => value.trim())
.filter(Boolean);
return Object.freeze({
...options,
...(host === undefined ? {} : { host }),
...(allowedHosts === undefined ? {} : { allowedHosts }),
ownsProductionPort: true,
});
}