-
-
Notifications
You must be signed in to change notification settings - Fork 15.5k
darkhttpd service: chroot option #103991
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
darkhttpd service: chroot option #103991
Conversation
I added the option to enable the chroot in the darkhttpd service.
Given this service already uses Are you familiar with |
Is there any benefit of exposing systemd's sandboxing and darkhttpd's built-in chroot in the service api as options? |
Depends how much |
@aanderse Thank you for your reply! Some thoughts:
If the implementation is different or doesn't use systemd then it might not seem redundant for the kool-aid abstainers. I'd prefer to have the choice and I think adding this feature would only introduce a trivial amount of code to the darkhttpd service definition.
A different implementation of the same thing is not necessarily redundant in my eyes but pragmatists may object. Additionally, it would make the darkhttpd service API a bit more complete/comprehensive. If in the future NixOS decides to support an alternative init system (sounds like that might not happen for a very long time) that does not bundle a sandboxing feature then the darkhttpd chroot option might already be somewhat ready to go with providing that option or at the very least (given nobody ever cares to use the darkhttpd chroot option and always favor the systemd service over the native option) serve as documentation of a comprehensive api for darkhttpd. What do you think? Could we have both? What do other people in the nix community think? I don't mind opening it up for further discussion on the discourse if we'd like to weigh the pros and cons and think through it more. |
@80aff123-9163-4f3e-a93d-4a2f35af9be1 no problem - I wouldn't stand in the way of someone adding some flexibility to this module 😄. We could ping the module author if you are keen on proceeding and I'm pretty sure they would be happy to accept a change like that 👍 The obstacle this PR has, though, is that I don't believe this would even work as-is. You need capabilities to call |
@aanderse Thanks! Could you give an example of what would be needed to add the capabilities?
It looks like the pull request branch from @80aff123-9163-4f3e-a93d-4a2f35af9be1 was deleted.
@bobvanderlinden What are your thoughts on adding this feature to the darkhttpd service module? |
@peterhoeg is the module author I believe. You need to add |
@aanderse Thanks for catching that. I confused the package maintainer with the service module author.
Thanks! I found two extant examples of I'd be happy to make a pull request with the additions for code review after @peterhoeg advises. |
I marked this as stale due to inactivity. → More info |
Motivation for this change
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)