fix: initialize provider gateway config constants before read

This commit is contained in:
Codex
2026-06-07 03:22:31 +00:00
parent a3d9917804
commit b6efa89c9e
2 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@unidesk/provider-gateway", "name": "@unidesk/provider-gateway",
"version": "0.2.28", "version": "0.2.29",
"private": true, "private": true,
"type": "module", "type": "module",
"scripts": { "scripts": {
+7 -7
View File
@@ -58,6 +58,13 @@ interface RuntimeConfig {
} }
const startedAt = new Date(); const startedAt = new Date();
const gatewayMetadata = readGatewayMetadata();
const defaultMasterServer = "http://74.48.78.17/";
const defaultProviderToken = "unidesk-dev-token-change-me";
const microserviceHttpMaxBodyTextLength = 8 * 1024 * 1024;
const sshDataProtocol = "unidesk-host-ssh-tcp-pool-v1";
const sshDataMaxHeaderBytes = 64 * 1024;
const sshDataMaxPayloadBytes = 16 * 1024 * 1024;
const config = readConfig(); const config = readConfig();
const logger = createLogger("provider-gateway", config.logFile); const logger = createLogger("provider-gateway", config.logFile);
let socket: WebSocket | null = null; let socket: WebSocket | null = null;
@@ -138,13 +145,6 @@ const hostSshSessions = new Map<string, HostSshSession>();
const microserviceHttpCache = new Map<string, MicroserviceHttpCacheEntry>(); const microserviceHttpCache = new Map<string, MicroserviceHttpCacheEntry>();
const microserviceHttpInFlight = new Map<string, Promise<JsonValue>>(); const microserviceHttpInFlight = new Map<string, Promise<JsonValue>>();
let providerEgressProxy: ProviderEgressProxyHandle | null = null; let providerEgressProxy: ProviderEgressProxyHandle | null = null;
const gatewayMetadata = readGatewayMetadata();
const defaultMasterServer = "http://74.48.78.17/";
const defaultProviderToken = "unidesk-dev-token-change-me";
const microserviceHttpMaxBodyTextLength = 8 * 1024 * 1024;
const sshDataProtocol = "unidesk-host-ssh-tcp-pool-v1";
const sshDataMaxHeaderBytes = 64 * 1024;
const sshDataMaxPayloadBytes = 16 * 1024 * 1024;
const sshDataChannels = new Map<string, SshDataChannel>(); const sshDataChannels = new Map<string, SshDataChannel>();
let sshDataPoolDesired = false; let sshDataPoolDesired = false;
let sshDataChannelSeq = 0; let sshDataChannelSeq = 0;