diff options
Diffstat (limited to 'systems/eldiron/websites/git/mantisbt.nix')
-rw-r--r-- | systems/eldiron/websites/git/mantisbt.nix | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/systems/eldiron/websites/git/mantisbt.nix b/systems/eldiron/websites/git/mantisbt.nix new file mode 100644 index 0000000..3bd78e1 --- /dev/null +++ b/systems/eldiron/websites/git/mantisbt.nix | |||
@@ -0,0 +1,86 @@ | |||
1 | { env, mantisbt_2, mantisbt_2-plugins, config }: | ||
2 | rec { | ||
3 | keys."webapps/tools-mantisbt" = { | ||
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'; | ||
27 | $g_email_receive_own = ON; | ||
28 | # --- LDAP --- | ||
29 | $g_login_method = LDAP; | ||
30 | $g_ldap_protocol_version = 3; | ||
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}'; | ||
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'; | ||
39 | $g_ldap_organization = '${env.ldap.filter}'; | ||
40 | ''; | ||
41 | }; | ||
42 | webRoot = (mantisbt_2.override { mantis_config = config.secrets.fullPaths."webapps/tools-mantisbt"; }).withPlugins (p: [p.slack p.source-integration]); | ||
43 | apache = rec { | ||
44 | user = "wwwrun"; | ||
45 | group = "wwwrun"; | ||
46 | modules = [ "proxy_fcgi" ]; | ||
47 | root = webRoot; | ||
48 | vhostConf = socket: '' | ||
49 | Alias /mantisbt "${root}" | ||
50 | <Directory "${root}"> | ||
51 | DirectoryIndex index.php | ||
52 | <FilesMatch "\.php$"> | ||
53 | SetHandler "proxy:unix:${socket}|fcgi://localhost" | ||
54 | </FilesMatch> | ||
55 | |||
56 | AllowOverride All | ||
57 | SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 | ||
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 ":" ( | ||
70 | [ webRoot config.secrets.fullPaths."webapps/tools-mantisbt" ] | ||
71 | ++ webRoot.plugins); | ||
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"; | ||
78 | |||
79 | "php_admin_value[upload_max_filesize]" = "5000000"; | ||
80 | |||
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:'"; | ||
84 | }; | ||
85 | }; | ||
86 | } | ||