diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-06 14:06:31 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-06 14:06:31 +0200 |
commit | 43dac87fef530d52961cb7df5fdb01aa651d802c (patch) | |
tree | 341a5111afa74eae4070e109dd0a2b30e1ca6162 /nixops/modules/websites/tools/git/mantisbt/mantisbt.nix | |
parent | 7f9bc878c96b4e40b72c907cded326fc6bdee38a (diff) | |
download | Nix-43dac87fef530d52961cb7df5fdb01aa651d802c.tar.gz Nix-43dac87fef530d52961cb7df5fdb01aa651d802c.tar.zst Nix-43dac87fef530d52961cb7df5fdb01aa651d802c.zip |
Migrate mantisbt to pkgs
Diffstat (limited to 'nixops/modules/websites/tools/git/mantisbt/mantisbt.nix')
-rw-r--r-- | nixops/modules/websites/tools/git/mantisbt/mantisbt.nix | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/nixops/modules/websites/tools/git/mantisbt/mantisbt.nix b/nixops/modules/websites/tools/git/mantisbt/mantisbt.nix deleted file mode 100644 index 41c5e90..0000000 --- a/nixops/modules/websites/tools/git/mantisbt/mantisbt.nix +++ /dev/null | |||
@@ -1,128 +0,0 @@ | |||
1 | { lib, env, writeText, stdenv, fetchurl, fetchedGithub }: | ||
2 | let | ||
3 | mantisbt = let | ||
4 | plugins = { | ||
5 | slack = stdenv.mkDerivation (fetchedGithub ./mantisbt-plugin-slack.json // rec { | ||
6 | installPhase = '' | ||
7 | sed -i -e "s/return '@' . \\\$username;/return \\\$username;/" Slack.php | ||
8 | cp -a . $out | ||
9 | ''; | ||
10 | }); | ||
11 | source-integration = stdenv.mkDerivation (fetchedGithub ./mantisbt-plugin-source-integration.json // rec { | ||
12 | installPhase = '' | ||
13 | mkdir $out | ||
14 | patch -p1 < ${./mantisbt-plugin-source-integration_Source.API.php.diff} | ||
15 | cp -a Source* $out/ | ||
16 | ''; | ||
17 | }); | ||
18 | }; | ||
19 | in rec { | ||
20 | keys = [{ | ||
21 | dest = "webapps/tools-mantisbt"; | ||
22 | user = apache.user; | ||
23 | group = apache.group; | ||
24 | permissions = "0400"; | ||
25 | text = '' | ||
26 | <?php | ||
27 | $g_hostname = '${env.postgresql.socket}'; | ||
28 | $g_db_username = '${env.postgresql.user}'; | ||
29 | $g_db_password = '${env.postgresql.password}'; | ||
30 | $g_database_name = '${env.postgresql.database}'; | ||
31 | $g_db_type = 'pgsql'; | ||
32 | $g_crypto_master_salt = '${env.master_salt}'; | ||
33 | $g_allow_signup = OFF; | ||
34 | $g_allow_anonymous_login = ON; | ||
35 | $g_anonymous_account = 'anonymous'; | ||
36 | |||
37 | $g_phpMailer_method = PHPMAILER_METHOD_SENDMAIL; | ||
38 | $g_smtp_host = 'localhost'; | ||
39 | $g_smtp_username = '''; | ||
40 | $g_smtp_password = '''; | ||
41 | $g_webmaster_email = 'mantisbt@tools.immae.eu'; | ||
42 | $g_from_email = 'mantisbt@tools.immae.eu'; | ||
43 | $g_return_path_email = 'mantisbt@tools.immae.eu'; | ||
44 | $g_from_name = 'Mantis Bug Tracker at git.immae.eu'; | ||
45 | $g_email_receive_own = OFF; | ||
46 | # --- LDAP --- | ||
47 | $g_login_method = LDAP; | ||
48 | $g_ldap_protocol_version = 3; | ||
49 | $g_ldap_server = 'ldaps://ldap.immae.eu:636'; | ||
50 | $g_ldap_root_dn = 'ou=users,dc=immae,dc=eu'; | ||
51 | $g_ldap_bind_dn = 'cn=mantisbt,ou=services,dc=immae,dc=eu'; | ||
52 | $g_ldap_bind_passwd = '${env.ldap.password}'; | ||
53 | $g_use_ldap_email = ON; | ||
54 | $g_use_ldap_realname = ON; | ||
55 | $g_ldap_uid_field = 'uid'; | ||
56 | $g_ldap_realname_field = 'cn'; | ||
57 | $g_ldap_organization = '(memberOf=cn=users,cn=mantisbt,ou=services,dc=immae,dc=eu)'; | ||
58 | ''; | ||
59 | }]; | ||
60 | webRoot = stdenv.mkDerivation rec { | ||
61 | name = "mantisbt-${version}"; | ||
62 | version = "2.11.1"; | ||
63 | src = fetchurl { | ||
64 | url = "https://downloads.sourceforge.net/project/mantisbt/mantis-stable/${version}/${name}.tar.gz"; | ||
65 | sha256 = "0jnrqz6r2hf53v0k1lh3il7hlfiphn61r9wgg6mzyywkjxwq07md"; | ||
66 | }; | ||
67 | patches = [ | ||
68 | ./patches/bug_report.php.diff | ||
69 | ./patches/bug_report_page.php.diff | ||
70 | ./patches/bugnote_add.php.diff | ||
71 | ./patches/bugnote_add_inc.php.diff | ||
72 | ]; | ||
73 | installPhase = '' | ||
74 | cp -a . $out | ||
75 | ln -s /var/secrets/webapps/tools-mantisbt $out/config/config_inc.php | ||
76 | ln -s ${plugins.slack} $out/plugins/Slack | ||
77 | ln -s ${plugins.source-integration}/Source* $out/plugins/ | ||
78 | ''; | ||
79 | }; | ||
80 | apache = rec { | ||
81 | user = "wwwrun"; | ||
82 | group = "wwwrun"; | ||
83 | modules = [ "proxy_fcgi" ]; | ||
84 | webappName = "tools_mantisbt"; | ||
85 | root = "/run/current-system/webapps/${webappName}"; | ||
86 | vhostConf = '' | ||
87 | Alias /mantisbt "${root}" | ||
88 | <Directory "${root}"> | ||
89 | DirectoryIndex index.php | ||
90 | <FilesMatch "\.php$"> | ||
91 | SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost" | ||
92 | </FilesMatch> | ||
93 | |||
94 | AllowOverride All | ||
95 | Options FollowSymlinks | ||
96 | Require all granted | ||
97 | </Directory> | ||
98 | <Directory "${root}/admin"> | ||
99 | #Reenable during upgrade | ||
100 | Require all denied | ||
101 | </Directory> | ||
102 | ''; | ||
103 | }; | ||
104 | phpFpm = rec { | ||
105 | serviceDeps = [ "postgresql.service" "openldap.service" ]; | ||
106 | basedir = builtins.concatStringsSep ":" ( | ||
107 | [ webRoot "/var/secrets/webapps/tools-mantisbt" ] | ||
108 | ++ lib.attrsets.mapAttrsToList (name: value: value) plugins); | ||
109 | socket = "/var/run/phpfpm/mantisbt.sock"; | ||
110 | pool = '' | ||
111 | listen = ${socket} | ||
112 | user = ${apache.user} | ||
113 | group = ${apache.group} | ||
114 | listen.owner = ${apache.user} | ||
115 | listen.group = ${apache.group} | ||
116 | pm = ondemand | ||
117 | pm.max_children = 60 | ||
118 | pm.process_idle_timeout = 60 | ||
119 | |||
120 | php_admin_value[upload_max_filesize] = 5000000 | ||
121 | |||
122 | php_admin_value[open_basedir] = "${basedir}:/tmp:/var/lib/php/sessions/mantisbt" | ||
123 | php_admin_value[session.save_path] = "/var/lib/php/sessions/mantisbt" | ||
124 | ''; | ||
125 | }; | ||
126 | }; | ||
127 | in | ||
128 | mantisbt | ||