]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - systems/eldiron/websites/git/default.nix
Squash changes containing private information
[perso/Immae/Config/Nix.git] / systems / eldiron / websites / git / default.nix
1 { lib, pkgs, config, ... }:
2 let
3 mantisbt = pkgs.callPackage ./mantisbt.nix {
4 mantisbt_2 = pkgs.webapps-mantisbt_2;
5 mantisbt_2-plugins = pkgs.webapps-mantisbt_2-plugins;
6 env = config.myEnv.tools.mantisbt;
7 inherit config;
8 };
9 gitweb = pkgs.callPackage ./gitweb.nix {
10 gitoliteDir = config.myServices.gitolite.gitoliteDir;
11 };
12
13 cfg = config.myServices.websites.tools.git;
14 in {
15 options.myServices.websites.tools.git = {
16 enable = lib.mkEnableOption "enable git's website";
17 };
18
19 config = lib.mkIf cfg.enable {
20 myServices.chatonsProperties.services.mantisbt = {
21 file.datetime = "2022-08-21T10:08:00";
22 service = {
23 name = "MantisBT";
24 description = "Mantis Bug Tracker";
25 website = "https://git.immae.eu/mantisbt";
26 logo = "https://git.immae.eu/mantisbt/images/favicon.ico";
27 status.level = "OK";
28 status.description = "OK";
29 registration."" = ["MEMBER" "CLIENT"];
30 registration.load = "OPEN";
31 install.type = "PACKAGE";
32 guide.user = "https://www.immae.eu/docs/forge-logicielle.html";
33 };
34 software = {
35 name = "MantisBT";
36 website = "https://mantisbt.org/";
37 license.url = "https://opensource.org/licenses/gpl-license";
38 license.name = "GNU General Public License";
39 version = mantisbt.webRoot.version;
40 source.url = "https://github.com/mantisbt/mantisbt";
41 modules = mantisbt.webRoot.pluginNames;
42 };
43 };
44 secrets.keys = mantisbt.keys;
45 services.websites.env.tools.modules =
46 gitweb.apache.modules ++
47 mantisbt.apache.modules;
48
49 security.acme.certs.eldiron.extraDomainNames = [ "git.immae.eu" ];
50 services.websites.env.tools.vhostConfs.git = {
51 certName = "eldiron";
52 hosts = ["git.immae.eu" ];
53 root = gitweb.apache.root;
54 extraConfig = [
55 gitweb.apache.vhostConf
56 (mantisbt.apache.vhostConf config.services.phpfpm.pools.mantisbt.socket)
57 ''
58 RewriteEngine on
59 RewriteCond %{REQUEST_URI} ^/releases
60 RewriteRule /releases(.*) https://release.immae.eu$1 [P,L]
61 ''
62 ];
63 };
64 services.phpfpm.pools = {
65 mantisbt = {
66 user = config.services.websites.env.tools.user;
67 group = config.services.websites.env.tools.group;
68 settings = mantisbt.phpFpm.pool;
69 phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]);
70 };
71 };
72
73 myServices.monitoring.fromMasterActivatedPlugins = [ "http" ];
74 myServices.monitoring.fromMasterObjects.service = [
75 {
76 service_description = "gitweb website is running on git.immae.eu";
77 host_name = config.hostEnv.fqdn;
78 use = "external-web-service";
79 check_command = ["check_https" "git.immae.eu" "/cgit" "<title>Immae’s git"];
80
81 servicegroups = "webstatus-webapps";
82 _webstatus_name = "Git";
83 _webstatus_url = "https://git.immae.eu/";
84 }
85
86 {
87 service_description = "mantisbt website is running on git.immae.eu";
88 host_name = config.hostEnv.fqdn;
89 use = "external-web-service";
90 check_command = ["check_https" "git.immae.eu" "/mantisbt/" "<title>My View - MantisBT"];
91
92 servicegroups = "webstatus-webapps";
93 _webstatus_name = "Mantisbt";
94 _webstatus_url = "https://git.immae.eu/mantisbt";
95 }
96 ];
97 };
98 }