()
| 134 | }; |
| 135 | |
| 136 | export const loadConfig = (): SelfHostConfig => { |
| 137 | const port = Number.parseInt(process.env.PORT ?? "4788", 10); |
| 138 | const dataDir = resolveDataDir(); |
| 139 | return { |
| 140 | host: process.env.EXECUTOR_HOST ?? "127.0.0.1", |
| 141 | port, |
| 142 | dbPath: process.env.EXECUTOR_DB_PATH ?? join(dataDir, "data.db"), |
| 143 | webBaseUrl: resolveWebBaseUrl(port), |
| 144 | allowLocalNetwork: process.env.EXECUTOR_ALLOW_LOCAL_NETWORK === "true", |
| 145 | authSecret: resolveAuthSecret(), |
| 146 | bootstrapAdminEmail: process.env.EXECUTOR_BOOTSTRAP_ADMIN_EMAIL, |
| 147 | bootstrapAdminPassword: process.env.EXECUTOR_BOOTSTRAP_ADMIN_PASSWORD, |
| 148 | bootstrapAdminName: process.env.EXECUTOR_BOOTSTRAP_ADMIN_NAME ?? "Admin", |
| 149 | organizationName: process.env.EXECUTOR_ORG_NAME ?? "Default", |
| 150 | orgSlug: resolveOrgSlug(), |
| 151 | }; |
| 152 | }; |
| 153 | |
| 154 | // The org slug doubles as a URL segment (`/<slug>/policies`), so an |
| 155 | // operator-set value must fit the shared grammar and avoid reserved root |
no test coverage detected