diff --git a/machines/gerd/services/authelia/authelia.nix b/machines/gerd/services/authelia/authelia.nix index 0d882c1..da8d007 100644 --- a/machines/gerd/services/authelia/authelia.nix +++ b/machines/gerd/services/authelia/authelia.nix @@ -10,9 +10,16 @@ let in { services.authelia.instances.main = { enable = true; - package = pkgs.authelia.overrideAttrs { - patches = [ ./patches/remember-me-by-default.patch ]; - }; + package = pkgs.authelia.override (p: { + web = let + orig_web = pkgs.callPackage "${pkgs.path}/pkgs/servers/authelia/web.nix" { inherit (p) nodejs pnpm fetchFromGitHub; }; + in orig_web.overrideAttrs (old: { + postPatch = old.postPatch + '' + substituteInPlace src/views/LoginPortal/FirstFactor/FirstFactorForm.tsx \ + --replace-fail "const [rememberMe, setRememberMe] = useState(false)" "const [rememberMe, setRememberMe] = useState(true)" + ''; + }); + }); environmentVariables.AUTHELIA_AUTHENTICATION_BACKEND_LDAP_PASSWORD_FILE = config.age.secrets.lldap-bind-user-pass.path; environmentVariables.AUTHELIA_NOTIFIER_SMTP_PASSWORD_FILE = config.age.secrets.authelia-smtp-password.path; diff --git a/machines/gerd/services/authelia/patches/remember-me-by-default.patch b/machines/gerd/services/authelia/patches/remember-me-by-default.patch deleted file mode 100644 index 756e23c..0000000 --- a/machines/gerd/services/authelia/patches/remember-me-by-default.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/web/src/views/LoginPortal/FirstFactor/FirstFactorForm.tsx b/web/src/views/LoginPortal/FirstFactor/FirstFactorForm.tsx -index 6bbeda992..d08ade4c3 100644 ---- a/web/src/views/LoginPortal/FirstFactor/FirstFactorForm.tsx -+++ b/web/src/views/LoginPortal/FirstFactor/FirstFactorForm.tsx -@@ -42,7 +42,7 @@ const FirstFactorForm = function (props: Props) { - - const loginChannel = useMemo(() => new BroadcastChannel("login"), []); - -- const [rememberMe, setRememberMe] = useState(false); -+ const [rememberMe, setRememberMe] = useState(true); - const [username, setUsername] = useState(""); - const [usernameError, setUsernameError] = useState(false); - const [password, setPassword] = useState(""); diff --git a/shared/sources/default.nix b/shared/sources/default.nix index cef1cbe..7976278 100644 --- a/shared/sources/default.nix +++ b/shared/sources/default.nix @@ -18,6 +18,30 @@ in sources // { # url = "https://github.com/NixOS/nixpkgs/pull/353360.patch"; # sha256 = "sha256-WPNnvVmtySyEk58kVIYWVx3VN8MhX4v2ITLLnUGhpz4="; # }) + (pkgs.writeText "authelia.patch" '' + diff --git a/pkgs/servers/authelia/default.nix b/pkgs/servers/authelia/default.nix + index 2c49c09b0550..35f0827f89d7 100644 + --- a/pkgs/servers/authelia/default.nix + +++ b/pkgs/servers/authelia/default.nix + @@ -7,6 +7,7 @@ + installShellFiles, + callPackage, + nixosTests, + + web ? callPackage ./web.nix { inherit nodejs pnpm fetchFromGitHub; }, + }: + + let + @@ -16,7 +17,7 @@ let + src + vendorHash + ; + - web = callPackage ./web.nix { inherit nodejs pnpm fetchFromGitHub; }; + + # web = callPackage ./web.nix { inherit nodejs pnpm fetchFromGitHub; }; + in + buildGoModule rec { + inherit + + '') ]; }; }