Skip to content

Commit da109cc

Browse files
omesserjesper7mjasion
authored
Assortment of fixes (#63)
Co-authored-by: Jesper Svendsen <[email protected]> Co-authored-by: Marcin Jasion <[email protected]>
1 parent 280d2f0 commit da109cc

8 files changed

+45
-34
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ imagePullSecrets:
112112

113113
global:
114114
host: "my-studio.private.com"
115+
secretKey: "768d4238-1257-4500-89ce-7ac6aea5c5c9"
115116
ingress:
116117
enabled: true
117118
className: nginx

charts/studio/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.13
18+
version: 0.1.14
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/studio/templates/NOTES.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
1. Get the application URL by running these commands:
1+
Get the application URL by running these commands:
22
{{- if .Values.global.ingress.enabled }}
3-
http{{ if $.Values.global.ingress.tlsEnabled }}s{{ end }}://{{ .Values.global.ingress.host }}/
3+
http{{ if $.Values.global.ingress.tlsEnabled }}s{{ end }}://{{ .Values.global.host }}/
44
{{- else if contains "NodePort" .Values.studioUi.service.type }}
55
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "studio.fullname" . }})
66
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")

charts/studio/templates/configmap-studio.yaml

+12-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ metadata:
44
name: studio
55
data:
66
ALLOWED_HOSTS: "*"
7-
API_URL: "{{.Values.global.url }}/api"
8-
UI_URL: "{{.Values.global.url }}/"
7+
API_URL: "http{{ if $.Values.global.ingress.tlsEnabled }}s{{ end }}://{{.Values.global.host }}/api"
8+
UI_URL: "http{{ if $.Values.global.ingress.tlsEnabled }}s{{ end }}://{{.Values.global.host }}/"
99

1010
{{- if .Values.global.scmProviders.enableWebhookSSL }}
1111
ENABLE_SSL_FOR_WEBHOOK: {{ .Values.global.scmProviders.enableWebhookSSL | quote | title }}
@@ -65,6 +65,15 @@ data:
6565
{{- if .Values.global.scmProviders.github.webhookUrl }}
6666
GITHUB_WEBHOOK_URL: {{ .Values.global.scmProviders.github.webhookUrl | quote }}
6767
{{- end }}
68+
{{- if .Values.global.scmProviders.github.clientId }}
69+
GITHUB_APP_CLIENT_ID: {{ .Values.global.scmProviders.github.clientId | quote }}
70+
{{- end }}
71+
{{- if .Values.global.scmProviders.github.appId }}
72+
GITHUB_APP_ID: {{ .Values.global.scmProviders.github.appId | quote }}
73+
{{- end }}
74+
{{- if .Values.global.scmProviders.github.appName }}
75+
GITHUB_APP_NAME: {{ .Values.global.scmProviders.github.appName | quote }}
76+
{{- end }}
6877

6978
{{- if .Values.global.scmProviders.gitlab.url }}
7079
GITLAB_URL: {{ .Values.global.scmProviders.gitlab.url | quote}}
@@ -95,7 +104,7 @@ data:
95104
SOCIAL_AUTH_REDIRECT_IS_HTTPS: "False"
96105

97106
{{- if .Values.global.ingress.enabled }}
98-
SOCIAL_AUTH_ALLOWED_REDIRECT_HOSTS: "studio-ui.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioUi.service.port }},studio-backend.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioBackend.service.port }},{{ .Values.global.ingress.host }}/"
107+
SOCIAL_AUTH_ALLOWED_REDIRECT_HOSTS: "studio-ui.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioUi.service.port }},studio-backend.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioBackend.service.port }},{{ .Values.global.host }}/"
99108
{{- else }}
100109
SOCIAL_AUTH_ALLOWED_REDIRECT_HOSTS: "studio-ui.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioUi.service.port }},studio-backend.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.studioBackend.service.port }}"
101110
{{- end }}

charts/studio/templates/deployment-studio-backend.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ spec:
3939
- name: http
4040
containerPort: 8000
4141
protocol: TCP
42+
startupProbe:
43+
httpGet:
44+
path: /health?format=json
45+
port: 8000
46+
initialDelaySeconds: 2
47+
periodSeconds: 5
48+
timeoutSeconds: 30
4249
readinessProbe:
4350
httpGet:
4451
path: /health?format=json

charts/studio/templates/ingress-studio.yaml

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{{- if .Values.global.ingress.enabled -}}
2-
{{- $host := regexSplit "//" (.Values.global.url) 2 | last | quote -}}
32
{{- if and .Values.global.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
43
{{- if not (hasKey .Values.global.ingress.annotations "kubernetes.io/ingress.class") }}
54
{{- $_ := set .Values.global.ingress.annotations "kubernetes.io/ingress.class" .Values.global.ingress.className}}
@@ -28,11 +27,11 @@ spec:
2827
{{- if .Values.global.ingress.tlsEnabled }}
2928
tls:
3029
- hosts:
31-
- {{ $host }}
30+
- {{ .Values.global.host }}
3231
secretName: {{ .Values.global.ingress.tlsSecretName }}
3332
{{- end }}
3433
rules:
35-
- host: {{ $host }}
34+
- host: {{ .Values.global.host }}
3635
http:
3736
paths:
3837
- path: /
@@ -49,7 +48,7 @@ spec:
4948
serviceName: studio-ui
5049
servicePort: {{ .Values.studioUi.service.port }}
5150
{{- end }}
52-
- path: /api/*
51+
- path: /api
5352
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
5453
pathType: ImplementationSpecific
5554
{{- end }}
@@ -63,7 +62,7 @@ spec:
6362
serviceName: studio-backend
6463
servicePort: {{ .Values.studioBackend.service.port }}
6564
{{- end }}
66-
- path: /webhook/*
65+
- path: /webhook
6766
{{- if semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion }}
6867
pathType: ImplementationSpecific
6968
{{- end }}

charts/studio/templates/secret-studio.yaml

+11-19
Original file line numberDiff line numberDiff line change
@@ -11,59 +11,51 @@ stringData:
1111
DATABASE_URL: "psql://{{ .Values.global.postgres.databaseUser}}:{{ .Values.global.postgres.databasePassword }}@{{ .Values.global.postgres.databaseUrl }}"
1212

1313
{{- if .Values.global.scmProviders.gitlab.clientId }}
14-
GITLAB_CLIENT_ID: {{ .Values.global.scmProviders.gitlab.clientId }}
14+
GITLAB_CLIENT_ID: {{ .Values.global.scmProviders.gitlab.clientId | quote }}
1515
{{- end }}
1616

1717
{{- if .Values.global.scmProviders.gitlab.secretKey }}
18-
GITLAB_SECRET_KEY: {{ .Values.global.scmProviders.gitlab.secretKey }}
18+
GITLAB_SECRET_KEY: {{ .Values.global.scmProviders.gitlab.secretKey | quote }}
1919
{{- end }}
2020

2121
{{- if .Values.global.scmProviders.gitlab.webhookSecret }}
22-
GITLAB_WEBHOOK_SECRET: {{ .Values.global.scmProviders.gitlab.webhookSecret }}
23-
{{- end }}
24-
25-
{{- if .Values.global.scmProviders.github.clientId }}
26-
GITHUB_APP_CLIENT_ID: {{ .Values.global.scmProviders.github.clientId }}
27-
{{- end }}
28-
29-
{{- if .Values.global.scmProviders.github.appId }}
30-
GITHUB_APP_ID: {{ .Values.global.scmProviders.github.appId }}
22+
GITLAB_WEBHOOK_SECRET: {{ .Values.global.scmProviders.gitlab.webhookSecret | quote }}
3123
{{- end }}
3224

3325
{{- if .Values.global.scmProviders.github.appSecret }}
34-
GITHUB_APP_SECRET_KEY: {{ .Values.global.scmProviders.github.appSecret }}
26+
GITHUB_APP_SECRET_KEY: {{ .Values.global.scmProviders.github.appSecret | quote }}
3527
{{- end }}
3628

3729
{{- if .Values.global.scmProviders.github.privateKey }}
3830
GITHUB_APP_PRIVATE_KEY_PEM: |- {{ .Values.global.scmProviders.github.privateKey | nindent 4 }}
3931
{{- end }}
4032

4133
{{- if .Values.global.scmProviders.github.webhookSecret }}
42-
GITHUB_WEBHOOK_SECRET: {{ .Values.global.scmProviders.github.webhookSecret }}
34+
GITHUB_WEBHOOK_SECRET: {{ .Values.global.scmProviders.github.webhookSecret | quote }}
4335
{{- end }}
4436

4537
# Set secretKey to existing value or generate a random one
4638
{{- if .Values.global.secretKey }}
47-
SECRET_KEY: {{ .Values.global.secretKey }}
39+
SECRET_KEY: {{ .Values.global.secretKey | quote }}
4840
{{- else }}
4941
{{- $secretObj := (lookup "v1" "Secret" .Release.Namespace "studio") | default dict }}
5042
{{- $secretData := (get $secretObj "data") | default dict }}
51-
{{- $secretKey := (get $secretData "secretKey") | default (randAscii 40) }}
43+
{{- $secretKey := (get $secretData "SECRET_KEY" | b64dec) | default (randAscii 40) }}
5244
SECRET_KEY: {{ $secretKey | quote }}
5345
{{- end }}
5446

5547
{{- if .Values.global.blobvault.accessKeyId }}
56-
BLOBVAULT_AWS_ACCESS_KEY_ID: {{ .Values.global.blobvault.accessKeyId }}
48+
BLOBVAULT_AWS_ACCESS_KEY_ID: {{ .Values.global.blobvault.accessKeyId | quote }}
5749
{{- end }}
5850

5951
{{- if .Values.global.blobvault.secretAccessKeyId }}
60-
BLOBVAULT_AWS_SECRET_ACCESS_ID: {{ .Values.global.blobvault.secretAccessKeyId }}
52+
BLOBVAULT_AWS_SECRET_ACCESS_ID: {{ .Values.global.blobvault.secretAccessKeyId | quote }}
6153
{{- end }}
6254

6355
{{- if .Values.global.scmProviders.bitbucket.secretKey }}
64-
BITBUCKET_SECRET_KEY: {{ .Values.global.scmProviders.bitbucket.secretKey }}
56+
BITBUCKET_SECRET_KEY: {{ .Values.global.scmProviders.bitbucket.secretKey | quote }}
6557
{{- end }}
6658

6759
{{- if .Values.global.scmProviders.bitbucket.clientId }}
68-
BITBUCKET_CLIENT_ID: {{ .Values.global.scmProviders.bitbucket.clientId }}
60+
BITBUCKET_CLIENT_ID: {{ .Values.global.scmProviders.bitbucket.clientId | quote }}
6961
{{- end }}

charts/studio/values.yaml

+7-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
imagePullSecrets: []
77

88
global:
9-
# -- Studio: Url
10-
url: "http://studio.example.com"
9+
# -- Studio: Hostname for accessing Studio (no http(s) scheme)
10+
host: "studio.example.com"
1111
# -- Studio: Maximum number of views
1212
maxViews: "100"
1313
# -- Studio: Maximum number of teams
1414
maxTeams: "10"
15-
# -- Studio: Secret key for encryption
15+
# -- Studio: Secret key for signing Webhook payloads
16+
# We recommend you set this externally. If left empty, a random key will be generated.
1617
secretKey: ""
1718

1819
# -- Studio: Custom CA certificate in PEM format
@@ -76,14 +77,16 @@ global:
7677

7778
# -- GitHub OAuth App Client ID
7879
clientId: ""
80+
# -- GitHub OAuth App Name
81+
appName: ""
7982
# -- GitHub OAuth App ID
8083
appId: ""
8184
# -- GitHub OAuth App Secret
8285
appSecret: ""
8386
# -- GitHub OAuth App Private Key
8487
privateKey: ""
8588

86-
# -- GitHub Webhook URL
89+
# -- GitHub Webhook URL, e.g. https://<global.host>/webhook/github/
8790
webhookUrl: ""
8891
# -- GitHub Webhook secret
8992
webhookSecret: ""

0 commit comments

Comments
 (0)