Fix techdocs and CORS
the cors setting was not loaded by the frontend because it can't see the app-config.yaml file so it needs to be part of the environment variables
This commit is contained in:
@@ -2,8 +2,6 @@ backend:
|
||||
lighthouseHostname: {{ include "lighthouse.serviceName" . | quote }}
|
||||
listen:
|
||||
port: {{ .Values.appConfig.backend.listen.port | default 7000 }}
|
||||
cors:
|
||||
origin: {{ .Values.appConfig.backend.cors.origin | quote }}
|
||||
database:
|
||||
client: {{ .Values.appConfig.backend.database.client | quote }}
|
||||
connection:
|
||||
@@ -43,3 +41,7 @@ sentry:
|
||||
scaffolder:
|
||||
azure:
|
||||
baseUrl: https://dev.azure.com/some-org
|
||||
|
||||
techdocs:
|
||||
generators:
|
||||
techdocs: 'local'
|
||||
|
||||
@@ -14,6 +14,7 @@ data:
|
||||
APP_CONFIG_app_baseUrl: {{ .Values.appConfig.app.baseUrl | quote | quote }}
|
||||
APP_CONFIG_app_title: {{ .Values.appConfig.app.title | quote | quote }}
|
||||
APP_CONFIG_backend_baseUrl: {{ .Values.appConfig.backend.baseUrl | quote | quote }}
|
||||
APP_CONFIG_backend_cors_origin: {{ .Values.appConfig.backend.cors.origin | quote | quote }}
|
||||
APP_CONFIG_techdocs_storageUrl: {{ .Values.appConfig.techdocs.storageUrl | quote | quote }}
|
||||
APP_CONFIG_techdocs_requestUrl: {{ .Values.appConfig.techdocs.requestUrl | quote | quote }}
|
||||
APP_CONFIG_lighthouse_baseUrl: {{ .Values.appConfig.lighthouse.baseUrl | quote | quote }}
|
||||
|
||||
@@ -23,22 +23,14 @@ spec:
|
||||
backend:
|
||||
serviceName: {{ include "frontend.serviceName" . }}
|
||||
servicePort: 80
|
||||
{{/* Route the backend inside the same hostname as the frontend when they are the same */}}
|
||||
{{- if eq $frontendUrl.host $backendUrl.host}}
|
||||
- path: /techdocs
|
||||
backend:
|
||||
serviceName: {{ include "backend.serviceName" . }}
|
||||
servicePort: 80
|
||||
- path: /metadata
|
||||
backend:
|
||||
serviceName: {{ include "backend.serviceName" . }}
|
||||
servicePort: 80
|
||||
{{/* Route the backend inside the same hostname as the frontend when they are the same */}}
|
||||
{{- if eq $frontendUrl.host $backendUrl.host}}
|
||||
- path: /api
|
||||
backend:
|
||||
serviceName: {{ include "backend.serviceName" . }}
|
||||
servicePort: 80
|
||||
{{/* Route the backend through a different host */}}
|
||||
{{- else -}}
|
||||
{{/* Route the backend through a different host */}}
|
||||
{{- else -}}
|
||||
- host: {{ $backendUrl.host }}
|
||||
http:
|
||||
paths:
|
||||
@@ -46,7 +38,8 @@ spec:
|
||||
backend:
|
||||
serviceName: {{ include "backend.serviceName" . }}
|
||||
servicePort: 80
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/* Route lighthouse through a different host */}}
|
||||
{{- if not ( eq $frontendUrl.host $lighthouseUrl.host ) }}
|
||||
- host: {{ $lighthouseUrl.host }}
|
||||
|
||||
@@ -102,10 +102,10 @@ appConfig:
|
||||
sentry:
|
||||
organization: spotify
|
||||
techdocs:
|
||||
storageUrl: https://backend.example.com/techdocs/static/docs
|
||||
requestUrl: https://backend.example.com/techdocs/docs
|
||||
storageUrl: https://demo.example.com/api/techdocs/static/docs
|
||||
requestUrl: https://demo.example.com/api/techdocs
|
||||
lighthouse:
|
||||
baseUrl: https://lighthouse.example.com
|
||||
baseUrl: https://demo.example.com/lighthouse-api
|
||||
rollbar:
|
||||
organization: roadie
|
||||
|
||||
|
||||
Reference in New Issue
Block a user