4c17cc839e
Bump Chart version Extend REAMDE - add default handling explanation - add MariaDB values Add APP_DATA_PATH default to config Co-authored-by: Lucas Hahn <lucas.hahn@novum-rgi.de> Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/37 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
118 lines
5.5 KiB
YAML
118 lines
5.5 KiB
YAML
apiVersion: v1
|
|
kind: Secret
|
|
metadata:
|
|
name: {{ include "gitea.fullname" . }}
|
|
labels:
|
|
{{- include "gitea.labels" . | nindent 4 }}
|
|
type: Opaque
|
|
stringData:
|
|
app.ini: |-
|
|
{{- if not (hasKey .Values.gitea.config "cache") -}}
|
|
{{- $_ := set .Values.gitea.config "cache" dict -}}
|
|
{{- end -}}
|
|
|
|
{{- if not (hasKey .Values.gitea.config "server") -}}
|
|
{{- $_ := set .Values.gitea.config "server" dict -}}
|
|
{{- end -}}
|
|
|
|
{{- if not (hasKey .Values.gitea.config "database") -}}
|
|
{{- $_ := set .Values.gitea.config "database" dict -}}
|
|
{{- end -}}
|
|
|
|
{{- if not (hasKey .Values.gitea.config "security") -}}
|
|
{{- $_ := set .Values.gitea.config "security" dict -}}
|
|
{{- end -}}
|
|
|
|
{{- /* security default settings */ -}}
|
|
{{- if not .Values.gitea.config.security.INSTALL_LOCK -}}
|
|
{{- $_ := set .Values.gitea.config.security "INSTALL_LOCK" "true" -}}
|
|
{{- end -}}
|
|
|
|
{{- /* server default settings */ -}}
|
|
{{- if not (hasKey .Values.gitea.config.server "HTTP_PORT") -}}
|
|
{{- $_ := set .Values.gitea.config.server "HTTP_PORT" .Values.service.http.port -}}
|
|
{{- end -}}
|
|
{{- if not .Values.gitea.config.server.PROTOCOL -}}
|
|
{{- $_ := set .Values.gitea.config.server "PROTOCOL" "http" -}}
|
|
{{- end -}}
|
|
{{- if not (.Values.gitea.config.server.DOMAIN) -}}
|
|
{{- if gt (len .Values.ingress.hosts) 0 -}}
|
|
{{- $_ := set .Values.gitea.config.server "DOMAIN" (index .Values.ingress.hosts 0) -}}
|
|
{{- else -}}
|
|
{{- $_ := set .Values.gitea.config.server "DOMAIN" (include "gitea.default_domain" .) -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- if not .Values.gitea.config.server.ROOT_URL -}}
|
|
{{- if .Values.ingress.enabled -}}
|
|
{{- if gt (len .Values.ingress.tls) 0 -}}
|
|
{{- $_ := set .Values.gitea.config.server "ROOT_URL" (printf "%s://%s" .Values.gitea.config.server.PROTOCOL (index (index .Values.ingress.tls 0).hosts 0)) -}}
|
|
{{- else -}}
|
|
{{- $_ := set .Values.gitea.config.server "ROOT_URL" (printf "%s://%s" .Values.gitea.config.server.PROTOCOL (index .Values.ingress.hosts 0)) -}}
|
|
{{- end -}}
|
|
{{- else -}}
|
|
{{- $_ := set .Values.gitea.config.server "ROOT_URL" (printf "%s://%s" .Values.gitea.config.server.PROTOCOL .Values.gitea.config.server.DOMAIN) -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
{{- if not .Values.gitea.config.server.SSH_DOMAIN -}}
|
|
{{- $_ := set .Values.gitea.config.server "SSH_DOMAIN" .Values.gitea.config.server.DOMAIN -}}
|
|
{{- end -}}
|
|
{{- if not .Values.gitea.config.server.SSH_PORT -}}
|
|
{{- $_ := set .Values.gitea.config.server "SSH_PORT" .Values.service.ssh.port -}}
|
|
{{- end -}}
|
|
{{- if not (hasKey .Values.gitea.config.server "SSH_LISTEN_PORT") -}}
|
|
{{- $_ := set .Values.gitea.config.server "SSH_LISTEN_PORT" .Values.gitea.config.server.SSH_PORT -}}
|
|
{{- end -}}
|
|
{{- if not (hasKey .Values.gitea.config.server "APP_DATA_PATH") -}}
|
|
{{- $_ := set .Values.gitea.config.server "APP_DATA_PATH" "/data" -}}
|
|
{{- end -}}
|
|
|
|
{{- /* database default settings */ -}}
|
|
{{- if .Values.gitea.database.builtIn.postgresql.enabled -}}
|
|
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "postgres" -}}
|
|
{{- if not (.Values.gitea.config.database.HOST) -}}
|
|
{{- $_ := set .Values.gitea.config.database "HOST" (include "postgresql.dns" .) -}}
|
|
{{- end -}}
|
|
{{- $_ := set .Values.gitea.config.database "NAME" .Values.postgresql.global.postgresql.postgresqlDatabase -}}
|
|
{{- $_ := set .Values.gitea.config.database "USER" .Values.postgresql.global.postgresql.postgresqlUsername -}}
|
|
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.postgresql.global.postgresql.postgresqlPassword -}}
|
|
{{ else if .Values.gitea.database.builtIn.mysql.enabled -}}
|
|
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "mysql" -}}
|
|
{{- if not (.Values.gitea.config.database.HOST) -}}
|
|
{{- $_ := set .Values.gitea.config.database "HOST" (include "mysql.dns" .) -}}
|
|
{{- end -}}
|
|
{{- $_ := set .Values.gitea.config.database "NAME" .Values.mysql.db.name -}}
|
|
{{- $_ := set .Values.gitea.config.database "USER" .Values.mysql.db.user -}}
|
|
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mysql.db.password -}}
|
|
{{ else if .Values.gitea.database.builtIn.mariadb.enabled -}}
|
|
{{- $_ := set .Values.gitea.config.database "DB_TYPE" "mysql" -}}
|
|
{{- if not (.Values.gitea.config.database.HOST) -}}
|
|
{{- $_ := set .Values.gitea.config.database "HOST" (include "mariadb.dns" .) -}}
|
|
{{- end -}}
|
|
{{- $_ := set .Values.gitea.config.database "NAME" .Values.mariadb.db.name -}}
|
|
{{- $_ := set .Values.gitea.config.database "USER" .Values.mariadb.db.user -}}
|
|
{{- $_ := set .Values.gitea.config.database "PASSWD" .Values.mariadb.db.password -}}
|
|
{{- end -}}
|
|
|
|
{{- /* cache default settings */ -}}
|
|
{{- if .Values.gitea.cache.builtIn.enabled -}}
|
|
{{- $_ := set .Values.gitea.config.cache "ENABLED" "true" -}}
|
|
{{- $_ := set .Values.gitea.config.cache "ADAPTER" "memcache" -}}
|
|
{{- if not (.Values.gitea.config.cache.HOST) -}}
|
|
{{- $_ := set .Values.gitea.config.cache "HOST" (include "memcached.dns" .) -}}
|
|
{{- end -}}
|
|
{{- end -}}
|
|
|
|
{{- /* autogenerate app.ini */ -}}
|
|
{{- range $key, $value := .Values.gitea.config }}
|
|
{{- if kindIs "map" $value }}
|
|
{{- if gt (len $value) 0 }}
|
|
|
|
[{{ $key }}]
|
|
{{- range $n_key, $n_value := $value }}
|
|
{{ $n_key | upper }} = {{ $n_value }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- else }}
|
|
{{ $key | upper }} = {{ $value }}
|
|
{{- end }}
|
|
{{- end }} |