Skip to content
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

roon-server: disable DynamicUser #66291

Merged
merged 7 commits into from Aug 20, 2019
Merged

Conversation

reanimus
Copy link
Contributor

@reanimus reanimus commented Aug 7, 2019

Motivation for this change

DynamicUser currently breaks the backup functionality provided by roon,
as the roon server cannot write to non-canonical directories and the
recycled UIDs/GIDs would make managing permissions for the directory
impossible. On top of that, it would break the ability to manage the
local music library files (as it would not be able to delete them).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

DynamicUser currently breaks the backup functionality provided by roon,
as the roon server cannot write to non-canonical directories and the
recycled UIDs/GIDs would make managing permissions for the directory
impossible. On top of that, it would break the ability to manage the
local music library files (as it would not be able to delete them).
@infinisil
Copy link
Member

You should use a normal NixOS user declaration instead then. How it is now the service would run as root which is no good

@reanimus
Copy link
Contributor Author

reanimus commented Aug 7, 2019

Yeah I figured I need to do some sort of id declaration. adding it in now

@reanimus
Copy link
Contributor Author

reanimus commented Aug 7, 2019

Also, should I set isSystemUser = true; for the roon server user?

@infinisil
Copy link
Member

Yeah I'd set isSystemUser = true

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an explicit reason to make the user and group configurable instead of hard coding?

nixos/modules/services/audio/roon-server.nix Show resolved Hide resolved
If the user changes the user for roon, we can assume they handled the setup for it
@reanimus
Copy link
Contributor Author

reanimus commented Aug 7, 2019

There's not a specific reason for customizing it, no. It can be hard-coded.

@reanimus
Copy link
Contributor Author

reanimus commented Aug 7, 2019

Actually, I think it would be useful at make managing permissions easier. Roon itself is usually packaged to run as root, which means it usually ignores a lot of this (and it makes some assumptions about things it can do)

@@ -19,6 +19,20 @@ in {
TCP: 9100 - 9200
'';
};
user = mkOption {
type = types.string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use types.str instead. types.string is deprecated

@reanimus
Copy link
Contributor Author

Anything else I ought to clean up here?

@infinisil
Copy link
Member

Yeah looks good

@infinisil infinisil merged commit dc0d945 into NixOS:master Aug 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants