MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / loadConfig

Function loadConfig

apps/host-selfhost/src/config.ts:157–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155};
156
157export 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

Callers 10

startServerFunction · 0.90
makeSelfHostAppFunction · 0.90
execution.tsFile · 0.90
resolveAuthProvidersFunction · 0.90
makeAuthOptionsFunction · 0.90
buildBetterAuthFunction · 0.90
makeSelfHostTestAppFunction · 0.90

Calls 8

resolveTrustedOriginsFunction · 0.85
resolveAuthSecretFunction · 0.85
resolveSandboxTimeoutMsFunction · 0.85
resolveToolsSyncTtlMsFunction · 0.85
resolveDataDirFunction · 0.70
resolveWebBaseUrlFunction · 0.70
resolveOrgSlugFunction · 0.70

Tested by

no test coverage detected