Skip to content

nixos/seafile: add persistent user, configurable storage path, and gc service#290104

Closed
melvyn2 wants to merge 1 commit intoNixOS:masterfrom
melvyn2:seafile-data
Closed

nixos/seafile: add persistent user, configurable storage path, and gc service#290104
melvyn2 wants to merge 1 commit intoNixOS:masterfrom
melvyn2:seafile-data

Conversation

@melvyn2
Copy link
Contributor

@melvyn2 melvyn2 commented Feb 20, 2024

Description of changes

Disable DynamicUser for seafile in favor of a persistent configurable service user and group. This allows moving the storage directory out of the systemd-managed StateDirectory (previously, external paths could be bind-mounted or symlinked into the state directory, but UID reassignments meant having to manually and slowly chown the entire storage).

This also allows access by other services, such as by a garbage-collection timer also added here.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Feb 20, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Feb 20, 2024
@melvyn2
Copy link
Contributor Author

melvyn2 commented Feb 20, 2024

@greizgh looks you weren't auto-requested by the bot since the module is missing the meta.maintainer attr. Would you please review this PR?

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/3863

@greizgh
Copy link
Contributor

greizgh commented May 3, 2024

@greizgh looks you weren't auto-requested by the bot since the module is missing the meta.maintainer attr. Would you please review this PR?

Sorry, completely missed that. This lgtm! Thanks for your contribution, this was deep down on my todo list and I never got the time to look into GC.

@melvyn2
Copy link
Contributor Author

melvyn2 commented May 4, 2024

Added you and @schmittlauch to the maintainers for this module, so we can have the maintainer approval tag hopefully.

Comment on lines +374 to +377
if [[ $installedMajor == $pkgMajor && $installedMinor == $pkgMinor ]]; then
:
else
echo "Server not upgraded yet" >&2
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if [[ $installedMajor == $pkgMajor && $installedMinor == $pkgMinor ]]; then
:
else
echo "Server not upgraded yet" >&2
if [[ $installedMajor != $pkgMajor && $installedMinor != $pkgMinor ]]; then
echo "Server not upgraded yet" >&2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was kept to match the main script, but that isn't too useful I guess.

'';
};

seaf-gc = {
Copy link
Member

Choose a reason for hiding this comment

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

Can we easily deduplicate more things?

@melvyn2
Copy link
Contributor Author

melvyn2 commented Jun 5, 2024

Seahub needs to be updated anyways so it can build again, version 10 is using django 3 (marked insecure), and there's no PR yet to update to 11. I'll take a look at this again once that PR's in motion.

@melvyn2
Copy link
Contributor Author

melvyn2 commented Jun 14, 2024

Forgot to include it, update PR is #318727. Switching to draft until that's merged...

@melvyn2 melvyn2 marked this pull request as draft June 14, 2024 06:19
@melvyn2
Copy link
Contributor Author

melvyn2 commented Jul 4, 2024

Closing in favor of #318727

@melvyn2 melvyn2 closed this Jul 4, 2024
@melvyn2 melvyn2 mentioned this pull request Jul 4, 2024
13 tasks
@melvyn2 melvyn2 deleted the seafile-data branch September 28, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants