| 203 | } |
| 204 | |
| 205 | export class SelfManagedAppConfig implements IBaseAppConfig { |
| 206 | mode = "self-managed" as const; |
| 207 | |
| 208 | authMode: SelfManagedAuthMode = appConfigJson.auth.mode; |
| 209 | |
| 210 | balancerdDnsNames: string[] | undefined = appConfigJson.balancerdDnsNames; |
| 211 | |
| 212 | environmentdScheme = getEnvironmentdScheme({ |
| 213 | buildConstants, |
| 214 | isLocalImpersonation: false, |
| 215 | }); |
| 216 | |
| 217 | environmentdWebsocketScheme = getEnvironmentdWebsocketScheme({ |
| 218 | buildConstants, |
| 219 | isLocalImpersonation: false, |
| 220 | }); |
| 221 | |
| 222 | #isBrowser = getIsBrowser(); |
| 223 | consoleUrl = getConsoleUrl(this.#isBrowser); |
| 224 | |
| 225 | // The tag of the Materialize Console image. |
| 226 | mzConsoleImageTag = buildConstants.mzConsoleImageTag; |
| 227 | |
| 228 | // In self-managed, regions don't exist but we stub it out for convenience. |
| 229 | // We should remove this for https://github.com/MaterializeInc/console/issues/3812. |
| 230 | regionsStub: CloudRegion[] = [ |
| 231 | { |
| 232 | provider: "local", |
| 233 | region: "flexible-deployment", |
| 234 | regionApiUrl: "", |
| 235 | }, |
| 236 | ]; |
| 237 | |
| 238 | // Used to specify which http address to target for Materialize's http/ws APIs. |
| 239 | environmentdConfig: EnvironmentdConfig = { |
| 240 | // We use the console's host (usually localhost:3000) to target the environmentd. |
| 241 | // The reason we can do this is for self managed deployments, we're hosting on an nginx server |
| 242 | // with a proxy that forwards requests from :3000/api to :${MZ_ENDPOINT}/api. |
| 243 | // This nginx config is defined in `misc/docker/nginx.conf.template`. |
| 244 | environmentdHttpAddress: this.consoleUrl.host, |
| 245 | regionId: `${this.regionsStub[0].provider}/${this.regionsStub[0].region}`, |
| 246 | }; |
| 247 | |
| 248 | // Whether query retries are enabled. |
| 249 | // TODO (password-auth): We should be using import.meta.vitest to determine this. |
| 250 | reactQueryRetriesEnabled = true; |
| 251 | } |
| 252 | |
| 253 | /** |
| 254 | * Global application configuration singleton. |
nothing calls this directly
no test coverage detected