diff --git a/.env.local.template b/.env.local.template index 8685f47..b57b77b 100644 --- a/.env.local.template +++ b/.env.local.template @@ -38,6 +38,3 @@ VORTEX_AUTHZ_WORKFLOW_ID="" # entitlements BILLING_SERVICE_API_KEY="" BILLING_WEBHOOK_SECRET="" - -# feature flags -FLAGS_CLIENT_KEY= diff --git a/.env.production b/.env.production index fc9f7ab..efeb8c2 100644 --- a/.env.production +++ b/.env.production @@ -6,6 +6,3 @@ BILLING_BASE_URL="https://api.billing.omni.dev" # authz AUTHZ_PROVIDER_URL="https://api.access.omni.dev" AUTHZ_ENABLED="true" - -# feature flags -FLAGS_API_HOST=https://flags.omni.dev/api diff --git a/src/lib/config/env.config.ts b/src/lib/config/env.config.ts index ee80fb5..16cb064 100644 --- a/src/lib/config/env.config.ts +++ b/src/lib/config/env.config.ts @@ -30,9 +30,6 @@ export const { VORTEX_API_KEY, // Service key for AuthZ API (service-to-service auth) AUTHZ_SERVICE_KEY, - // Feature flags - FLAGS_API_HOST, - FLAGS_CLIENT_KEY, // Build metadata BUILD_VERSION, // Meilisearch (unified search) @@ -84,8 +81,6 @@ if (!VORTEX_API_KEY) console.warn("VORTEX_API_KEY not set, event streaming auth disabled"); if (!AUTHZ_SERVICE_KEY) console.warn("AUTHZ_SERVICE_KEY not set, AuthZ service auth disabled"); -if (!FLAGS_API_HOST) - console.warn("FLAGS_API_HOST not set, feature flags disabled"); if (!MEILISEARCH_URL) console.warn("MEILISEARCH_URL not set, search disabled"); if (!S3_BUCKET) console.warn("S3_BUCKET not set, task attachments disabled (uploads no-op)"); diff --git a/src/lib/middleware/maintenance.ts b/src/lib/middleware/maintenance.ts deleted file mode 100644 index 08f8484..0000000 --- a/src/lib/middleware/maintenance.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { Elysia } from "elysia"; - -import { flags } from "lib/providers"; - -/** - * Maintenance mode middleware. - * Returns 503 Service Unavailable when maintenance mode is enabled. - * Health check endpoint is always allowed through. - */ -export const maintenanceMiddleware = new Elysia({ name: "maintenance" }).derive( - async ({ request, set }) => { - const url = new URL(request.url); - - // Allow health checks and preflight requests through - if (url.pathname === "/health" || request.method === "OPTIONS") return {}; - - if (await flags.isEnabled("runa-api-maintenance-mode")) { - set.status = 503; - set.headers["Retry-After"] = "300"; - throw new Error("Service temporarily unavailable for maintenance"); - } - - return {}; - }, -); diff --git a/src/lib/providers/index.ts b/src/lib/providers/index.ts index e7f8f7b..8f9d2f1 100644 --- a/src/lib/providers/index.ts +++ b/src/lib/providers/index.ts @@ -9,7 +9,6 @@ import { createAuthzProvider, createBillingProvider, createEventsProvider, - createFlagProvider, createStorageProvider, } from "@omnidotdev/providers"; @@ -18,8 +17,6 @@ import { AUTHZ_SERVICE_KEY, BILLING_BASE_URL, BILLING_SERVICE_API_KEY, - FLAGS_API_HOST, - FLAGS_CLIENT_KEY, S3_ACCESS_KEY_ID, S3_BUCKET, S3_ENDPOINT, @@ -61,17 +58,6 @@ export const events = createEventsProvider( : {}, ); -export const flags = createFlagProvider( - FLAGS_API_HOST - ? { - provider: "unleash", - url: FLAGS_API_HOST, - apiKey: FLAGS_CLIENT_KEY!, - appName: "runa-api", - } - : {}, -); - /** * Object storage for task attachments. * diff --git a/src/server.ts b/src/server.ts index 95975a0..6f29cd3 100644 --- a/src/server.ts +++ b/src/server.ts @@ -39,7 +39,6 @@ import { projectAvatarRoutes, projectBackgroundRoutes, } from "lib/media"; -import { maintenanceMiddleware } from "lib/middleware/maintenance"; import { SEARCH_RECONCILE_INTERVAL_MS, initializeSearchIndexes, @@ -188,7 +187,6 @@ async function startServer(): Promise { duration: 60_000, }), ) - .use(maintenanceMiddleware) .use( cors({ origin: CORS_ALLOWED_ORIGINS!.split(","),