CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
config.ts
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| fc1817a | 1 | import { join } from "path"; |
| 2 | ||
| 3 | export const config = { | |
| 4 | get port() { | |
| 5 | return Number(process.env.PORT || 3000); | |
| 6 | }, | |
| 7 | get databaseUrl() { | |
| 8 | return process.env.DATABASE_URL || ""; | |
| 9 | }, | |
| 10 | get gitReposPath() { | |
| 11 | return process.env.GIT_REPOS_PATH || join(process.cwd(), "repos"); | |
| 12 | }, | |
| 13 | get gatetestUrl() { | |
| 14 | return process.env.GATETEST_URL || "https://gatetest.ai/api/scan/run"; | |
| 15 | }, | |
| e883329 | 16 | get gatetestApiKey() { |
| 17 | return process.env.GATETEST_API_KEY || ""; | |
| 18 | }, | |
| fc1817a | 19 | get crontechDeployUrl() { |
| 20 | return ( | |
| 21 | process.env.CRONTECH_DEPLOY_URL || | |
| 22 | "https://crontech.ai/api/trpc/tenant.deploy" | |
| 23 | ); | |
| 24 | }, | |
| e883329 | 25 | get anthropicApiKey() { |
| 26 | return process.env.ANTHROPIC_API_KEY || ""; | |
| 27 | }, | |
| 24cf2ca | 28 | /** Email provider: "log" (dev, writes to stderr) or "resend" (HTTPS). */ |
| 29 | get emailProvider() { | |
| 30 | const v = (process.env.EMAIL_PROVIDER || "log").toLowerCase(); | |
| 31 | return v === "resend" ? "resend" : "log"; | |
| 32 | }, | |
| 33 | /** "From" address for outbound email. */ | |
| 34 | get emailFrom() { | |
| 35 | return process.env.EMAIL_FROM || "gluecron <no-reply@gluecron.local>"; | |
| 36 | }, | |
| 37 | /** Resend API key (only used when EMAIL_PROVIDER=resend). */ | |
| 38 | get resendApiKey() { | |
| 39 | return process.env.RESEND_API_KEY || ""; | |
| 40 | }, | |
| 41 | /** Canonical base URL for outbound links in emails + webhooks. */ | |
| 42 | get appBaseUrl() { | |
| 43 | return (process.env.APP_BASE_URL || "http://localhost:3000").replace( | |
| 44 | /\/+$/, | |
| 45 | "" | |
| 46 | ); | |
| 47 | }, | |
| 2df1f8c | 48 | /** |
| 49 | * WebAuthn relying-party ID (domain only, no scheme/port). Derived from | |
| 50 | * appBaseUrl unless overridden. Passkeys issued for one RP ID can't be | |
| 51 | * replayed against another, so this must be stable. | |
| 52 | */ | |
| 53 | get webauthnRpId() { | |
| 54 | if (process.env.WEBAUTHN_RP_ID) return process.env.WEBAUTHN_RP_ID; | |
| 55 | try { | |
| 56 | return new URL(this.appBaseUrl).hostname; | |
| 57 | } catch { | |
| 58 | return "localhost"; | |
| 59 | } | |
| 60 | }, | |
| 61 | /** WebAuthn expected origin (must include scheme + port). */ | |
| 62 | get webauthnOrigin() { | |
| 63 | return process.env.WEBAUTHN_ORIGIN || this.appBaseUrl; | |
| 64 | }, | |
| 65 | /** Human-facing RP name shown by the browser. */ | |
| 66 | get webauthnRpName() { | |
| 67 | return process.env.WEBAUTHN_RP_NAME || "gluecron"; | |
| 68 | }, | |
| fc1817a | 69 | }; |