]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame_incremental - systems/eldiron/websites/git/mantisbt.nix
Move backup directory to host subdir
[perso/Immae/Config/Nix.git] / systems / eldiron / websites / git / mantisbt.nix
... / ...
CommitLineData
1{ env, mantisbt_2, mantisbt_2-plugins, config }:
2rec {
3 keys."webapps/tools-mantisbt" = {
4 user = apache.user;
5 group = apache.group;
6 permissions = "0400";
7 text = ''
8 <?php
9 $g_admin_checks = OFF;
10 $g_reauthentication = OFF;
11 $g_reauthentication_expiry = 604800;
12 $g_path = 'https://git.immae.eu/mantisbt/';
13 $g_hostname = '${env.postgresql.socket}';
14 $g_db_username = '${env.postgresql.user}';
15 $g_db_password = '${env.postgresql.password}';
16 $g_database_name = '${env.postgresql.database}';
17 $g_db_type = 'pgsql';
18 $g_crypto_master_salt = '${env.master_salt}';
19 $g_allow_signup = OFF;
20 $g_allow_anonymous_login = ON;
21 $g_anonymous_account = 'anonymous';
22
23 $g_phpMailer_method = PHPMAILER_METHOD_SENDMAIL;
24 $g_smtp_host = 'localhost';
25 $g_smtp_username = ''';
26 $g_smtp_password = ''';
27 $g_webmaster_email = 'mantisbt@tools.immae.eu';
28 $g_from_email = 'mantisbt@tools.immae.eu';
29 $g_return_path_email = 'mantisbt@tools.immae.eu';
30 $g_from_name = 'Mantis Bug Tracker at git.immae.eu';
31 $g_email_receive_own = ON;
32 # --- LDAP ---
33 $g_login_method = LDAP;
34 $g_ldap_protocol_version = 3;
35 $g_ldap_server = 'ldaps://${env.ldap.host}:636';
36 $g_ldap_use_starttls = OFF;
37 $g_ldap_root_dn = 'ou=users,${env.ldap.base}';
38 $g_ldap_bind_dn = '${env.ldap.dn}';
39 $g_ldap_bind_passwd = '${env.ldap.password}';
40 $g_use_ldap_email = ON;
41 $g_use_ldap_realname = ON;
42 $g_ldap_uid_field = 'uid';
43 $g_ldap_realname_field = 'cn';
44 $g_ldap_organization = '${env.ldap.filter}';
45 '';
46 };
47 webRoot = (mantisbt_2.override { mantis_config =
48 config.secrets.fullPaths."webapps/tools-mantisbt"; }).withPlugins (p: [p.slack p.source-integration ]);
49 apache = rec {
50 user = "wwwrun";
51 group = "wwwrun";
52 modules = [ "proxy_fcgi" ];
53 root = webRoot;
54 vhostConf = socket: ''
55 Alias /mantisbt "${root}"
56 <Directory "${root}">
57 DirectoryIndex index.php
58 <FilesMatch "\.php$">
59 SetHandler "proxy:unix:${socket}|fcgi://localhost"
60 </FilesMatch>
61
62 AllowOverride All
63 SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
64 Options FollowSymlinks
65 Require all granted
66 </Directory>
67 <Directory "${root}/admin">
68 #Reenable during upgrade
69 Require all denied
70 </Directory>
71 '';
72 };
73 phpFpm = rec {
74 serviceDeps = [ "postgresql.service" "openldap.service" ];
75 basedir = builtins.concatStringsSep ":" (
76 [ webRoot config.secrets.fullPaths."webapps/tools-mantisbt" ]
77 ++ webRoot.plugins);
78 pool = {
79 "listen.owner" = apache.user;
80 "listen.group" = apache.group;
81 "pm" = "ondemand";
82 "pm.max_children" = "60";
83 "pm.process_idle_timeout" = "60";
84
85 "php_admin_value[upload_max_filesize]" = "5000000";
86
87 "php_admin_value[open_basedir]" = "${basedir}:/tmp";
88 "php_admin_value[session.save_handler]" = "redis";
89 "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=Tools:MantisBT:'";
90 };
91 };
92}