summary refs log tree commit diff
diff options
context:
space:
mode:
authorRodney Lorrimar <dev@rodney.id.au>2017-04-23 16:26:56 +0100
committerRodney Lorrimar <dev@rodney.id.au>2017-04-23 16:27:43 +0100
commitced172010ac7ddee063a55c67da4cd6b443d02cb (patch)
treee57928b839828aa4ba65ea8297b812cbace72721
parent0e90a05a526be87ecf8c3d8d3849bd42d1cd4539 (diff)
downloadnixpkgs-ced172010ac7ddee063a55c67da4cd6b443d02cb.tar
nixpkgs-ced172010ac7ddee063a55c67da4cd6b443d02cb.tar.gz
nixpkgs-ced172010ac7ddee063a55c67da4cd6b443d02cb.tar.bz2
nixpkgs-ced172010ac7ddee063a55c67da4cd6b443d02cb.tar.lz
nixpkgs-ced172010ac7ddee063a55c67da4cd6b443d02cb.tar.xz
nixpkgs-ced172010ac7ddee063a55c67da4cd6b443d02cb.tar.zst
nixpkgs-ced172010ac7ddee063a55c67da4cd6b443d02cb.zip
gogs service: add option for enabling "secure" cookies
-rw-r--r--nixos/modules/services/misc/gogs.nix14
1 files changed, 14 insertions, 0 deletions
diff --git a/nixos/modules/services/misc/gogs.nix b/nixos/modules/services/misc/gogs.nix
index e966a50b9ec..d42367761ab 100644
--- a/nixos/modules/services/misc/gogs.nix
+++ b/nixos/modules/services/misc/gogs.nix
@@ -26,6 +26,10 @@ let
     HTTP_PORT = ${toString cfg.httpPort}
     ROOT_URL = ${cfg.rootUrl}
 
+    [session]
+    COOKIE_NAME = session
+    COOKIE_SECURE = ${boolToString cfg.cookieSecure}
+
     [security]
     SECRET_KEY = #secretkey#
     INSTALL_LOCK = true
@@ -162,6 +166,16 @@ in
         description = "HTTP listen port.";
       };
 
+      cookieSecure = mkOption {
+        type = types.bool;
+        default = false;
+        description = ''
+          Marks session cookies as "secure," which means browsers may
+          ensure that the cookie is only sent under an HTTPS connection.
+          It's good to enable this if Gogs is being served over HTTPS.
+        '';
+      };
+
       extraConfig = mkOption {
         type = types.str;
         default = "";