-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
85 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: my-configmap | ||
data: | ||
ckan-init.sh: |- | ||
#!/bin/bash | ||
echo "Do this" | ||
beaker.session.secret=$(python3 -c 'import secrets; print(secrets.token_urlsafe())'); | ||
WTF_CSRF_SECRET_KEY=$(python3 -c 'import secrets; print(secrets.token_urlsafe())); | ||
JWT_SECRET=$(python3 -c 'import secrets; print("string:" + secrets.token_urlsafe())'); | ||
ckan -c $CKAN_INI user token add ckan_admin test | ||
ckan -c $CKAN_INI user token add ckan_admin datapusherApiKey | tail -n 1 | tr -d '\t'; | ||
ckan -c $CKAN_INI user token add ckan_admin emailApiKey | tail -n 1 | tr -d '\t'; | ||
echo "Do that" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
name: hello | ||
spec: | ||
schedule: "0 * * * *" | ||
jobTemplate: | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: ckan-mail | ||
image: busybox:1.28 | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- /bin/sh | ||
- -c | ||
- "curl https://{{ .Values.ckan.ingress.hostname }}/api/3/action/ -H \"Authorization: Bearer $EMAIL_API_KEY\"" | ||
env: | ||
- name: EMAIL_API_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
name: {{ printf "%s-%s-config" (include "common.names.fullname" $) "ckan" }} | ||
key: emailApiKey | ||
restartPolicy: OnFailure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
{{- $name := (printf "%s-%s-config" (include "common.names.fullname" .) "ckan") -}} | ||
{{- $sysAdminPassword := include "common.secrets.passwords.manage" (dict "secret" $name "length" 42 "strong" false "key" "sysAdminPassword" "providedValues" (list "ckan.sysadmin.password") "skipB64enc" true "context" (dict "Values" .Values "Release" ((dict "IsUpgrade" false "IsInstall" true "Namespace" .Release.Namespace) | mergeOverwrite (deepCopy .Release)))) }} | ||
{{- $beakerSessionSecret := include "common.secrets.passwords.manage" (dict "secret" $name "length" 42 "strong" false "key" "beakerSessionSecret" "providedValues" (list "ckan.beakerSessionSecret") "skipB64enc" false "context" (dict "Values" .Values "Release" ((dict "IsUpgrade" false "IsInstall" true "Namespace" .Release.Namespace) | mergeOverwrite (deepCopy .Release)))) }} | ||
{{- $wtfCsrfSecretKey := include "common.secrets.passwords.manage" (dict "secret" $name "length" 42 "strong" false "key" "wtfCsrfSecretKey" "providedValues" (list "ckan.wtfCsrfSecretKey") "skipB64enc" false "context" (dict "Values" .Values "Release" ((dict "IsUpgrade" false "IsInstall" true "Namespace" .Release.Namespace) | mergeOverwrite (deepCopy .Release)))) }} | ||
{{- $jwtSecret := include "common.secrets.passwords.manage" (dict "secret" $name "length" 42 "strong" false "key" "jwtSecret" "providedValues" (list "ckan.jwtSecret") "skipB64enc" false "context" (dict "Values" .Values "Release" ((dict "IsUpgrade" false "IsInstall" true "Namespace" .Release.Namespace) | mergeOverwrite (deepCopy .Release)))) }} | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
|
@@ -11,6 +14,11 @@ stringData: | |
sysAdminUsername: {{ .Values.ckan.sysadmin.name | default "ckan_admin" | quote }} | ||
sysAdminPassword: {{ $sysAdminPassword }} | ||
sysAdminEmail: {{ .Values.ckan.sysadmin.email | default "[email protected]" | quote }} | ||
beakerSessionSecret: {{ $beakerSessionSecret }} | ||
wtfCsrfSecretKey: {{ $wtfCsrfSecretKey }} | ||
jwtSecret: {{ printf "string:%s" $jwtSecret }} | ||
datapusherApiKey: {{ "" }} | ||
emailApiKey: {{ "" }} | ||
{{- if .Values.ckan.smtp }} | ||
smtpPassword: {{ .Values.ckan.smtp.password | quote }} | ||
{{- end }} | ||
{{- end }} |