Author: viric
Date: Sat Apr  9 16:05:36 2011
New Revision: 26768
URL: https://svn.nixos.org/websvn/nix/?rev=26768&sc=1

Log:
Making the trac module ldap-aware (for the authentication) and sqlite aware.

Modified:
   nixos/trunk/modules/services/web-servers/apache-httpd/trac.nix

Modified: nixos/trunk/modules/services/web-servers/apache-httpd/trac.nix
==============================================================================
--- nixos/trunk/modules/services/web-servers/apache-httpd/trac.nix      Sat Apr 
 9 15:51:24 2011        (r26767)
+++ nixos/trunk/modules/services/web-servers/apache-httpd/trac.nix      Sat Apr 
 9 16:05:36 2011        (r26768)
@@ -47,6 +47,23 @@
       default = "wwwrun";
       description = "Group under which Trac runs.";
     };
+
+    ldapAuthentication = {
+      enable = mkOption {
+        default = false;
+        description = "Enable the ldap authentication in trac";
+      };
+
+      url = mkOption {
+        default = 
"ldap://127.0.0.1/dc=example,dc=co,dc=ke?uid?sub?(objectClass=inetOrgPerson)";
+        description = "URL of the LDAP authentication";
+      };
+
+      name = mkOption {
+        default = "Trac server";
+        description = "AuthName";
+      };
+    };
     
   };
 
@@ -61,6 +78,16 @@
       PythonOption TracUriRoot ${config.projectsLocation}
       PythonOption PYTHON_EGG_CACHE /var/trac/egg-cache
     </Location>
+    ${if config.ldapAuthentication.enable then ''
+      <LocationMatch "^${config.projectsLocation}/[^/]+/login$">
+        AuthType Basic
+        AuthName "${config.ldapAuthentication.name}"
+        AuthBasicProvider "ldap"
+        AuthLDAPURL "${config.ldapAuthentication.url}"
+        authzldapauthoritative Off
+        require valid-user
+    '' else ""}
+    </LocationMatch>
   '';
   
   globalEnvVars = singleton
@@ -72,6 +99,7 @@
             pkgs.setuptools
             pkgs.pythonPackages.genshi
             pkgs.pythonPackages.psycopg2
+            pkgs.python.modules.sqlite3
             subversion
           ];
     };
_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to