diff --git a/.env.example b/.env.example index ef31757..776328d 100644 --- a/.env.example +++ b/.env.example @@ -28,11 +28,6 @@ BETTER_AUTH_URL=http://localhost:3000 # Optional comma-separated list of additional trusted origins for Better Auth. # Example: BETTER_AUTH_TRUSTED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000 # BETTER_AUTH_TRUSTED_ORIGINS= -# On Railway production environments: -# - Set BETTER_AUTH_URL to your primary public origin, for example https://finance.example.com -# - Set BETTER_AUTH_TRUSTED_ORIGINS to every live auth origin, for example -# https://app.example.com,https://app-production-1234.up.railway.app -# - Do not include localhost origins in Railway production variables # Optional agent request limit overrides. # Safe defaults are enabled in code even when these remain commented out. diff --git a/railway.json b/railway.json deleted file mode 100644 index f9f7d2e..0000000 --- a/railway.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://railway.com/railway.schema.json", - "deploy": { - "runtime": "V2", - "startCommand": "pnpm start", - "preDeployCommand": "pnpm auth:migrate && pnpm threads:migrate && pnpm markets:migrate", - "healthcheckPath": "/sign-in", - "restartPolicyType": "ON_FAILURE", - "restartPolicyMaxRetries": 10 - } -} diff --git a/src/lib/server/auth.ts b/src/lib/server/auth.ts index da10b4e..0756f47 100644 --- a/src/lib/server/auth.ts +++ b/src/lib/server/auth.ts @@ -15,7 +15,6 @@ const AUTH_DEFAULT_RATE_LIMIT_MAX_REQUESTS = 100 const AUTH_CREDENTIAL_RATE_LIMIT_WINDOW_SECONDS = 15 * 60 const AUTH_CREDENTIAL_RATE_LIMIT_MAX_REQUESTS = 5 const THIRTY_DAYS_IN_SECONDS = 60 * 60 * 24 * 30 -const RAILWAY_URL_ENV_NAME_PATTERN = /^RAILWAY_SERVICE_.+_URL$/ const VERCEL_ENV = "VERCEL_ENV" as const const VERCEL_BRANCH_URL_ENV = "VERCEL_BRANCH_URL" as const const VERCEL_URL_ENV = "VERCEL_URL" as const @@ -146,10 +145,6 @@ function getTrustedOrigins(baseUrl: string): string[] { } } - for (const origin of getRailwayOrigins()) { - trustedOrigins.add(origin) - } - return [...trustedOrigins] } @@ -171,33 +166,6 @@ function normalizeOrigin(value: string): string | null { } } -function getRailwayOrigins(): string[] { - const railwayOriginCandidates = Object.entries(process.env) - .filter( - ([name, value]) => - Boolean(value) && - (name === "RAILWAY_PUBLIC_DOMAIN" || - name === "RAILWAY_STATIC_URL" || - RAILWAY_URL_ENV_NAME_PATTERN.test(name)) - ) - .map(([, value]) => value) - - const railwayOrigins = new Set() - - for (const originCandidate of railwayOriginCandidates) { - if (!originCandidate) { - continue - } - - const normalizedOrigin = normalizeOrigin(originCandidate) - if (normalizedOrigin) { - railwayOrigins.add(normalizedOrigin) - } - } - - return [...railwayOrigins] -} - function getAllowedHosts(trustedOrigins: string[]): string[] { const allowedHosts = new Set()