]>
Commit | Line | Data |
---|---|---|
da30ae4f | 1 | { env, mantisbt_2, mantisbt_2-plugins, config }: |
43dac87f | 2 | rec { |
4c4652aa | 3 | keys."webapps/tools-mantisbt" = { |
43dac87f IB |
4 | user = apache.user; |
5 | group = apache.group; | |
6 | permissions = "0400"; | |
7 | text = '' | |
8 | <?php | |
60351295 IB |
9 | $g_admin_checks = OFF; |
10 | $g_reauthentication = OFF; | |
11 | $g_reauthentication_expiry = 604800; | |
12 | $g_path = 'https://git.immae.eu/mantisbt/'; | |
43dac87f IB |
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'; | |
619e4f46 | 31 | $g_email_receive_own = ON; |
43dac87f IB |
32 | # --- LDAP --- |
33 | $g_login_method = LDAP; | |
34 | $g_ldap_protocol_version = 3; | |
ab8f306d | 35 | $g_ldap_server = 'ldaps://${env.ldap.host}:636'; |
60351295 | 36 | $g_ldap_use_starttls = OFF; |
ab8f306d IB |
37 | $g_ldap_root_dn = 'ou=users,${env.ldap.base}'; |
38 | $g_ldap_bind_dn = '${env.ldap.dn}'; | |
43dac87f IB |
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'; | |
ab8f306d | 44 | $g_ldap_organization = '${env.ldap.filter}'; |
43dac87f | 45 | ''; |
4c4652aa | 46 | }; |
60351295 IB |
47 | webRoot = (mantisbt_2.override { mantis_config = |
48 | config.secrets.fullPaths."webapps/tools-mantisbt"; }).withPlugins (p: [p.slack p.source-integration ]); | |
43dac87f IB |
49 | apache = rec { |
50 | user = "wwwrun"; | |
51 | group = "wwwrun"; | |
52 | modules = [ "proxy_fcgi" ]; | |
750fe5a4 | 53 | root = webRoot; |
5400b9b6 | 54 | vhostConf = socket: '' |
43dac87f IB |
55 | Alias /mantisbt "${root}" |
56 | <Directory "${root}"> | |
57 | DirectoryIndex index.php | |
58 | <FilesMatch "\.php$"> | |
5400b9b6 | 59 | SetHandler "proxy:unix:${socket}|fcgi://localhost" |
43dac87f IB |
60 | </FilesMatch> |
61 | ||
62 | AllowOverride All | |
05a3b252 | 63 | SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 |
43dac87f IB |
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 ":" ( | |
da30ae4f | 76 | [ webRoot config.secrets.fullPaths."webapps/tools-mantisbt" ] |
43dac87f | 77 | ++ webRoot.plugins); |
5400b9b6 IB |
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"; | |
43dac87f | 84 | |
5400b9b6 | 85 | "php_admin_value[upload_max_filesize]" = "5000000"; |
43dac87f | 86 | |
1a64deeb IB |
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:'"; | |
5400b9b6 | 90 | }; |
43dac87f IB |
91 | }; |
92 | } |