1 with import ../../libs.nix;
4 # FIXME: check that source-integration and slack still work
7 slack = stdenv.mkDerivation (fetchedGithub ./mantisbt-plugin-slack.json // rec {
9 sed -i -e "s/return '@' . \\\$username;/return \\\$username;/" Slack.php
13 source-integration = stdenv.mkDerivation (fetchedGithub ./mantisbt-plugin-source-integration.json // rec {
16 patch -p1 < ${./mantisbt-plugin-source-integration_Source.API.php.diff}
23 assert checkEnv "NIXOPS_MANTISBT_DB_PASSWORD";
24 assert checkEnv "NIXOPS_MANTISBT_MASTER_SALT";
25 assert checkEnv "NIXOPS_MANTISBT_LDAP_PASSWORD";
26 pkgs.writeText "config_inc.php" ''
28 $g_hostname = 'db-1.immae.eu';
29 $g_db_username = 'mantisbt';
30 $g_db_password = '${builtins.getEnv "NIXOPS_MANTISBT_DB_PASSWORD"}';
31 $g_database_name = 'mantisbt';
33 $g_crypto_master_salt = '${builtins.getEnv "NIXOPS_MANTISBT_MASTER_SALT"}';
34 $g_allow_signup = OFF;
35 $g_allow_anonymous_login = ON;
36 $g_anonymous_account = 'anonymous';
38 $g_phpMailer_method = PHPMAILER_METHOD_SMTP;
39 $g_smtp_host = 'mail.immae.eu';
40 $g_smtp_username = ''';
41 $g_smtp_password = ''';
42 $g_webmaster_email = 'webmaster@immae.eu';
43 $g_from_email = 'noreply@immae.eu';
44 $g_return_path_email = 'webmaster@immae.eu';
45 $g_from_name = 'Mantis Bug Tracker at immae.eu';
46 $g_email_receive_own = OFF;
48 $g_login_method = LDAP;
49 $g_ldap_protocol_version = 3;
50 $g_ldap_server = 'ldaps://ldap.immae.eu:636';
51 $g_ldap_root_dn = 'ou=users,dc=immae,dc=eu';
52 $g_ldap_bind_dn = 'cn=mantisbt,ou=services,dc=immae,dc=eu';
53 $g_ldap_bind_passwd = '${builtins.getEnv "NIXOPS_MANTISBT_LDAP_PASSWORD"}';
54 $g_use_ldap_email = ON;
55 $g_use_ldap_realname = ON;
56 $g_ldap_uid_field = 'uid';
57 $g_ldap_realname_field = 'cn';
58 $g_ldap_organization = '(memberOf=cn=users,cn=mantisbt,ou=services,dc=immae,dc=eu)';
60 webRoot = stdenv.mkDerivation rec {
61 name = "mantisbt-${version}";
64 url = "https://downloads.sourceforge.net/project/mantisbt/mantis-stable/${version}/${name}.tar.gz";
65 sha256 = "0jnrqz6r2hf53v0k1lh3il7hlfiphn61r9wgg6mzyywkjxwq07md";
68 ./mantisbt-patches/bug_report.php.diff
69 ./mantisbt-patches/bug_report_page.php.diff
70 ./mantisbt-patches/bugnote_add.php.diff
71 ./mantisbt-patches/bugnote_add_inc.php.diff
75 ln -s ${config} $out/config/config_inc.php
76 ln -s ${plugins.slack} $out/plugins/Slack
77 ln -s ${plugins.source-integration}/Source* $out/plugins/
83 modules = [ "proxy_fcgi" ];
85 Alias /mantisbt "${webRoot}"
86 <Directory "${webRoot}">
87 DirectoryIndex index.php
89 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
93 Options FollowSymlinks
96 <Directory "${webRoot}/admin">
97 #Reenable during upgrade
103 basedir = builtins.concatStringsSep ":" (
105 ++ pkgs.lib.attrsets.mapAttrsToList (name: value: value) plugins);
106 socket = "/var/run/phpfpm/mantisbt.sock";
109 user = ${apache.user}
110 group = ${apache.group}
111 listen.owner = ${apache.user}
112 listen.group = ${apache.group}
115 pm.process_idle_timeout = 60
117 php_admin_value[upload_max_filesize] = 5000000
119 php_admin_value[open_basedir] = "${basedir}:/tmp"