]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/tools/git/default.nix
Migrate php sessions to redis
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / git / default.nix
1 { lib, pkgs, config, ... }:
2 let
3 mantisbt = pkgs.callPackage ./mantisbt.nix {
4 inherit (pkgs.webapps) mantisbt_2 mantisbt_2-plugins;
5 env = config.myEnv.tools.mantisbt;
6 inherit config;
7 };
8 gitweb = pkgs.callPackage ./gitweb.nix {
9 gitoliteDir = config.myServices.gitolite.gitoliteDir;
10 };
11
12 cfg = config.myServices.websites.tools.git;
13 in {
14 options.myServices.websites.tools.git = {
15 enable = lib.mkEnableOption "enable git's website";
16 };
17
18 config = lib.mkIf cfg.enable {
19 myServices.chatonsProperties.services.mantisbt = {
20 file.datetime = "2022-08-21T10:08:00";
21 service = {
22 name = "MantisBT";
23 description = "Mantis Bug Tracker";
24 website = "https://git.immae.eu/mantisbt";
25 logo = "https://git.immae.eu/mantisbt/images/favicon.ico";
26 status.level = "OK";
27 status.description = "OK";
28 registration."" = ["MEMBER" "CLIENT"];
29 registration.load = "OPEN";
30 install.type = "PACKAGE";
31 guide.user = "https://www.immae.eu/docs/forge-logicielle.html";
32 };
33 software = {
34 name = "MantisBT";
35 website = "https://mantisbt.org/";
36 license.url = "https://opensource.org/licenses/gpl-license";
37 license.name = "GNU General Public License";
38 version = mantisbt.webRoot.version;
39 source.url = "https://github.com/mantisbt/mantisbt";
40 modules = mantisbt.webRoot.pluginNames;
41 };
42 };
43 secrets.keys = mantisbt.keys;
44 services.websites.env.tools.modules =
45 gitweb.apache.modules ++
46 mantisbt.apache.modules;
47
48 services.websites.env.tools.vhostConfs.git = {
49 certName = "eldiron";
50 addToCerts = true;
51 hosts = ["git.immae.eu" ];
52 root = gitweb.apache.root;
53 extraConfig = [
54 gitweb.apache.vhostConf
55 (mantisbt.apache.vhostConf config.services.phpfpm.pools.mantisbt.socket)
56 ''
57 RewriteEngine on
58 RewriteCond %{REQUEST_URI} ^/releases
59 RewriteRule /releases(.*) https://release.immae.eu$1 [P,L]
60 ''
61 ];
62 };
63 services.phpfpm.pools = {
64 mantisbt = {
65 user = config.services.httpd.Tools.user;
66 group = config.services.httpd.Tools.group;
67 settings = mantisbt.phpFpm.pool;
68 phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]);
69 };
70 };
71 };
72 }