-
-
Notifications
You must be signed in to change notification settings - Fork 15k
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/paperless: move paperless-manage to proper systemPackage #367496
nixos/paperless: move paperless-manage to proper systemPackage #367496
Conversation
f6737d0
to
d1f01e3
Compare
This doesn't work on systems that use
|
I think this also breaks with |
Running |
Then don't use doas or the sudo shim, they are none standard anyway and break basic things as you noted and the project is abandonware anyway since 3 to 4 year depending on how you count https://github.com/Duncaen/OpenDoas
It needs to be a hard error as the linked issue demonstrates and if we turn it into an hard error then we might as well just sudo to the correct user to not get in our way.
Not necessary as it is enabled by default but we can easily exit the script if people are not using sudo and the script is run as the wrong user.
That could be a solution but since EnvironmentFile from systemd allows us to have the secret file 400 for root:root we would be loosing that.
I am not doing that since I am aware of the pitfalls it has with the shared nginx module and to my knowledge it cannot easily be done correct on a module level. |
regarding Also having a throw in the module system is forbidden as that halts the entire evaluation on the first error. It must be an assertion. |
6f55b16
to
0675cbe
Compare
I pushed a solution which I think is the easiest one here to keep doas compatibility: people not running sudo just need to use runuser/doas -u paperless/or anything similar to change the user of the script. |
0675cbe
to
c9872d1
Compare
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.
This line of the test needs to be changed to
assert cmdline.strip() == "paperless-manage document_exporter /var/lib/paperless/export --compare-checksums --delete --no-progress-bar --no-thumbnail", "Unexpected exporter command line"
This PR needs a changelog entry.
8d54ddf
to
e0e16c5
Compare
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.
Also why in the world are we running sudo
in a systemd service that can arbitrarily set the user? Shouldn't we figure out why it's running as root in the first place when serviceConfig.User
is already set?
We are not doing that. Please check the code correctly. We are switching the user if it doesn't match what we expect which is only the case when running interactively. Also sudo will fail because we don't have a pty. |
e0e16c5
to
36a3c6c
Compare
Run the tests locally. Going to merge this to avoid more merge conflicts with the other two paperless PRs open by me and we have done a good review on this one. |
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.
Couldn't run test due to paperless build failures (log), but diff looks fine.
that's probably just another occurrence of 361006 |
Closes #343961
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.