1 { lib, env, writeText, stdenv, fetchurl, fetchedGithub }:
5 slack = stdenv.mkDerivation (fetchedGithub ./mantisbt-plugin-slack.json // rec {
7 sed -i -e "s/return '@' . \\\$username;/return \\\$username;/" Slack.php
11 source-integration = stdenv.mkDerivation (fetchedGithub ./mantisbt-plugin-source-integration.json // rec {
14 patch -p1 < ${./mantisbt-plugin-source-integration_Source.API.php.diff}
21 writeText "config_inc.php" ''
23 $g_hostname = '${env.postgresql.socket}';
24 $g_db_username = '${env.postgresql.user}';
25 $g_db_password = '${env.postgresql.password}';
26 $g_database_name = '${env.postgresql.database}';
28 $g_crypto_master_salt = '${env.master_salt}';
29 $g_allow_signup = OFF;
30 $g_allow_anonymous_login = ON;
31 $g_anonymous_account = 'anonymous';
33 $g_phpMailer_method = PHPMAILER_METHOD_SENDMAIL;
34 $g_smtp_host = 'localhost';
35 $g_smtp_username = ''';
36 $g_smtp_password = ''';
37 $g_webmaster_email = 'mantisbt@tools.immae.eu';
38 $g_from_email = 'mantisbt@tools.immae.eu';
39 $g_return_path_email = 'mantisbt@tools.immae.eu';
40 $g_from_name = 'Mantis Bug Tracker at git.immae.eu';
41 $g_email_receive_own = OFF;
43 $g_login_method = LDAP;
44 $g_ldap_protocol_version = 3;
45 $g_ldap_server = 'ldaps://ldap.immae.eu:636';
46 $g_ldap_root_dn = 'ou=users,dc=immae,dc=eu';
47 $g_ldap_bind_dn = 'cn=mantisbt,ou=services,dc=immae,dc=eu';
48 $g_ldap_bind_passwd = '${env.ldap.password}';
49 $g_use_ldap_email = ON;
50 $g_use_ldap_realname = ON;
51 $g_ldap_uid_field = 'uid';
52 $g_ldap_realname_field = 'cn';
53 $g_ldap_organization = '(memberOf=cn=users,cn=mantisbt,ou=services,dc=immae,dc=eu)';
55 webRoot = stdenv.mkDerivation rec {
56 name = "mantisbt-${version}";
59 url = "https://downloads.sourceforge.net/project/mantisbt/mantis-stable/${version}/${name}.tar.gz";
60 sha256 = "0jnrqz6r2hf53v0k1lh3il7hlfiphn61r9wgg6mzyywkjxwq07md";
63 ./patches/bug_report.php.diff
64 ./patches/bug_report_page.php.diff
65 ./patches/bugnote_add.php.diff
66 ./patches/bugnote_add_inc.php.diff
70 ln -s ${config} $out/config/config_inc.php
71 ln -s ${plugins.slack} $out/plugins/Slack
72 ln -s ${plugins.source-integration}/Source* $out/plugins/
78 modules = [ "proxy_fcgi" ];
79 webappName = "tools_mantisbt";
80 root = "/run/current-system/webapps/${webappName}";
82 Alias /mantisbt "${root}"
84 DirectoryIndex index.php
86 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
90 Options FollowSymlinks
93 <Directory "${root}/admin">
94 #Reenable during upgrade
100 basedir = builtins.concatStringsSep ":" (
102 ++ lib.attrsets.mapAttrsToList (name: value: value) plugins);
103 socket = "/var/run/phpfpm/mantisbt.sock";
106 user = ${apache.user}
107 group = ${apache.group}
108 listen.owner = ${apache.user}
109 listen.group = ${apache.group}
112 pm.process_idle_timeout = 60
114 php_admin_value[upload_max_filesize] = 5000000
116 php_admin_value[open_basedir] = "${basedir}:/tmp"
117 php_admin_value[session.save_path] = "/var/lib/php/sessions/mantisbt"