Skip to content

Commit

Permalink
chore(hooks): add hooks proxy-pass on ui (#4539)
Browse files Browse the repository at this point in the history
Signed-off-by: Yvonnick Esnault <[email protected]>
  • Loading branch information
yesnault authored and richardlt committed Aug 20, 2019
1 parent 898e154 commit 6169d13
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions contrib/helm/cds/templates/ui-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ spec:
env:
- name: BACKEND_HOST
value: {{ template "cds.fullname" . }}-api
- name: BACKEND_HOOKS
value: {{ template "cds.fullname" . }}-hooks
- name: BASE_URL
value: "{{ .Values.ui.baseUrl }}"
- name: CDS_LOG_LEVEL
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ services:
image: ovhcom/cds-ui:latest
environment:
BACKEND_HOST: cds-api:8081
BACKEND_HOOKS: cds-hooks:8083
BASE_URL: /
ports:
- "2015:2015"
Expand Down
3 changes: 3 additions & 0 deletions docs/content/hosting/ready-to-run/from-binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ cd dist/
# BACKEND_HOST contains a URL to CDS Engine
export BACKEND_HOST="http://localhost:8081"

# BACKEND_HOOKS contains a URL to CDS Hooks
export BACKEND_HOOKS="http://localhost:8083"

# if you expose CDS on a domain as https://your-domain/your-cds, enter "/your-cds"
BASE_URL="/"
sed -i "s#base href=\"/\"#base href=\"${BASE_URL}\"#g" index.html
Expand Down
4 changes: 4 additions & 0 deletions ui/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
header_upstream Session-Token {>Session-Token}
}

proxy /cdshooks {$BACKEND_HOOKS} {
without /cdshooks
}

proxy /assets/worker/cdsapi {$BACKEND_HOST} {
without /assets/worker/cdsapi
header_upstream Authorization {>Authorization}
Expand Down

0 comments on commit 6169d13

Please sign in to comment.