From c96b3793c4288e618c8ab5e925b3b397ecad7ca0 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 12 Aug 2021 13:39:35 +0800 Subject: [PATCH] rt: persistent sessions --- nixbld-etc-nixos/configuration.nix | 3 +++ nixbld-etc-nixos/rt-session.patch | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 nixbld-etc-nixos/rt-session.patch diff --git a/nixbld-etc-nixos/configuration.nix b/nixbld-etc-nixos/configuration.nix index 4dbf7343..30df87f2 100644 --- a/nixbld-etc-nixos/configuration.nix +++ b/nixbld-etc-nixos/configuration.nix @@ -759,6 +759,9 @@ in services.rt = { enable = true; + package = pkgs.rt.overrideAttrs(oa: { + patches = oa.patches or [] ++ [ ./rt-session.patch ]; + }); organization = "M-Labs"; domain = "rt.m-labs.hk"; rtName = "Helpdesk"; diff --git a/nixbld-etc-nixos/rt-session.patch b/nixbld-etc-nixos/rt-session.patch new file mode 100644 index 00000000..9e7bb22d --- /dev/null +++ b/nixbld-etc-nixos/rt-session.patch @@ -0,0 +1,11 @@ +diff '--color=auto' -Naur rt-5.0.1/lib/RT/Interface/Web.pm rtpatched/lib/RT/Interface/Web.pm +--- rt-5.0.1/lib/RT/Interface/Web.pm 1970-01-01 08:00:01.000000000 +0800 ++++ rtpatched/lib/RT/Interface/Web.pm 2021-08-12 13:34:08.870669968 +0800 +@@ -948,6 +948,7 @@ + -path => RT->Config->Get('WebPath'), + -secure => ( RT->Config->Get('WebSecureCookies') ? 1 : 0 ), + -httponly => ( RT->Config->Get('WebHttpOnlyCookies') ? 1 : 0 ), ++ -expires => '+6M', + ); + + $HTML::Mason::Commands::r->err_headers_out->{'Set-Cookie'} = $cookie->as_string;