OAuth2 configuration options (#123) All checks were successful continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
I opened up the OAuth2 authentication option. I needed this feature, and it is available in the gitea cli. So I opened it up for configuration through this pull request. Hope it can help others. Co-authored-by: Marc Went <marc.went+git@redkubes.com> Reviewed-on: gitea/helm-chart#123 Reviewed-by: luhahn <luhahn@noreply.gitea.io> Reviewed-by: lafriks <lafriks@noreply.gitea.io> Co-authored-by: Dunky13 <dunky13@noreply.gitea.io> Co-committed-by: Dunky13 <dunky13@noreply.gitea.io>
This commit was merged in pull request #123.
This commit is contained in:
@@ -107,4 +107,12 @@ app.kubernetes.io/instance: {{ .Release.Name }} | ||||
{{- end -}} | ||||
{{- end -}} | ||||
{{- end -}} | ||||
{{- end -}} | ||||
| ||||
{{- define "gitea.oauth_settings" -}} | ||||
{{- range $key, $val := .Values.gitea.oauth -}} | ||||
{{- if ne $key "enabled" -}} | ||||
{{- printf "--%s %s " ($key | kebabcase) ($val | quote) -}} | ||||
{{- end -}} | ||||
{{- end -}} | ||||
{{- end -}} | ||||
@@ -40,4 +40,14 @@ stringData: | ||||
{{- include "gitea.ldap_settings" . | nindent 6 }} \ | ||||
) \ | ||||
{{- end }} | ||||
{{- if .Values.gitea.oauth.enabled }} | ||||
gitea admin auth add-oauth \ | ||||
{{- include "gitea.oauth_settings" . | nindent 6 }} \ | ||||
|| \ | ||||
( \ | ||||
export GITEA_AUTH_ID=$(gitea admin auth list | grep {{ .Values.gitea.oauth.name | quote }} | awk -F " " "{print \$1}"); \ | ||||
gitea admin auth update-oauth --id ${GITEA_AUTH_ID} \ | ||||
{{- include "gitea.oauth_settings" . | nindent 6 }} \ | ||||
) \ | ||||
{{- end }} | ||||
' | ||||
| ||||
@@ -15,6 +15,7 @@ spec: | ||||
annotations: | ||||
checksum/config: {{ include (print $.Template.BasePath "/gitea/config.yaml") . | sha256sum }} | ||||
checksum/ldap: {{ include "gitea.ldap_settings" . | sha256sum }} | ||||
checksum/oauth: {{ include "gitea.oauth_settings" . | sha256sum }} | ||||
{{- with .Values.gitea.podAnnotations }} | ||||
{{- toYaml . | nindent 8 }} | ||||
{{- end }} | ||||
| ||||
Reference in New Issue
Block a user