Verified Commit 6c7a695e authored by Hugo's avatar Hugo
Browse files

improve checksum

parent 75af260b
{{- define "hedgedoc.configfile" -}}
config.json: |-
{
"production": {
"use_env_variable": "CMD_DB_URL",
"dialect": "postgres",
"protocol": "postgres",
"dialectOptions": {
"ssl": {
"require": true,
"rejectUnauthorized": false
}
},
"db": {
"dialect": "postgres",
"protocol": "postgres",
"dialectOptions": {
"ssl": {
"require": true,
"rejectUnauthorized": false
}
}
}
}
}
.sequelizerc: |-
var path = require('path');
module.exports = {
'config': path.resolve('config.json'),
'migrations-path': path.resolve('lib', 'migrations'),
'models-path': path.resolve('lib', 'models')
}
{{- end }}
{{- define "hedgedoc.config" -}}
{{- if .Values.oauth.enabled }}
CMD_OAUTH2_USER_PROFILE_URL: {{ tpl .Values.oauth.url.userProfile . }}
CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR: {{ .Values.oauth.attribute.username }}
CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR: {{ .Values.oauth.attribute.displayName }}
CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR: {{ .Values.oauth.attribute.email }}
CMD_OAUTH2_TOKEN_URL: {{ tpl .Values.oauth.url.token . }}
CMD_OAUTH2_AUTHORIZATION_URL: {{ tpl .Values.oauth.url.authorization . }}
CMD_OAUTH2_PROVIDERNAME: {{ .Values.oauth.providerName }}
{{- if .Values.oauth.disableEmail }}
CMD_EMAIL: "false"
{{- end -}}
{{- end -}}
CMD_IMAGE_UPLOAD_TYPE: minio
CMD_S3_REGION: default
CMD_S3_BUCKET: {{ tpl .Values.fqdn . }}
CMD_MINIO_ENDPOINT: "s3.standard.indie.host"
CMD_PROTOCOL_USESSL: "true"
CMD_URL_ADDPORT: "false"
CMD_ALLOW_FREEURL: "true"
CMD_MINIO_PORT: "443"
CMD_MINIO_SECURE: "true"
CMD_USECDN: "false"
CMD_DOMAIN: {{ tpl .Values.domain . }}
DB_TYPE: postgres
{{- end }}
\ No newline at end of file
{{- define "hedgedoc.secret" -}}
{{ $secret := lookup "v1" "Secret" .Release.Namespace (include "secretName" .) -}}
{{ $pgSecretName := print "hedgedoc." (tpl .Values.pg.name .) .Values.pg.credentialsSuffix -}}
{{ $pgSecret := lookup "v1" "Secret" .Release.Namespace $pgSecretName -}}
{{ if $pgSecret.data -}}
CMD_DB_URL: postgres://{{ $pgSecret.data.username | b64dec }}:{{ $pgSecret.data.password | b64dec }}@{{ tpl .Values.pg.name . }}:5432/hedgedoc
{{ else -}}
CMD_DB_URL: postgres://unknown:unknown@{{ tpl .Values.pg.name . }}:5432/hedgedoc
{{ end -}}
{{ if $secret.data -}}
CMD_SESSION_SECRET: {{ ($secret.data.CMD_SESSION_SECRET | default "" | b64dec) | default (randAlphaNum 64) }}
{{ else -}}
CMD_SESSION_SECRET: {{ randAlphaNum 64 }}
{{ end -}}
{{- end -}}
\ No newline at end of file
......@@ -5,35 +5,4 @@ metadata:
labels:
{{- include "hedgedoc.labels" . | nindent 4 }}
data:
config.json: |-
{
"production": {
"use_env_variable": "CMD_DB_URL",
"dialect": "postgres",
"protocol": "postgres",
"dialectOptions": {
"ssl": {
"require": true,
"rejectUnauthorized": false
}
},
"db": {
"dialect": "postgres",
"protocol": "postgres",
"dialectOptions": {
"ssl": {
"require": true,
"rejectUnauthorized": false
}
}
}
}
}
.sequelizerc: |-
var path = require('path');
module.exports = {
'config': path.resolve('config.json'),
'migrations-path': path.resolve('lib', 'migrations'),
'models-path': path.resolve('lib', 'models')
}
{{- include "hedgedoc.configfile" . | nindent 2 }}
......@@ -5,27 +5,4 @@ metadata:
{{- include "hedgedoc.labels" . | nindent 4 }}
apiVersion: v1
data:
{{- if .Values.oauth.enabled }}
CMD_OAUTH2_USER_PROFILE_URL: {{ tpl .Values.oauth.url.userProfile . }}
CMD_OAUTH2_USER_PROFILE_USERNAME_ATTR: {{ .Values.oauth.attribute.username }}
CMD_OAUTH2_USER_PROFILE_DISPLAY_NAME_ATTR: {{ .Values.oauth.attribute.displayName }}
CMD_OAUTH2_USER_PROFILE_EMAIL_ATTR: {{ .Values.oauth.attribute.email }}
CMD_OAUTH2_TOKEN_URL: {{ tpl .Values.oauth.url.token . }}
CMD_OAUTH2_AUTHORIZATION_URL: {{ tpl .Values.oauth.url.authorization . }}
CMD_OAUTH2_PROVIDERNAME: {{ .Values.oauth.providerName }}
{{- if .Values.oauth.disableEmail }}
CMD_EMAIL: "false"
{{- end }}
{{- end }}
CMD_IMAGE_UPLOAD_TYPE: minio
CMD_S3_REGION: default
CMD_S3_BUCKET: {{ tpl .Values.fqdn . }}
CMD_MINIO_ENDPOINT: "s3.standard.indie.host"
CMD_PROTOCOL_USESSL: "true"
CMD_URL_ADDPORT: "false"
CMD_ALLOW_FREEURL: "true"
CMD_MINIO_PORT: "443"
CMD_MINIO_SECURE: "true"
CMD_USECDN: "false"
CMD_DOMAIN: {{ tpl .Values.domain . }}
DB_TYPE: postgres
\ No newline at end of file
{{- include "hedgedoc.config" . | nindent 2 }}
......@@ -12,9 +12,9 @@ spec:
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
checksum/configfile: {{ include (print $.Template.BasePath "/configfile.yaml") . | sha256sum }}
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
checksum/config: {{ include "hedgedoc.config" . | sha256sum }}
checksum/configfile: {{ include "hedgedoc.configfile" . | sha256sum }}
checksum/secret: {{ include "hedgedoc.secret" . | sha256sum }}
labels:
{{- include "hedgedoc.selectorLabels" . | nindent 8 }}
spec:
......
{{ $secret := lookup "v1" "Secret" .Release.Namespace (include "secretName" .) }}
{{ $pgSecretName := print "hedgedoc." (tpl .Values.pg.name .) .Values.pg.credentialsSuffix }}
{{ $pgSecret := lookup "v1" "Secret" .Release.Namespace $pgSecretName }}
apiVersion: v1
kind: Secret
metadata:
......@@ -9,13 +6,4 @@ metadata:
{{- include "hedgedoc.labels" . | nindent 4 }}
type: Opaque
stringData:
{{- if $pgSecret.data }}
CMD_DB_URL: postgres://{{ $pgSecret.data.username | b64dec }}:{{ $pgSecret.data.password | b64dec }}@{{ tpl .Values.pg.name . }}:5432/hedgedoc
{{ else }}
CMD_DB_URL: postgres://unknown:unknown@{{ tpl .Values.pg.name . }}:5432/hedgedoc
{{- end }}
{{- if $secret.data }}
CMD_SESSION_SECRET: {{ ($secret.data.CMD_SESSION_SECRET | default "" | b64dec) | default (randAlphaNum 64) }}
{{ else }}
CMD_SESSION_SECRET: {{ randAlphaNum 64 }}
{{- end }}
\ No newline at end of file
{{- include "hedgedoc.secret" . | nindent 2 }}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment