Request: Enable FTLCONF_webserver_api_password_FILE

I have been using the Docker Compose Secrets with my V5 pi-hole running in a container. My compose.yaml file has these fragments for example:

     environment:
      ServerIP: 192.168.110.201
      VIRTUAL_HOST: pihole.lan
      WEBPASSWORD: pihole_webpasswd
      TZ: 'America/Los_Angeles'
    secrets:
      - pihole_webpasswd
    restart: unless-stopped

...
secrets:
  pihole_webpasswd:
    file: ./pihole_password.txt

This makes secret management simple and reasonable secure.

This no longer works in pi-hole v6. The following fragment, for example, simply uses the secret token (pihole_webpasswd) as the password. Adding support for FTLCONF_webserver_api_password_FILE similar to the prior WEBPASSWORD_FILE would be helpful.

      FTLCONF_webserver_api_password: pihole_webpasswd
      TZ: 'America/Los_Angeles'
    secrets:
      - pihole_webpasswd
    restart: unless-stopped
...

secrets:
  pihole_webpasswd:
    file: ./pihole_password.txt

thank you

In your second example, you appear to be missing:

   secrets:
     - pihole_webpasswd

Is that what it is not working?

(I've never used this method before so forgive me if I sound stupid here... :wink: )

Is another option to change the Docker Compose Secrets script to work with Pi-hole V6?

You can use a .env file to do that:

Good catch. Unfortunately it was my copy and paste error. The lines are in the compose.yaml file. I corrected the original post.

Since this is a built-in feature of Compose, I suspect not.

Thanks for the link. I will revert to using .env method to set a password that Pi-hole V6 can consume. I have a github repo with my compose file so I do not want to embed the password directly in the yaml file. Using .env is more or less about as secure as using compose secrets capability.

The repo is at: GitHub - buckaroogeek/unifi-pihole-doh-docker: Docker compose yaml file and supporting information that manages several applications on a Synology NAS

Many thanks for the PR and merge. I will be testing shortly.

I'm not sure how I managed to merge it, but it wasn't supposed to be - PR reverted because the tests were failing....

However, if you want to try it yourself before it makes it's way back into the development tag, you can clone the repo and test with a local build bef

git clone https://github.com/pi-hole/docker-pi-hole
cd docker-pi-hole
git checkout password_file
./build.sh