Skip to content

Update WEBPASSWORD_FILE file example with permissions information #1255

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

buckaroogeek
Copy link
Contributor

Updates the WEBPASSWORD_FILE with required permissions settings. These permissions settings are not well documented in the online Docker Secrets examples.

Thank you for your contribution to the Pi-hole Community!

Please read the comments below to help us consider your Pull Request.

We are all volunteers and completing the process outlined will help us review your commits quicker.

Please make sure you

  1. Base your code and PRs against the repositories developmental branch.
  2. Sign Off all commits as we enforce the DCO for all contributions
  3. Sign all your commits as they must have verified signatures
  4. File a pull request for any change that requires changes to our documentation at our documentation repo

What does this PR aim to accomplish?:

How does this PR accomplish the above?:

Link documentation PRs if any are needed to support this PR:


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code and I have tested my changes.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)
  6. I have checked that another pull request for this purpose does not exist.
  7. I have considered, and confirmed that this submission will be valuable to others.
  8. I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  9. I give this submission freely, and claim no ownership to its content.

  • I have read the above and my PR is ready for review. Check this box to confirm

@buckaroogeek buckaroogeek requested a review from a team as a code owner July 1, 2025 20:24
Copy link

netlify bot commented Jul 1, 2025

Deploy Preview for pihole-docs ready!

Name Link
🔨 Latest commit 30eda3b
🔍 Latest deploy log https://app.netlify.com/projects/pihole-docs/deploys/6873f3e9d6ce510008cb4c5c
😎 Deploy Preview https://deploy-preview-1255--pihole-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@yubiuser
Copy link
Member

CI tests are failing with

Summary: 2 error(s)
docs/docker/configuration.md:174:3 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ sudo chown 1000:1000 pihole_..."]
docs/docker/configuration.md:175:3 MD014/commands-show-output Dollar signs used before commands without showing output [Context: "$ sudo chmod 0400 pihole_passw..."]

Updates the WEBPASSWORD_FILE with required permissions settings. These
permissions settings are not well documented in the online Docker
Secrets examples.

Signed-off-by: Bradley G Smith <[email protected]>
@buckaroogeek
Copy link
Contributor Author

Thanks! Sorry I missed the failing CI tests.

Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to replicate the the failing with wrong UID/GID and docker compose but it worked anyway.

On the host

chris@T14Gen5:~/Downloads/piv6$ ls -lha ./pihole_password.txt 
-r-------- 1 1001 1001 9 Feb 25 09:14 ./pihole_password.txt

Within the container

816698bbc2a4:/# ls -lha /run/secrets/
total 12K
drwxr-xr-x 2 root root 4.0K Jul 28 11:48 .
drwxr-xr-x 1 root root 4.0K Jul 28 11:48 ..
-r-------- 1 1001 1001    9 Feb 25 08:14 pihole_webpasswd

Log output

chris@T14Gen5:~/Downloads/piv6$ docker compose up
Attaching to pihole
pihole  |   [i] Setting up user & group for the pihole user
pihole  |   [i] PIHOLE_UID not set in environment, using default (1000)
pihole  |   [i] PIHOLE_GID not set in environment, using default (1000)
pihole  | 
pihole  |   [i] Starting FTL configuration
pihole  |   [i] Setting FTLCONF_webserver_api_password from file
pihole  |   [i] Assigning password defined by Environment Variable

Maybe because my local user is part of the docker group?

@buckaroogeek
Copy link
Contributor Author

I suspect that is the reason but not sure. I tested this using docker on a synology where there isn't a docker group. I will spin up a fedora vm later today and test. Off hand I am puzzled that in the container the pihole UID (1000) could read the secrets file which has a UID of 1001 and is read-only to that UID.

Useful info at: docker/compose#12362
and this long thread: docker/compose#9648 (comment)

@yubiuser
Copy link
Member

Maybe someone from @pi-hole/docker-maintainers can test as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants