]> git.immae.eu Git - perso/Immae/Config/Nix.git/blobdiff - modules/private/websites/tools/git/default.nix
Migrate php sessions to redis
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / git / default.nix
index 054e47bec2bc5405285f1aafa0be336227782f73..47a91e542efa16bff9921d896844301b73644e0e 100644 (file)
@@ -3,6 +3,7 @@ let
     mantisbt = pkgs.callPackage ./mantisbt.nix {
       inherit (pkgs.webapps) mantisbt_2 mantisbt_2-plugins;
       env = config.myEnv.tools.mantisbt;
+      inherit config;
     };
     gitweb = pkgs.callPackage ./gitweb.nix {
       gitoliteDir = config.myServices.gitolite.gitoliteDir;
@@ -15,14 +16,35 @@ in {
   };
 
   config = lib.mkIf cfg.enable {
+    myServices.chatonsProperties.services.mantisbt = {
+      file.datetime = "2022-08-21T10:08:00";
+      service = {
+        name = "MantisBT";
+        description = "Mantis Bug Tracker";
+        website = "https://git.immae.eu/mantisbt";
+        logo = "https://git.immae.eu/mantisbt/images/favicon.ico";
+        status.level = "OK";
+        status.description = "OK";
+        registration."" = ["MEMBER" "CLIENT"];
+        registration.load = "OPEN";
+        install.type = "PACKAGE";
+        guide.user = "https://www.immae.eu/docs/forge-logicielle.html";
+      };
+      software = {
+        name = "MantisBT";
+        website = "https://mantisbt.org/";
+        license.url = "https://opensource.org/licenses/gpl-license";
+        license.name = "GNU General Public License";
+        version = mantisbt.webRoot.version;
+        source.url = "https://github.com/mantisbt/mantisbt";
+        modules = mantisbt.webRoot.pluginNames;
+      };
+    };
     secrets.keys = mantisbt.keys;
     services.websites.env.tools.modules =
       gitweb.apache.modules ++
       mantisbt.apache.modules;
-    myServices.websites.webappDirs."${gitweb.apache.webappName}" = gitweb.webRoot;
-    myServices.websites.webappDirs."${mantisbt.apache.webappName}" = mantisbt.webRoot;
 
-    system.activationScripts.mantisbt = mantisbt.activationScript;
     services.websites.env.tools.vhostConfs.git = {
       certName    = "eldiron";
       addToCerts  = true;
@@ -30,7 +52,7 @@ in {
       root        = gitweb.apache.root;
       extraConfig = [
         gitweb.apache.vhostConf
-        mantisbt.apache.vhostConf
+        (mantisbt.apache.vhostConf config.services.phpfpm.pools.mantisbt.socket)
         ''
           RewriteEngine on
           RewriteCond %{REQUEST_URI}       ^/releases
@@ -40,8 +62,10 @@ in {
     };
     services.phpfpm.pools = {
       mantisbt = {
-        listen = mantisbt.phpFpm.socket;
-        extraConfig = mantisbt.phpFpm.pool;
+        user = config.services.httpd.Tools.user;
+        group = config.services.httpd.Tools.group;
+        settings = mantisbt.phpFpm.pool;
+        phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]);
       };
     };
   };