You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
Currently, Monocular requires the use of an Ingress Controller by having /api as default. This was done in order to simplify the setup and avoid CORS issues.
We want to support deployment in which backend and frontend are in different hostnames.
Configure the UI to use this hostname for communications with the backend. This is currently supported (but not used) by passing the backendHostname property in the overrides.js. This file gets mapped using the config map ui-config.yaml. We need to extend this config map to read a new value in the values.yaml.
In the backend, whitelist the UI domain using the CORS configuration module. We also need to We add a new option in the values.yaml to define the UI hostname. For example frontendHostname.
CORS is currently configured in src/api/config/cors/cors.go. Currently it only whitelist everything if ENVIRONMENT=development. We should extend this to read the domain frontendHostname via env variables or command line flags.
Summarizing:
1 - Add frontendHostname and backendHostname properties in the values.yaml file.
2 - Change ui-config.yaml to expose backendHostname
3 - Modify src/api/config/cors/cors.go to whitelist frontendHostname
1 - Change deployment/monocular/templates/ui-config.yaml to expose backendHostname
data:
overrides.js: |-
window.monocular = {
overrides: {
googleAnalyticsId: '{{.Values.ui.googleAnalyticsId}}',
appName: '{{.Values.ui.appName}}',
releasesEnabled: {{.Values.api.config.releasesEnabled}},
backendHostname: "Your hostname or read it from values.yaml"
}
};
2 - Run the backend with the env variable ENVIRONMENT set to development (ENVIRONMENT=development) , NOTE this will whitelist all the domains allowing them to talk to the API. Basically disable CORS.
In deployment/monocular/templates/api-deployment.yaml
Add
... your pod definition...
env:
- name: ENVIRONMENT
value: development
Currently, Monocular requires the use of an Ingress Controller by having
/api
as default. This was done in order to simplify the setup and avoid CORS issues.We want to support deployment in which backend and frontend are in different hostnames.
Configure the UI to use this hostname for communications with the backend. This is currently supported (but not used) by passing the
backendHostname
property in the overrides.js. This file gets mapped using the config mapui-config.yaml
. We need to extend this config map to read a new value in the values.yaml.In the backend, whitelist the UI domain using the CORS configuration module. We also need to We add a new option in the values.yaml to define the UI hostname. For example
frontendHostname
.CORS is currently configured in
src/api/config/cors/cors.go
. Currently it only whitelist everything ifENVIRONMENT=development
. We should extend this to read the domainfrontendHostname
via env variables or command line flags.Summarizing:
1 - Add
frontendHostname
andbackendHostname
properties in the values.yaml file.2 - Change
ui-config.yaml
to exposebackendHostname
3 - Modify
src/api/config/cors/cors.go
to whitelistfrontendHostname
cc/ @ursuad @prydonius refs #234
The text was updated successfully, but these errors were encountered: