]>
Commit | Line | Data |
---|---|---|
1a64deeb | 1 | { lib, pkgs, config, mypackages-lib, grocy, ... }: |
10889174 | 2 | let |
1a64deeb IB |
3 | composerEnv = mypackages-lib.composerEnv; |
4 | adminer = pkgs.callPackage ./adminer.nix { inherit config; }; | |
4288c2f2 | 5 | ympd = pkgs.callPackage ./ympd.nix { |
ab8f306d | 6 | env = config.myEnv.tools.ympd; |
1a64deeb | 7 | inherit config; |
4288c2f2 IB |
8 | }; |
9 | ttrss = pkgs.callPackage ./ttrss.nix { | |
1a64deeb IB |
10 | ttrss = pkgs.webapps-ttrss; |
11 | ttrss-plugins = pkgs.webapps-ttrss-plugins; | |
ab8f306d | 12 | env = config.myEnv.tools.ttrss; |
dcac3ec7 | 13 | php = pkgs.php72; |
da30ae4f | 14 | inherit config; |
4288c2f2 | 15 | }; |
4288c2f2 | 16 | kanboard = pkgs.callPackage ./kanboard.nix { |
da30ae4f | 17 | inherit config; |
ab8f306d | 18 | env = config.myEnv.tools.kanboard; |
4288c2f2 IB |
19 | }; |
20 | wallabag = pkgs.callPackage ./wallabag.nix { | |
1a64deeb IB |
21 | wallabag = pkgs.webapps-wallabag.override { |
22 | composerEnv = composerEnv.override { | |
2053ddac | 23 | php = pkgs.php73.withExtensions({ enabled, all }: enabled ++ [all.tidy]); |
46c99b57 IB |
24 | }; |
25 | }; | |
ab8f306d | 26 | env = config.myEnv.tools.wallabag; |
da30ae4f | 27 | inherit config; |
4288c2f2 IB |
28 | }; |
29 | yourls = pkgs.callPackage ./yourls.nix { | |
1a64deeb IB |
30 | yourls = pkgs.webapps-yourls; |
31 | yourls-plugins = pkgs.webapps-yourls-plugins; | |
ab8f306d | 32 | env = config.myEnv.tools.yourls; |
da30ae4f | 33 | inherit config; |
4288c2f2 IB |
34 | }; |
35 | rompr = pkgs.callPackage ./rompr.nix { | |
1a64deeb | 36 | rompr = pkgs.webapps-rompr; |
ab8f306d | 37 | env = config.myEnv.tools.rompr; |
1a64deeb | 38 | inherit config; |
4288c2f2 IB |
39 | }; |
40 | shaarli = pkgs.callPackage ./shaarli.nix { | |
ab8f306d | 41 | env = config.myEnv.tools.shaarli; |
da30ae4f | 42 | inherit config; |
4288c2f2 IB |
43 | }; |
44 | dokuwiki = pkgs.callPackage ./dokuwiki.nix { | |
1a64deeb IB |
45 | dokuwiki = pkgs.webapps-dokuwiki; |
46 | dokuwiki-plugins = pkgs.webapps-dokuwiki-plugins; | |
47 | inherit config; | |
4288c2f2 IB |
48 | }; |
49 | ldap = pkgs.callPackage ./ldap.nix { | |
1a64deeb | 50 | phpldapadmin = pkgs.webapps-phpldapadmin; |
ab8f306d | 51 | env = config.myEnv.tools.phpldapadmin; |
da30ae4f | 52 | inherit config; |
4288c2f2 | 53 | }; |
1a64deeb IB |
54 | grocy' = pkgs.callPackage ./grocy.nix { |
55 | grocy = grocy.override { composerEnv = composerEnv.override { php = pkgs.php72; }; }; | |
c7627e14 | 56 | }; |
a8ef1adb | 57 | phpbb = pkgs.callPackage ./phpbb.nix { |
1a64deeb | 58 | phpbb = (pkgs.webapps-phpbb.withLangs (l: [ l.fr ])).withExts (e: [ |
a8ef1adb IB |
59 | e.alfredoramos.markdown e.davidiq.mailinglist e.dmzx.mchat |
60 | e.empteintesduweb.monitoranswers e.lr94.autosubscribe | |
61 | e.phpbbmodders.adduser ]); | |
62 | }; | |
1a64deeb IB |
63 | webhooks-bin-env = pkgs.buildEnv { |
64 | name = "webhook-env"; | |
65 | paths = [ pkgs.apprise ]; | |
66 | pathsToLink = [ "/bin" ]; | |
67 | }; | |
251c0a13 IB |
68 | webhooks = pkgs.callPackage ./webhooks.nix { |
69 | env = config.myEnv.tools.webhooks; | |
1a64deeb | 70 | binEnv = webhooks-bin-env; |
251c0a13 | 71 | }; |
7df5e532 IB |
72 | dmarc-reports = pkgs.callPackage ./dmarc_reports.nix { |
73 | env = config.myEnv.tools.dmarc_reports; | |
da30ae4f | 74 | inherit config; |
7df5e532 | 75 | }; |
251c0a13 | 76 | |
1a64deeb | 77 | landing = pkgs.callPackage ./landing.nix { }; |
10889174 | 78 | |
3cc24358 IB |
79 | matrix = pkgs.element-web.override { |
80 | conf = { | |
81 | default_server_config."m.homeserver" = { | |
d1527470 | 82 | base_url = "https://synapse.immae.eu"; |
3cc24358 IB |
83 | server_name = "immae.eu"; |
84 | }; | |
85 | default_server_config."m.identity_server" = { | |
86 | base_url = "https://vector.im"; | |
87 | }; | |
88 | room_directory.servers = [ "immae.eu" "matrix.org" ]; | |
89 | }; | |
90 | }; | |
91 | ||
4288c2f2 | 92 | cfg = config.myServices.websites.tools.tools; |
5400b9b6 | 93 | pcfg = config.services.phpfpm.pools; |
10889174 | 94 | in { |
4288c2f2 | 95 | options.myServices.websites.tools.tools = { |
10889174 IB |
96 | enable = lib.mkEnableOption "enable tools website"; |
97 | }; | |
98 | ||
99 | config = lib.mkIf cfg.enable { | |
1a64deeb IB |
100 | # Services needing to send e-mails |
101 | myServices.dns.zones."immae.eu".emailPolicies."tools".receive = true; | |
102 | myServices.dns.zones."immae.eu".subdomains = | |
103 | with config.myServices.dns.helpers; | |
104 | { | |
105 | outils = ips servers.eldiron.ips.main; | |
106 | tools = lib.mkMerge [ | |
97787a9d | 107 | (mailCommon "immae.eu" true) |
1a64deeb IB |
108 | mailSend |
109 | (ips servers.eldiron.ips.main) | |
110 | ]; | |
111 | }; | |
112 | ||
1c90c0dd IB |
113 | services.borgBackup.profiles.global.ignoredPaths = [ |
114 | "duply" | |
115 | "kanboard" | |
116 | "ntfy" | |
117 | ]; | |
118 | services.borgBackup.profiles.global.includedPaths = [ | |
119 | "paste" | |
120 | "dokuwiki/conf" | |
121 | "dokuwiki/data" | |
122 | "phpbb" | |
123 | "shaarli/cache" | |
124 | "shaarli/pagecache" | |
125 | "shaarli/tmp" | |
126 | ]; | |
127 | ||
1a64deeb IB |
128 | myServices.chatonsProperties.services = { |
129 | adminer = adminer.chatonsProperties; | |
130 | dokuwiki = dokuwiki.chatonsProperties; | |
131 | shaarli = shaarli.chatonsProperties; | |
132 | ttrss = ttrss.chatonsProperties; | |
133 | wallabag = wallabag.chatonsProperties; | |
134 | paste = { | |
135 | file.datetime = "2022-08-22T00:15:00"; | |
136 | service = { | |
137 | name = "Paste"; | |
138 | description = "A simple paster script with syntax highlight"; | |
139 | website = "https://tools.immae.eu/paste/"; | |
140 | logo = "https://assets.immae.eu/logo.jpg"; | |
141 | status.level = "OK"; | |
142 | status.description = "OK"; | |
143 | registration."" = ["MEMBER" "CLIENT"]; | |
144 | registration.load = "OPEN"; | |
145 | install.type = "PACKAGE"; | |
146 | guide.user = "https://tools.immae.eu/paste/"; | |
147 | }; | |
148 | software = { | |
149 | name = "Paste"; | |
150 | website = "https://tools.immae.eu/paste/"; | |
151 | license.url = "https://tools.immae.eu/paste/license"; | |
152 | license.name = "MIT License"; | |
153 | version = "Unversioned"; | |
154 | source.url = "https://tools.immae.eu/paste/abcd123/py"; | |
155 | }; | |
156 | }; | |
157 | }; | |
158 | myServices.chatonsProperties.hostings = { | |
159 | dokuwiki = dokuwiki.chatonsHostingProperties; | |
160 | phpbb = phpbb.chatonsHostingProperties; | |
161 | }; | |
1a718805 | 162 | secrets.keys = |
a840a21c | 163 | kanboard.keys |
4c4652aa IB |
164 | // ldap.keys |
165 | // shaarli.keys | |
166 | // ttrss.keys | |
167 | // wallabag.keys | |
168 | // yourls.keys | |
169 | // dmarc-reports.keys | |
1a64deeb IB |
170 | // webhooks.keys |
171 | // ({ "webapps/tools-landing-sql-rw" = { | |
172 | user = "wwwrun"; | |
173 | group = "wwwrun"; | |
174 | permissions = "0400"; | |
175 | text = let | |
176 | env = config.myEnv.tools.landing; | |
177 | in '' | |
178 | SetEnv PGUSER "${env.postgresql.user}" | |
179 | SetEnv PGPASSWORD "${env.postgresql.password}" | |
180 | SetEnv PGDATABASE "${env.postgresql.database}" | |
181 | SetEnv PGHOST "${env.postgresql.socket}" | |
182 | ''; | |
183 | }; }); | |
29f8cb85 | 184 | services.websites.env.tools.modules = |
1922655a IB |
185 | [ "proxy_fcgi" ] |
186 | ++ adminer.apache.modules | |
10889174 IB |
187 | ++ ympd.apache.modules |
188 | ++ ttrss.apache.modules | |
133ebaee | 189 | ++ wallabag.apache.modules |
bfe3c9c9 | 190 | ++ yourls.apache.modules |
95b20e17 | 191 | ++ rompr.apache.modules |
b892dcbe | 192 | ++ shaarli.apache.modules |
f80772dc | 193 | ++ dokuwiki.apache.modules |
7df5e532 | 194 | ++ dmarc-reports.apache.modules |
a8ef1adb | 195 | ++ phpbb.apache.modules |
d4ed0eff IB |
196 | ++ ldap.apache.modules |
197 | ++ kanboard.apache.modules; | |
10889174 | 198 | |
1a64deeb IB |
199 | myServices.dns.zones."immae.dev" = with config.myServices.dns.helpers; { |
200 | subdomains.tools = ips servers.eldiron.ips.integration; | |
201 | }; | |
202 | security.acme.certs.integration.domain = "tools.immae.dev"; | |
29f8cb85 | 203 | services.websites.env.integration.vhostConfs.devtools = { |
0f71cd76 | 204 | certName = "integration"; |
7c5e6fe8 | 205 | hosts = [ "tools.immae.dev" ]; |
41cce84a | 206 | root = "/var/lib/ftp/immae/devtools"; |
0f71cd76 | 207 | extraConfig = [ |
0aae0181 | 208 | '' |
41cce84a | 209 | Use Apaxy "/var/lib/ftp/immae/devtools" "title" |
9338c832 IB |
210 | Timeout 600 |
211 | ProxyTimeout 600 | |
68c45ad5 | 212 | Header always set Content-Security-Policy-Report-Only "${config.myEnv.tools.csp_reports.policies.inline}" |
41cce84a | 213 | <Directory "/var/lib/ftp/immae/devtools"> |
0aae0181 IB |
214 | DirectoryIndex index.php index.htm index.html |
215 | AllowOverride all | |
216 | Require all granted | |
217 | <FilesMatch "\.php$"> | |
5400b9b6 | 218 | SetHandler "proxy:unix:${pcfg.devtools.socket}|fcgi://localhost" |
0aae0181 IB |
219 | </FilesMatch> |
220 | </Directory> | |
221 | '' | |
46f30ecc IB |
222 | ]; |
223 | }; | |
224 | ||
1a64deeb IB |
225 | |
226 | security.acme.certs.eldiron.extraDomainNames = [ "outils.immae.eu" "tools.immae.eu" ]; | |
29f8cb85 | 227 | services.websites.env.tools.vhostConfs.tools = { |
10889174 IB |
228 | certName = "eldiron"; |
229 | hosts = ["tools.immae.eu" ]; | |
a8ef1adb | 230 | root = landing; |
10889174 | 231 | extraConfig = [ |
1922655a | 232 | '' |
ea9c6fe8 | 233 | RedirectMatch 301 ^/vpn(.*)$ https://vpn.immae.eu$1 |
afcc5de0 | 234 | RedirectMatch 301 ^/roundcube(.*)$ https://mail.immae.eu/roundcube$1 |
3f453c7d | 235 | RedirectMatch 301 ^/jappix(.*)$ https://im.immae.fr/converse |
afcc5de0 | 236 | |
251c0a13 | 237 | <Directory "${landing}"> |
1a64deeb | 238 | Include ${config.secrets.fullPaths."webapps/tools-landing-sql-rw"} |
251c0a13 IB |
239 | DirectoryIndex index.html |
240 | AllowOverride None | |
241 | Require all granted | |
242 | ||
243 | <FilesMatch "\.php$"> | |
244 | SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost" | |
245 | </FilesMatch> | |
246 | </Directory> | |
1922655a | 247 | '' |
5400b9b6 | 248 | (adminer.apache.vhostConf pcfg.adminer.socket) |
10889174 | 249 | ympd.apache.vhostConf |
5400b9b6 IB |
250 | (ttrss.apache.vhostConf pcfg.ttrss.socket) |
251 | (wallabag.apache.vhostConf pcfg.wallabag.socket) | |
252 | (yourls.apache.vhostConf pcfg.yourls.socket) | |
253 | (rompr.apache.vhostConf pcfg.rompr.socket) | |
254 | (shaarli.apache.vhostConf pcfg.shaarli.socket) | |
255 | (dokuwiki.apache.vhostConf pcfg.dokuwiki.socket) | |
256 | (ldap.apache.vhostConf pcfg.ldap.socket) | |
257 | (kanboard.apache.vhostConf pcfg.kanboard.socket) | |
1a64deeb | 258 | (grocy'.apache.vhostConf pcfg.grocy.socket) |
a8ef1adb | 259 | (phpbb.apache.vhostConf pcfg.phpbb.socket) |
7df5e532 | 260 | (dmarc-reports.apache.vhostConf pcfg.dmarc-reports.socket) |
ea3b46ee | 261 | '' |
a9f52ec5 IB |
262 | <Location "/paste/"> |
263 | ProxyPass unix://${config.services.paste.sockets.gunicorn}|http://tools.immae.eu/paste/ | |
264 | ProxyPassReverse unix://${config.services.paste.sockets.gunicorn}|http://tools.immae.eu/paste/ | |
265 | ProxyPreserveHost on | |
266 | </Location> | |
267 | <Location "/paste"> | |
268 | ProxyPass unix://${config.services.paste.sockets.gunicorn}|http://tools.immae.eu/paste/ | |
269 | ProxyPassReverse unix://${config.services.paste.sockets.gunicorn}|http://tools.immae.eu/paste/ | |
270 | ProxyPreserveHost on | |
271 | </Location> | |
251c0a13 | 272 | |
1a64deeb IB |
273 | <Location "/ntfy/"> |
274 | SetEnv proxy-nokeepalive 1 | |
275 | SetEnv proxy-sendchunked 1 | |
276 | LimitRequestBody 102400 | |
277 | ||
278 | RewriteEngine On | |
279 | ||
280 | # FIXME: why is landing prefixed in the url? | |
281 | RewriteCond %{HTTP:Upgrade} websocket [NC] | |
282 | RewriteCond %{HTTP:Connection} upgrade [NC] | |
283 | RewriteRule ^(${landing}/ntfy)?/?(.*) unix:///run/ntfy/ntfy.sock|ws://tools.immae.eu/$2 [P,NE,QSA,L] | |
284 | ||
285 | RewriteRule ^(${landing}/ntfy)?/?(.*) unix:///run/ntfy/ntfy.sock|http://tools.immae.eu/$2 [P,NE,QSA,L] | |
286 | </Location> | |
cb589b2e IB |
287 | Alias /BIP39 /var/lib/buildbot/outputs/immae/bip39 |
288 | <Directory "/var/lib/buildbot/outputs/immae/bip39"> | |
251c0a13 IB |
289 | DirectoryIndex index.html |
290 | AllowOverride None | |
291 | Require all granted | |
292 | </Directory> | |
293 | ||
da30ae4f IB |
294 | Alias /webhooks ${config.secrets.fullPaths."webapps/webhooks"} |
295 | <Directory "${config.secrets.fullPaths."webapps/webhooks"}"> | |
251c0a13 | 296 | Options -Indexes |
1a64deeb | 297 | DirectoryIndex index.php |
251c0a13 IB |
298 | Require all granted |
299 | AllowOverride None | |
300 | <FilesMatch "\.php$"> | |
301 | SetHandler "proxy:unix:${pcfg.tools.socket}|fcgi://localhost" | |
302 | </FilesMatch> | |
303 | </Directory> | |
3cc24358 IB |
304 | |
305 | Alias /matrix ${matrix} | |
306 | <Directory "${matrix}"> | |
307 | DirectoryIndex index.html | |
308 | AllowOverride None | |
309 | Require all granted | |
310 | </Directory> | |
ea3b46ee | 311 | '' |
10889174 IB |
312 | ]; |
313 | }; | |
314 | ||
29f8cb85 | 315 | services.websites.env.tools.vhostConfs.outils = { |
7df420c2 | 316 | certName = "eldiron"; |
0f71cd76 | 317 | hosts = [ "outils.immae.eu" ]; |
7df420c2 | 318 | root = null; |
70606070 IB |
319 | extraConfig = [ |
320 | '' | |
321 | RedirectMatch 301 ^/mediagoblin(.*)$ https://mgoblin.immae.eu$1 | |
322 | ||
323 | RedirectMatch 301 ^/ether(.*)$ https://ether.immae.eu$1 | |
324 | ||
325 | RedirectMatch 301 ^/nextcloud(.*)$ https://cloud.immae.eu$1 | |
326 | RedirectMatch 301 ^/owncloud(.*)$ https://cloud.immae.eu$1 | |
327 | ||
328 | RedirectMatch 301 ^/carddavmate(.*)$ https://dav.immae.eu/infcloud$1 | |
329 | RedirectMatch 301 ^/caldavzap(.*)$ https://dav.immae.eu/infcloud$1 | |
330 | RedirectMatch 301 ^/caldav.php(.*)$ https://dav.immae.eu/caldav.php$1 | |
331 | RedirectMatch 301 ^/davical(.*)$ https://dav.immae.eu/davical$1 | |
332 | ||
333 | RedirectMatch 301 ^/taskweb(.*)$ https://task.immae.eu/taskweb$1 | |
334 | ||
afcc5de0 IB |
335 | RedirectMatch 301 ^/roundcube(.*)$ https://mail.immae.eu/roundcube$1 |
336 | ||
3f453c7d IB |
337 | RedirectMatch 301 ^/jappix(.*)$ https://im.immae.fr/converse |
338 | ||
ea9c6fe8 IB |
339 | RedirectMatch 301 ^/vpn(.*)$ https://vpn.immae.eu$1 |
340 | ||
70606070 IB |
341 | RedirectMatch 301 ^/(.*)$ https://tools.immae.eu/$1 |
342 | '' | |
343 | ]; | |
344 | }; | |
345 | ||
f40f5b23 IB |
346 | systemd.services = { |
347 | phpfpm-dokuwiki = { | |
348 | after = lib.mkAfter dokuwiki.phpFpm.serviceDeps; | |
349 | wants = dokuwiki.phpFpm.serviceDeps; | |
350 | }; | |
a8ef1adb IB |
351 | phpfpm-phpbb = { |
352 | after = lib.mkAfter phpbb.phpFpm.serviceDeps; | |
353 | wants = phpbb.phpFpm.serviceDeps; | |
354 | }; | |
f40f5b23 IB |
355 | phpfpm-kanboard = { |
356 | after = lib.mkAfter kanboard.phpFpm.serviceDeps; | |
357 | wants = kanboard.phpFpm.serviceDeps; | |
358 | }; | |
359 | phpfpm-ldap = { | |
360 | after = lib.mkAfter ldap.phpFpm.serviceDeps; | |
361 | wants = ldap.phpFpm.serviceDeps; | |
362 | }; | |
f40f5b23 IB |
363 | phpfpm-shaarli = { |
364 | after = lib.mkAfter shaarli.phpFpm.serviceDeps; | |
365 | wants = shaarli.phpFpm.serviceDeps; | |
366 | }; | |
367 | phpfpm-ttrss = { | |
368 | after = lib.mkAfter ttrss.phpFpm.serviceDeps; | |
369 | wants = ttrss.phpFpm.serviceDeps; | |
370 | }; | |
371 | phpfpm-wallabag = { | |
372 | after = lib.mkAfter wallabag.phpFpm.serviceDeps; | |
373 | wants = wallabag.phpFpm.serviceDeps; | |
374 | preStart = lib.mkAfter wallabag.phpFpm.preStart; | |
375 | }; | |
376 | phpfpm-yourls = { | |
377 | after = lib.mkAfter yourls.phpFpm.serviceDeps; | |
378 | wants = yourls.phpFpm.serviceDeps; | |
379 | }; | |
1a64deeb IB |
380 | ntfy = { |
381 | description = "send push notifications to your phone or desktop via scripts from any computer"; | |
382 | wantedBy = [ "multi-user.target" ]; | |
383 | serviceConfig = { | |
384 | ExecStart = "${pkgs.ntfy-sh}/bin/ntfy serve --listen-http '' --listen-unix %t/ntfy/ntfy.sock --cache-file %S/ntfy/cache.db --cache-duration 120h --behind-proxy --attachment-cache-dir %S/ntfy/attachments --base-url https://tools.immae.eu/ntfy"; | |
385 | Type = "simple"; | |
386 | WorkingDirectory = "%S/ntfy"; | |
387 | RuntimeDirectory = "ntfy"; | |
388 | StateDirectory = "ntfy"; | |
389 | User = "wwwrun"; | |
390 | }; | |
391 | }; | |
f40f5b23 IB |
392 | ympd = { |
393 | description = "Standalone MPD Web GUI written in C"; | |
394 | wantedBy = [ "multi-user.target" ]; | |
395 | script = '' | |
da30ae4f | 396 | export MPD_PASSWORD=$(cat ${config.secrets.fullPaths."mpd"}) |
f40f5b23 IB |
397 | ${pkgs.ympd}/bin/ympd --host ${ympd.config.host} --port ${toString ympd.config.port} --webport ${ympd.config.webPort} --user nobody |
398 | ''; | |
399 | }; | |
400 | tt-rss = { | |
401 | description = "Tiny Tiny RSS feeds update daemon"; | |
402 | serviceConfig = { | |
403 | User = "wwwrun"; | |
dcac3ec7 | 404 | ExecStart = "${pkgs.php72}/bin/php ${ttrss.webRoot}/update.php --daemon"; |
f40f5b23 IB |
405 | StandardOutput = "syslog"; |
406 | StandardError = "syslog"; | |
407 | PermissionsStartOnly = true; | |
408 | }; | |
409 | ||
410 | wantedBy = [ "multi-user.target" ]; | |
411 | requires = ["postgresql.service"]; | |
412 | after = ["network.target" "postgresql.service"]; | |
413 | }; | |
414 | }; | |
415 | ||
17f6eae9 IB |
416 | services.filesWatcher.ympd = { |
417 | restart = true; | |
da30ae4f | 418 | paths = [ config.secrets.fullPaths."mpd" ]; |
17f6eae9 IB |
419 | }; |
420 | ||
f8df6790 IB |
421 | services.paste = { |
422 | enable = true; | |
423 | webDirectory = "/paste"; | |
424 | }; | |
425 | ||
441da8aa IB |
426 | services.phpfpm.pools = { |
427 | tools = { | |
5400b9b6 IB |
428 | user = "wwwrun"; |
429 | group = "wwwrun"; | |
430 | settings = { | |
431 | "listen.owner" = "wwwrun"; | |
432 | "listen.group" = "wwwrun"; | |
433 | "pm" = "dynamic"; | |
434 | "pm.max_children" = "60"; | |
435 | "pm.start_servers" = "2"; | |
436 | "pm.min_spare_servers" = "1"; | |
437 | "pm.max_spare_servers" = "10"; | |
f40f5b23 | 438 | |
1a64deeb IB |
439 | "php_admin_value[sendmail_path]" = "/run/wrappers/bin/sendmail -t -i"; |
440 | "php_admin_value[session.save_handler]" = "redis"; | |
441 | "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=Tools:Tools:'"; | |
5400b9b6 IB |
442 | # Needed to avoid clashes in browser cookies (same domain) |
443 | "php_value[session.name]" = "ToolsPHPSESSID"; | |
251c0a13 | 444 | "php_admin_value[open_basedir]" = builtins.concatStringsSep ":" [ |
a8ef1adb | 445 | "/run/wrappers/bin/sendmail" landing "/tmp" |
da30ae4f | 446 | config.secrets.fullPaths."webapps/webhooks" |
1a64deeb | 447 | "${webhooks-bin-env}/bin" |
251c0a13 IB |
448 | ]; |
449 | }; | |
450 | phpEnv = { | |
451 | CONTACT_EMAIL = config.myEnv.tools.contact; | |
5400b9b6 | 452 | }; |
1a64deeb | 453 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [ all.redis ]); |
441da8aa IB |
454 | }; |
455 | devtools = { | |
5400b9b6 IB |
456 | user = "wwwrun"; |
457 | group = "wwwrun"; | |
458 | settings = { | |
459 | "listen.owner" = "wwwrun"; | |
460 | "listen.group" = "wwwrun"; | |
461 | "pm" = "dynamic"; | |
462 | "pm.max_children" = "60"; | |
463 | "pm.start_servers" = "2"; | |
464 | "pm.min_spare_servers" = "1"; | |
465 | "pm.max_spare_servers" = "10"; | |
1922655a | 466 | |
1a64deeb IB |
467 | "php_admin_value[sendmail_path]" = "/run/wrappers/bin/sendmail -t -i"; |
468 | "php_admin_value[session.save_handler]" = "redis"; | |
469 | "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=Tools:Devtools:'"; | |
41cce84a | 470 | "php_admin_value[open_basedir]" = "/run/wrappers/bin/sendmail:/var/lib/ftp/immae/devtools:/tmp"; |
5400b9b6 | 471 | }; |
736621e5 | 472 | phpPackage = pkgs.php82.withExtensions({ enabled, all }: enabled ++ [all.mysqli all.sqlite3 all.redis all.apcu all.opcache ]); |
441da8aa | 473 | }; |
5400b9b6 | 474 | adminer = adminer.phpFpm; |
441da8aa | 475 | ttrss = { |
5400b9b6 IB |
476 | user = "wwwrun"; |
477 | group = "wwwrun"; | |
478 | settings = ttrss.phpFpm.pool; | |
1a64deeb | 479 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); |
441da8aa IB |
480 | }; |
481 | wallabag = { | |
5400b9b6 IB |
482 | user = "wwwrun"; |
483 | group = "wwwrun"; | |
484 | settings = wallabag.phpFpm.pool; | |
1a64deeb | 485 | phpPackage = pkgs.php73.withExtensions({ enabled, all }: enabled ++ [all.tidy all.redis]); |
441da8aa IB |
486 | }; |
487 | yourls = { | |
5400b9b6 IB |
488 | user = "wwwrun"; |
489 | group = "wwwrun"; | |
490 | settings = yourls.phpFpm.pool; | |
1a64deeb | 491 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); |
441da8aa IB |
492 | }; |
493 | rompr = { | |
5400b9b6 IB |
494 | user = "wwwrun"; |
495 | group = "wwwrun"; | |
496 | settings = rompr.phpFpm.pool; | |
1a64deeb | 497 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); |
441da8aa IB |
498 | }; |
499 | shaarli = { | |
5400b9b6 IB |
500 | user = "wwwrun"; |
501 | group = "wwwrun"; | |
502 | settings = shaarli.phpFpm.pool; | |
1a64deeb | 503 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); |
441da8aa | 504 | }; |
7df5e532 IB |
505 | dmarc-reports = { |
506 | user = "wwwrun"; | |
507 | group = "wwwrun"; | |
508 | settings = dmarc-reports.phpFpm.pool; | |
509 | phpEnv = dmarc-reports.phpFpm.phpEnv; | |
1a64deeb | 510 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); |
7df5e532 | 511 | }; |
441da8aa | 512 | dokuwiki = { |
5400b9b6 IB |
513 | user = "wwwrun"; |
514 | group = "wwwrun"; | |
515 | settings = dokuwiki.phpFpm.pool; | |
1a64deeb | 516 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); |
441da8aa | 517 | }; |
a8ef1adb IB |
518 | phpbb = { |
519 | user = "wwwrun"; | |
520 | group = "wwwrun"; | |
521 | settings = phpbb.phpFpm.pool; | |
1a64deeb | 522 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); |
a8ef1adb | 523 | }; |
441da8aa | 524 | ldap = { |
5400b9b6 IB |
525 | user = "wwwrun"; |
526 | group = "wwwrun"; | |
527 | settings = ldap.phpFpm.pool; | |
1a64deeb | 528 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); |
441da8aa IB |
529 | }; |
530 | kanboard = { | |
5400b9b6 IB |
531 | user = "wwwrun"; |
532 | group = "wwwrun"; | |
533 | settings = kanboard.phpFpm.pool; | |
1a64deeb | 534 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); |
441da8aa IB |
535 | }; |
536 | grocy = { | |
5400b9b6 IB |
537 | user = "wwwrun"; |
538 | group = "wwwrun"; | |
1a64deeb IB |
539 | settings = grocy'.phpFpm.pool; |
540 | phpPackage = pkgs.php72.withExtensions({ enabled, all }: enabled ++ [all.redis]); | |
441da8aa | 541 | }; |
10889174 IB |
542 | }; |
543 | ||
544 | system.activationScripts = { | |
1a64deeb | 545 | grocy = grocy'.activationScript; |
10889174 | 546 | ttrss = ttrss.activationScript; |
aebd817b | 547 | wallabag = wallabag.activationScript; |
bfe3c9c9 | 548 | rompr = rompr.activationScript; |
95b20e17 | 549 | shaarli = shaarli.activationScript; |
b892dcbe | 550 | dokuwiki = dokuwiki.activationScript; |
a8ef1adb | 551 | phpbb = phpbb.activationScript; |
d4ed0eff | 552 | kanboard = kanboard.activationScript; |
10889174 IB |
553 | }; |
554 | ||
29f8cb85 | 555 | services.websites.env.tools.watchPaths = [ |
da30ae4f | 556 | config.secrets.fullPaths."webapps/tools-shaarli" |
17f6eae9 IB |
557 | ]; |
558 | services.filesWatcher.phpfpm-wallabag = { | |
559 | restart = true; | |
da30ae4f | 560 | paths = [ config.secrets.fullPaths."webapps/tools-wallabag" ]; |
17f6eae9 | 561 | }; |
ea3b46ee | 562 | |
1a64deeb IB |
563 | myServices.monitoring.fromMasterActivatedPlugins = lib.mkMerge [ |
564 | ttrss.monitoringPlugins | |
565 | rompr.monitoringPlugins | |
566 | wallabag.monitoringPlugins | |
567 | yourls.monitoringPlugins | |
568 | ympd.monitoringPlugins | |
569 | dokuwiki.monitoringPlugins | |
570 | shaarli.monitoringPlugins | |
571 | ldap.monitoringPlugins | |
572 | adminer.monitoringPlugins | |
573 | ]; | |
574 | myServices.monitoring.fromMasterObjects = lib.mkMerge [ | |
575 | ttrss.monitoringObjects | |
576 | rompr.monitoringObjects | |
577 | wallabag.monitoringObjects | |
578 | yourls.monitoringObjects | |
579 | ympd.monitoringObjects | |
580 | dokuwiki.monitoringObjects | |
581 | shaarli.monitoringObjects | |
582 | ldap.monitoringObjects | |
583 | adminer.monitoringObjects | |
584 | ]; | |
10889174 IB |
585 | }; |
586 | } | |
587 |