about summary refs log tree commit diff
path: root/nixos/modules/services/web-apps/atlassian/confluence.nix
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2017-09-02 23:29:04 +0200
committerRobin Gloster <mail@glob.in>2017-09-02 23:29:04 +0200
commit0156db2da530a52265fbccc8ad7747b00ee8aaf3 (patch)
treef5facfdd70ac838997ed0538fd9f4e8edffe9936 /nixos/modules/services/web-apps/atlassian/confluence.nix
parent891a1662aa6cd6b2bcd2187d97f27822ed5df138 (diff)
parentd784b830051bb86172b9a3669826774cc20e1f41 (diff)
downloadnixlib-0156db2da530a52265fbccc8ad7747b00ee8aaf3.tar
nixlib-0156db2da530a52265fbccc8ad7747b00ee8aaf3.tar.gz
nixlib-0156db2da530a52265fbccc8ad7747b00ee8aaf3.tar.bz2
nixlib-0156db2da530a52265fbccc8ad7747b00ee8aaf3.tar.lz
nixlib-0156db2da530a52265fbccc8ad7747b00ee8aaf3.tar.xz
nixlib-0156db2da530a52265fbccc8ad7747b00ee8aaf3.tar.zst
nixlib-0156db2da530a52265fbccc8ad7747b00ee8aaf3.zip
Merge remote-tracking branch 'upstream/master' into HEAD
Diffstat (limited to 'nixos/modules/services/web-apps/atlassian/confluence.nix')
-rw-r--r--nixos/modules/services/web-apps/atlassian/confluence.nix53
1 files changed, 52 insertions, 1 deletions
diff --git a/nixos/modules/services/web-apps/atlassian/confluence.nix b/nixos/modules/services/web-apps/atlassian/confluence.nix
index c1d7d4ea06d4..2344b9922d0b 100644
--- a/nixos/modules/services/web-apps/atlassian/confluence.nix
+++ b/nixos/modules/services/web-apps/atlassian/confluence.nix
@@ -6,7 +6,22 @@ let
 
   cfg = config.services.confluence;
 
-  pkg = pkgs.atlassian-confluence;
+  pkg = pkgs.atlassian-confluence.override (optionalAttrs cfg.sso.enable {
+    enableSSO = cfg.sso.enable;
+    crowdProperties = ''
+      application.name                        ${cfg.sso.applicationName}
+      application.password                    ${cfg.sso.applicationPassword}
+      application.login.url                   ${cfg.sso.crowd}/console/
+
+      crowd.server.url                        ${cfg.sso.crowd}/services/
+      crowd.base.url                          ${cfg.sso.crowd}/
+
+      session.isauthenticated                 session.isauthenticated
+      session.tokenkey                        session.tokenkey
+      session.validationinterval              ${toString cfg.sso.validationInterval}
+      session.lastvalidation                  session.lastvalidation
+    '';
+  });
 
 in
 
@@ -76,6 +91,42 @@ in
         };
       };
 
+      sso = {
+        enable = mkEnableOption "SSO with Atlassian Crowd";
+
+        crowd = mkOption {
+          type = types.str;
+          example = "http://localhost:8095/crowd";
+          description = "Crowd Base URL without trailing slash";
+        };
+
+        applicationName = mkOption {
+          type = types.str;
+          example = "jira";
+          description = "Exact name of this Confluence instance in Crowd";
+        };
+
+        applicationPassword = mkOption {
+          type = types.str;
+          description = "Application password of this Confluence instance in Crowd";
+        };
+
+        validationInterval = mkOption {
+          type = types.int;
+          default = 2;
+          example = 0;
+          description = ''
+            Set to 0, if you want authentication checks to occur on each
+            request. Otherwise set to the number of minutes between request
+            to validate if the user is logged in or out of the Crowd SSO
+            server. Setting this value to 1 or higher will increase the
+            performance of Crowd's integration.
+          '';
+        };
+      };
+
+
+
       jrePackage = let
         jreSwitch = unfree: free: if config.nixpkgs.config.allowUnfree or false then unfree else free;
       in mkOption {