()
| 155 | }; |
| 156 | |
| 157 | export const loadConfig = (): SelfHostConfig => { |
| 158 | const port = Number.parseInt(process.env.PORT ?? "4788", 10); |
| 159 | const dataDir = resolveDataDir(); |
| 160 | const webBaseUrl = resolveWebBaseUrl(port); |
| 161 | return { |
| 162 | host: process.env.EXECUTOR_HOST ?? "127.0.0.1", |
| 163 | port, |
| 164 | dbPath: process.env.EXECUTOR_DB_PATH ?? join(dataDir, "data.db"), |
| 165 | webBaseUrl, |
| 166 | trustedOrigins: resolveTrustedOrigins(webBaseUrl), |
| 167 | allowLocalNetwork: process.env.EXECUTOR_ALLOW_LOCAL_NETWORK === "true", |
| 168 | authSecret: resolveAuthSecret(), |
| 169 | bootstrapAdminEmail: process.env.EXECUTOR_BOOTSTRAP_ADMIN_EMAIL, |
| 170 | bootstrapAdminPassword: process.env.EXECUTOR_BOOTSTRAP_ADMIN_PASSWORD, |
| 171 | bootstrapAdminName: process.env.EXECUTOR_BOOTSTRAP_ADMIN_NAME ?? "Admin", |
| 172 | organizationName: process.env.EXECUTOR_ORG_NAME ?? "Default", |
| 173 | orgSlug: resolveOrgSlug(), |
| 174 | sandboxTimeoutMs: resolveSandboxTimeoutMs(), |
| 175 | mcpSessionIdleTtlMs: resolveMcpSessionIdleTtlMs(), |
| 176 | toolsSyncTtlMs: resolveToolsSyncTtlMs(), |
| 177 | }; |
| 178 | }; |
| 179 | |
| 180 | // A malformed value is refused rather than silently ignored: an operator who |
| 181 | // sets the knob and typos it should find out at boot, not by watching a |
no test coverage detected