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

autobrr: init at 1.51.0 #287593

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

autobrr: init at 1.51.0 #287593

wants to merge 3 commits into from

Conversation

av-gal
Copy link

@av-gal av-gal commented Feb 9, 2024

Description of changes

Reopening #283389. Closes #224560.

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: documentation 8.has: changelog 8.has: module (update) This PR changes an existing module in `nixos/` labels Feb 9, 2024
Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

Three commits please:

  • maintainers: add av-gal
  • autobrr: init at 1.36.0
  • nixos/autobrr: init

maintainers/maintainer-list.nix Outdated Show resolved Hide resolved
nixos/doc/manual/release-notes/rl-2405.section.md Outdated Show resolved Hide resolved
nixos/modules/module-list.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autobrr/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autobrr/package.nix Show resolved Hide resolved
pkgs/by-name/au/autobrr/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autobrr/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autobrr/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autobrr/package.nix Outdated Show resolved Hide resolved
@dotlambda dotlambda changed the title Autobrr: add package/module/test for autobrr, attempt #2 autobrr: init at 1.36.0 Feb 9, 2024
@av-gal av-gal force-pushed the autobrr branch 2 times, most recently from b9da876 to f8fbc72 Compare February 9, 2024 22:55
av-gal

This comment was marked as duplicate.

@av-gal av-gal requested a review from dotlambda February 9, 2024 22:57
@av-gal
Copy link
Author

av-gal commented Feb 9, 2024

I think I've addressed all remaining concerns. @ambroisie please let me know if I've missed anything from your original review.

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

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

There should be a settings option to create config.toml. See NixOS/rfcs#42.

DynamicUser = true;
StateDirectory = "autobrr";
StateDirectoryMode = "0700";
ExecStart = "${pkgs.autobrr}/bin/autobrr --config '${WorkingDirectory}'";
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
ExecStart = "${pkgs.autobrr}/bin/autobrr --config '${WorkingDirectory}'";
ExecStart = "${lib.getExe pkgs.autobrr} --config '${WorkingDirectory}'";


vendorHash = "sha256-SkwSKFEZAmjVnaSowIbrdH667vB5WqNrPuRs/Yh6BLc=";

preBuild = "cp -r ${autobrr-web}/* web/dist";
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
preBuild = "cp -r ${autobrr-web}/* web/dist";
preBuild = ''
cp -r ${autobrr-web}/* web/dist
'';

DynamicUser = true;
StateDirectory = "autobrr";
StateDirectoryMode = "0700";
ExecStart = "${pkgs.autobrr}/bin/autobrr --config '${WorkingDirectory}'";
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is WorkingDirectory defined?

Copy link
Contributor

Choose a reason for hiding this comment

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

And please use lib.getExe:

Suggested change
ExecStart = "${pkgs.autobrr}/bin/autobrr --config '${WorkingDirectory}'";
ExecStart = "${lib.getExe pkgs.autobrr} --config '${WorkingDirectory}'";

Copy link
Member

Choose a reason for hiding this comment

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

We don't necessarily need WorkingDirectory

pkgs/by-name/au/autobrr/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/au/autobrr/package.nix Show resolved Hide resolved
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 labels Feb 9, 2024
@h7x4 h7x4 added 8.has: module (new) This PR adds a module in `nixos/` 8.has: tests This PR has tests labels Feb 10, 2024
@@ -0,0 +1,70 @@
{ config, pkgs, lib, ... }:

with lib;
Copy link
Member

Choose a reason for hiding this comment

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

consider inherits where you find yourself using lib.* excessively.
this nix.dev page on best practices with with may be helpful
an issue (#208242) has been made to track inappropriate uses of with such as this.

Copy link
Member

Choose a reason for hiding this comment

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

Just prefix the used library function with lib..

nixos/modules/services/misc/autobrr.nix Outdated Show resolved Hide resolved
@zze0s
Copy link

zze0s commented Feb 14, 2024

We just released v1.38.0 so might be a good idea to bump the version in this pr 😄

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
@muradbu
Copy link

muradbu commented Jul 23, 2024

Is this still being worked on?

@av-gal
Copy link
Author

av-gal commented Nov 22, 2024

I plan on picking this up again shortly.

@zze0s
Copy link

zze0s commented Nov 22, 2024

Great! The move to pnpm was the most recent big build related changes but other than that it should be smooth sailing.

Current version is 1.50.0 :)

@muradbu
Copy link

muradbu commented Nov 22, 2024

I plan on picking this up again shortly.

Can I assist you with anything?

@av-gal av-gal marked this pull request as draft November 25, 2024 06:07
@av-gal av-gal changed the title autobrr: init at 1.36.0 autobrr: init at 1.51.0 Nov 25, 2024
@github-actions github-actions bot added the 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` label Nov 25, 2024
@av-gal
Copy link
Author

av-gal commented Nov 25, 2024

I think I've got it mostly figured out. I'm just not sure how to handle the session secret. Ideally autobrr's config.toml would be created from the NixOS module's settings, but I believe this would cause it to be added to the nix store. Which is problematic, since the nix store is world-readable, and that file also contains the secret for cookie authentication.

Any suggestions on how to avoid this?

@BatteredBunny
Copy link
Contributor

Any suggestions on how to avoid this?

https://github.com/autobrr/autobrr/blob/e2df1e4fb8e501fbf1b81b1878c2ae472bf7d62b/internal/config/config.go#L246-L354
I think optimal is to add an environmentFile option and specify the secrets in there, since autobrr has env var support

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog 8.has: documentation 8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 8.has: tests This PR has tests 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes awaiting_changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: autobrr