Skip to content

Commit

Permalink
feat: wip
Browse files Browse the repository at this point in the history
  • Loading branch information
shahargl committed Oct 23, 2024
1 parent 8f7c1ab commit bfa7ebe
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
14 changes: 14 additions & 0 deletions charts/keep/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,18 @@ Helper function for NEXTAUTH_URL
{{- print "http://localhost:3000" -}}
{{- end -}}
{{- end -}}
{{- end -}}


{{/*
Helper function for KEEP_API_URL that handles both relative and absolute URLs
*/}}
{{- define "keep.apiUrl" -}}
{{- $apiUrlClient := include "keep.apiUrlClient" . -}}
{{- /* Check if the URL starts with http:// or https:// */ -}}
{{- if or (hasPrefix "http://" $apiUrlClient) (hasPrefix "https://" $apiUrlClient) -}}
{{- $apiUrlClient -}}
{{- else -}}
{{- include "keep.fullUrl" . -}}{{- $apiUrlClient -}}
{{- end -}}
{{- end -}}
2 changes: 2 additions & 0 deletions charts/keep/templates/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ spec:
containerPort: {{ .Values.backend.service.port }}
protocol: TCP
env:
- name: KEEP_API_URL
value: {{ include "keep.apiUrl" . | quote }}
{{- range .Values.backend.env }}
- name: {{ .name }}
{{- if .secretKeyRef }}
Expand Down
10 changes: 8 additions & 2 deletions charts/keep/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ global:
backendPrefix: "/apinew"
frontendPrefix: "/"
hosts: []
# uncomment when you want to use a custom domain
# hosts:
# - host: keep.example.com
tls: []
# uncomment when you want to use a custom domain with TLS
# tls:
# - hosts:
# - keep.example.com
# secretName: keep-tls

# this section controls the ingress-nginx **controller**
# and not the ingress resource itself
Expand Down Expand Up @@ -138,8 +146,6 @@ frontend:
env:
- name: NEXTAUTH_SECRET
value: secret
- name: API_URL_CLIENT
value: http://keep-backend:8080
# Shahar: took me whole day to figure out that I need to set this to 1
# https://github.com/nextauthjs/next-auth/issues/600
- name: VERCEL
Expand Down

0 comments on commit bfa7ebe

Please sign in to comment.