-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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/vaultwarden: add more systemd service hardening; move state dir in 24.05 #292485
Conversation
2989f7d
to
62a7521
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.
Please drop the reformatting. Also the lib.mdDoc changes while technically no longer needed, will be eventually be removed by a treewide change and only add noise to the PR and cause conflicts with other PRs open.
Please also include the backup hardening options from f7b63db#diff-8245e51bae8611eb979f6b30b0938c936f8d046396b7d3bb9c204b2cb7ad4b74 |
|
62a7521
to
33b6464
Compare
ah forgot to update the following commit replacing |
f61673c
to
42b3e61
Compare
I don't know, it just made the PR pretty big and harder for me to review |
42b3e61
to
0e2d7e8
Compare
sighs you'd think I'd have figured how to rename a commit by now. |
0e2d7e8
to
44140c9
Compare
44140c9
to
52b8a9d
Compare
for now ill make what i can source there should also be a release note for this breaking change right? |
52b8a9d
to
f9c3a81
Compare
been using this seemingly without issue since I made the push. systems on 24.05 (host "library" here |
We can merge #292857 first to get a test. |
with #292857 being merged ( thanks sandro ) how do we go about getting this PR tested with it? |
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.
I rebased this PR on master
for testing and ran nixosTests.vaultwarden
.
It seems that every tests fails with
server # [ 17.057818] vaultwarden[1060]: Error: Rocket.
server # [ 17.059276] vaultwarden[1060]: [CAUSE] Bind(
server # [ 17.059876] vaultwarden[1060]: Os {
server # [ 17.071526] vaultwarden[1060]: code: 13,
server # [ 17.072214] vaultwarden[1060]: kind: PermissionDenied,
server # [ 17.072977] vaultwarden[1060]: message: "Permission denied",
server # [ 17.073809] vaultwarden[1060]: },
and additionally the vaultwarden.mysql test shows
mysql-start[970]: 2024-06-16 9:49:56 59 [Warning] Aborted connection 59 to db: 'bitwarden' user: 'bitwardenuser' host: 'localhost' (Got an error reading communication packets)
but unsure whether this is just because vaultwarden doesn't start at all.
in { DATA_FOLDER = "/var/lib/bitwarden_rs"; } // lib.optionalAttrs (!(configEnv ? WEB_VAULT_ENABLED) || configEnv.WEB_VAULT_ENABLED == "true") { | ||
in { | ||
DATA_FOLDER = ( | ||
if lib.versionAtLeast config.system.stateVersion "24.05" |
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 should by now be 24.11 probably.
My plan is to first merge hexa's PR and then sort out what's left over in this one. |
@fsnkty can you please rebase on master? |
f9c3a81
to
d7adf90
Compare
well that push was a disaster, evidently I am unable to rebase on master xP |
Description of changes
added systemd service hardening to
vaultwarden
andbackup-vaultwarden
.change state directory defaults to
/var/lib/vaultwarden
over/var/lib/bitwarden_rs
whensystem.stateVersion
is>= 24.05
removed changes.
ReadWritePaths = [ "/var/lib/bitwarden_rs" ];
I thought was a requirement whenprotectSystem
isstrict
but I guess that's not the case whenstateDirectory
is used?The following should have no affect
removed
with
, mostly to address the top level use ofwith lib;
but also removed some pointless uses ( like on lists a single item long).removed now pointless
lib.mdDoc
applied the rfc style formatting.
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.