MoJo2600 / pihole-kubernetes

PiHole on kubernetes
498 stars 173 forks source link

Feature request: add option to disable admin password #251

Closed wyvernzora closed 7 months ago

wyvernzora commented 1 year ago

Use case I am using Traefik ingress with ForwardAuth middleware, so I am looking for an option to disable the admin password as it is redundant. I noticed that if I set the password to empty string, this Helm chart generates a random one instead. I would like to request an option to explicitly disable the admin password.

Proposed implementation

Would be happy to submit a PR if/when we agree on an approach.

CygnusHyoga commented 1 year ago

It's a great idea, I facing the same problem, using Traefik ingress with ForwardAuth middleware with Authentik. A disablePassword boolean option to the values.yaml will be a perfect approach.

MoJo2600 commented 1 year ago

I think this is a great idea. I'm happy to merge a pull request.

CygnusHyoga commented 1 year ago

I've it working. I don't know how to make a pull request :-(

values.yaml

adminPassword: ""

secret.yaml

{{- if not .Values.admin.existingSecret }} apiVersion: v1 kind: Secret metadata: name: {{ template "pihole.password-secret" . }} labels: app: {{ template "pihole.name" . }} chart: {{ template "pihole.chart" . }} heritage: {{ .Release.Service }} release: {{ .Release.Name }} type: Opaque data: {{- if .Values.adminPassword }} password: {{ .Values.adminPassword | b64enc | quote }} {{- else }} password: "" {{- end }} {{- end }}