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
nixos/httpd: always test the generated configuration #58033
Conversation
@zimbatm Currently apache is run as the root user so it can read ssl files which are root readable only which poses a problem for this PR (ie. files which won't be accessible when this apachectl command is run). Further to that the apache config file potentially depend on files/folders/users which don't exist yet (for example, your nixops server likely won't have a wwwrun user). Very unfortunately I don't have any constructive ideas for this PR yet. I would love to see this problem solved, though. |
confFile = pkgs.writeTextFile { | ||
name = "httpd.conf"; | ||
checkPhase = '' | ||
${httpd}/bin/apachectl configtext $out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${httpd}/bin/apachectl configtest -f $out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference in case anyone sees this I'd like to correct my mistake I noticed. If specifying the config file you have to use ${httpd}/bin/httpd -t -f $out
instead of the apachectl wrapper (which assumes a hard coded location for the config file).
good points. closing this for now |
This is a really big bummer, because this is such a nice idea. |
@volth How so? |
{
nativeBuildInputs = [ httpd ];
checkPhase = ''
apachectl ...
'';
} should work though |
Motivation for this change
#34902 (comment)
not sure if that would work
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)