diff --git a/nix/pkgs/default.nix b/nix/pkgs/default.nix index 226d515441..834af7984e 100644 --- a/nix/pkgs/default.nix +++ b/nix/pkgs/default.nix @@ -16,4 +16,5 @@ intermec-cups-driver = pkgs.callPackage ./intermec-cups-driver.nix {}; pomerium = import ./pomerium args; envoy = import ./envoy args; + deluge = import ./deluge args; } // (import ./heptapod-runner.nix args) diff --git a/nix/pkgs/deluge/default.nix b/nix/pkgs/deluge/default.nix new file mode 100644 index 0000000000..555a2072fe --- /dev/null +++ b/nix/pkgs/deluge/default.nix @@ -0,0 +1,10 @@ +# SPDX-FileCopyrightText: 2020 Luke Granger-Brown +# +# SPDX-License-Identifier: Apache-2.0 + +{ pkgs, ... }: +pkgs.deluge.overrideAttrs ({ patches ? [], ... }: { + patches = patches ++ [ + ./deluge-web-try-empty-login-first.patch + ]; +}) diff --git a/nix/pkgs/deluge/deluge-web-try-empty-login-first.patch b/nix/pkgs/deluge/deluge-web-try-empty-login-first.patch new file mode 100644 index 0000000000..b635bebdd3 --- /dev/null +++ b/nix/pkgs/deluge/deluge-web-try-empty-login-first.patch @@ -0,0 +1,43 @@ +diff -ru deluge-2.0.3-orig/deluge/ui/web/js/deluge-all/LoginWindow.js deluge-2.0.3/deluge/ui/web/js/deluge-all/LoginWindow.js +--- deluge-2.0.3-orig/deluge/ui/web/js/deluge-all/LoginWindow.js 2019-06-06 16:23:52.000000000 +0000 ++++ deluge-2.0.3/deluge/ui/web/js/deluge-all/LoginWindow.js 2020-12-28 20:02:59.829316173 +0000 +@@ -66,6 +66,25 @@ + }); + }, + ++ tryLoginThenShow: function() { ++ // HACK(lukegb): try logging in with no password. ++ deluge.client.auth.login('fixedSingleSignOnPassword!', { ++ success: function(result) { ++ if (!result) { ++ this.show(true); ++ return; ++ } ++ deluge.events.fire('login'); ++ this.hide(); ++ passwordField.setRawValue(''); ++ }, ++ failure: function(result) { ++ this.show(true); ++ }, ++ scope: this, ++ }); ++ }, ++ + show: function(skipCheck) { + if (this.firstShow) { + deluge.client.on('error', this.onClientError, this); +@@ -81,11 +100,11 @@ + if (result) { + deluge.events.fire('login'); + } else { +- this.show(true); ++ this.tryLoginThenShow(); + } + }, + failure: function(result) { +- this.show(true); ++ this.tryLoginThenShow(); + }, + scope: this, + }); diff --git a/ops/nixos/clouvider-fra01/default.nix b/ops/nixos/clouvider-fra01/default.nix index 66743c7d5b..b8d8e81848 100644 --- a/ops/nixos/clouvider-fra01/default.nix +++ b/ops/nixos/clouvider-fra01/default.nix @@ -159,6 +159,7 @@ in { authFile = machineSecrets.delugeAuthFile; web.enable = true; + package = depot.pkgs.deluge; }; services.sonarr = { enable = true;