-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
acme nixos test failure in apache httpd test cases #114751
Comments
The cause is that the permissions on the configured webroot directory are wrong when switching from Nginx to httpd. Taking from a debug
This subsequently causes 403 errors in httpd with the following error in the log:
There are 3 solutions, sorted by my own preference to implement:
Keeping this previous discussion in mind, I feel that changing the UMask would be the best option that would "Just work" without affecting the potentially sensitive group permissions on the webroot. Also - it's a web directory which will effectively be readable by anyone (AKA anyone that visits the page) anyway. I'm not in favour of the last option as I feel fixing it for all users is important, and I would rather have this thread + take the flak for somewhat open permissions than break people's setups entirely. |
With the UMask set to 0023, the mkdir -p command which creates the webroot could end up unreadable if the web server changes, as surfaced by the test suite in NixOS#114751 On top of this, the following commands to chown the webroot + subdirectories was mostly unnecessary. I stripped it back to only fix the deepest part of the directory, resolving NixOS#115976, and reintroduced a human readable error message.
That seems to align with the purpose of the challenge directory. If you change the umask, make sure it doesn't affect other files and directories. |
I've added some tests for the resulting file's permissions. Also I would like to highlight the work @aneeshusa did a while back in this PR & comment to determine where/what permissions lego applies to files. 0023 was a bit stingy on my part from the beginning. It should've stayed as 0022 all along ;P |
With the UMask set to 0023, the mkdir -p command which creates the webroot could end up unreadable if the web server changes, as surfaced by the test suite in NixOS#114751 On top of this, the following commands to chown the webroot + subdirectories was mostly unnecessary. I stripped it back to only fix the deepest part of the directory, resolving NixOS#115976, and reintroduced a human readable error message. (cherry picked from commit 920a3f5)
Describe the bug
The subtests for apache httpd in
nixosTests.acme
fail:i1dqvjb1zxy03kpv29b12bx4c4ay6yph-vm-test-run-acme.drv.log:
Removing these subtests makes the test pass:
nixpkgs/nixos/tests/acme.nix
Lines 377 to 392 in e723754
To Reproduce
Steps to reproduce the behavior:
nix-build -A nixosTests.acme
Expected behavior
Test success.
Screenshots
Additional context
Notify maintainers
@NixOS/acme
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Maintainer information:
The text was updated successfully, but these errors were encountered: