set config via feature flags (#6590)

In cloud environment, allow all the config values to be set by the
feature flag endpoint and be updated dynamically (on 30s poll). Retain
origianl behavior for OSS. On cloud, config changes shouldn't be changed
via redeploy and the promoted image should match the staging image.

┆Issue is synchronized with this [Notion
page](https://www.notion.so/PR-6590-set-config-via-feature-flags-2a26d73d3650819f8084eb2695c51f22)
by [Unito](https://www.unito.io)

---------

Co-authored-by: DrJKL <DrJKL0424@gmail.com>
This commit is contained in:
Christian Byrne
2025-11-05 12:45:21 -08:00
committed by GitHub
parent 549ef79e02
commit 437c3b2da0
15 changed files with 200 additions and 43 deletions

View File

@@ -6,8 +6,27 @@ declare global {
interface Window {
__CONFIG__: {
mixpanel_token?: string
require_whitelist?: boolean
subscription_required?: boolean
server_health_alert?: string
max_upload_size?: number
comfy_api_base_url?: string
comfy_platform_base_url?: string
firebase_config?: {
apiKey: string
authDomain: string
databaseURL?: string
projectId: string
storageBucket: string
messagingSenderId: string
appId: string
measurementId?: string
}
server_health_alert?: {
message: string
tooltip?: string
severity?: 'info' | 'warning' | 'error'
badge?: string
}
}
}
}
@@ -24,7 +43,17 @@ globalThis.__DISTRIBUTION__ = 'localhost'
// Define runtime config for tests
window.__CONFIG__ = {
subscription_required: true,
mixpanel_token: 'test-token'
mixpanel_token: 'test-token',
comfy_api_base_url: 'https://stagingapi.comfy.org',
comfy_platform_base_url: 'https://stagingplatform.comfy.org',
firebase_config: {
apiKey: 'test',
authDomain: 'test.firebaseapp.com',
projectId: 'test',
storageBucket: 'test.appspot.com',
messagingSenderId: '123',
appId: '123'
}
}
// Mock Worker for extendable-media-recorder