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