You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The "standard" way would be to support a PIHOLE_PASSWORD_FILE env var, and read the file contents into the configuration, falling back to the existing variable.
For reference, here is the PR which added this support to pihole itself:
FROM ekofr/pihole-exporter:v0.4.0 as source
FROM alpine:3.17
RUN apk update --no-cache && apk add bash
COPY --from=source /root/pihole-exporter /root/pihole-exporter
COPY start.sh /root/start.sh
CMD /root/start.sh
#!/bin/bash# See: https://github.com/pi-hole/docker-pi-hole/pull/584load_password_secret() {
# If PIHOLE_PASSWORD is not set at all, attempt to read password from PIHOLE_PASSWORD_FILE,# allowing secrets to be passed via docker secretsif [ -z"${PIHOLE_PASSWORD+x}" ] && [ -n"${PIHOLE_PASSWORD_FILE}" ] && [ -r"${PIHOLE_PASSWORD_FILE}" ];thenexport PIHOLE_PASSWORD=$(<"${PIHOLE_PASSWORD_FILE}")fi;
}
load_password_secret
exec /root/pihole-exporter
Feature request to support reading pihole password and/or api key from docker secrets.
The "standard" way would be to support a
PIHOLE_PASSWORD_FILE
env var, and read the file contents into the configuration, falling back to the existing variable.For reference, here is the PR which added this support to pihole itself:
Steps for Reproduction
$ docker stack deploy -c docker-compose.yml test
Expected behavior:
pihole-exporter would read the contents of
/run/secrets/pihole-password
as the passwordActual behavior:
PIHOLE_PASSWORD_FILE
is ignored; exporter returns only the "unauthenticated" metrics.Platforms:
Docker swarm cluster.
Versions:
ekofr/pihole-exporter:v0.0.11
The text was updated successfully, but these errors were encountered: