Skip to content

Commit

Permalink
fix(torrserver): replace auth method
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtnvgr committed Apr 6, 2024
1 parent f7bce8d commit fbfc57b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions modules/server/misc/torrserver/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,26 @@ in {
Group = "torrserver";
Type = "simple";
NonBlocking = true;
WorkingDirectory = "/var/lib/torrserver";
WorkingDirectory = "/etc/torrserver";
ExecStart = "${pkg}/bin/torrserver --port ${toString cfg.port}";
ExecReload = "/bin/sh kill -HUP \${MAINPID}";
ExecStop = "/bin/sh kill -INT \${MAINPID}";
TimeoutSec = 30;
Restart = "on-failure";
RestartSec = "5s";
StateDirectory = "torrserver";
# note: StateDirectory = "torrserver";
};

wantedBy = [ "multi-user.target" ];
};

system.activationScripts.torrserver = lib.stringAfter [ "var" ] ''
mkdir -p /etc/torrserver
chown -R torrserver:torrserver /etc/torrserver
'';

environment.etc."torrserver/accs.db".text = mkIf webIsSupported (builtins.toJSON cfg.users);

users.groups.torrserver = {};
users.users.torrserver = {
group = "torrserver";
Expand All @@ -79,8 +86,6 @@ in {
services.nginx.virtualHosts."ts.${domain}" = mkIf webIsSupported {
locations."/".proxyPass = "http://localhost:${toString cfg.port}";

basicAuth = cfg.users;

enableACME = true;
forceSSL = true;
};
Expand Down

0 comments on commit fbfc57b

Please sign in to comment.