]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - systems/eldiron/websites/tools/phpbb.nix
Squash changes containing private information
[perso/Immae/Config/Nix.git] / systems / eldiron / websites / tools / phpbb.nix
CommitLineData
a8ef1adb
IB
1{ lib, phpbb, gnused }:
2rec {
a8ef1adb
IB
3 varDir = "/var/lib/phpbb";
4 activationScript = {
5 deps = [ "wrappers" ];
6 text = ''
7 if [ ! -d ${varDir} ]; then
8 install -m 0755 -o ${apache.user} -g ${apache.user} -d ${varDir}
9 cp -a ${phpbb}/vars/* ${varDir}
10 chown -R ${apache.user}:${apache.user} ${varDir}
11 fi
a8ef1adb
IB
12 '';
13 };
1a64deeb
IB
14 chatonsHostingProperties = {
15 file.datetime = "2022-08-21T22:50:00";
16 hosting = {
17 name = "phpBB";
18 description = "Forum software";
19 website = "https://tools.immae.eu/forum";
20 logo = "https://www.phpbb.com/favicon.ico";
21 type = "INSTANCE";
22 status.level = "OK";
23 status.description = "OK";
24 registration.load = "OPEN";
25 install.type = "PACKAGE";
26 };
27 };
a8ef1adb
IB
28 webRoot = phpbb;
29 apache = rec {
30 user = "wwwrun";
31 group = "wwwrun";
32 modules = [ "proxy_fcgi" ];
750fe5a4 33 root = webRoot;
a8ef1adb
IB
34 vhostConf = socket: ''
35 Alias /forum "${root}"
36 <Directory "${root}">
37 DirectoryIndex index.php
38 <FilesMatch "\.php$">
39 SetHandler "proxy:unix:${socket}|fcgi://localhost"
40 </FilesMatch>
41
42 AllowOverride All
43 Options FollowSymlinks
44 Require all granted
45 </Directory>
46 # add instal to the list after install
47 <LocationMatch "^/(cache|files|install|store)>
48 Require all denied
49 </LocationMatch>
50 '';
51 };
52 phpFpm = rec {
53 serviceDeps = [ "postgresql.service" ];
54 basedir = builtins.concatStringsSep ":" [ "/run/wrappers/bin/sendmail" phpbb varDir ];
55 pool = {
56 "listen.owner" = apache.user;
57 "listen.group" = apache.group;
58 "pm" = "ondemand";
59 "pm.max_children" = "60";
60 "pm.process_idle_timeout" = "60";
61
62 # Needed to avoid clashes in browser cookies (same domain)
63 "php_value[session.name]" = "PhpBBPHPSESSID";
64 "php_admin_value[open_basedir]" = "${basedir}:/tmp";
1a64deeb
IB
65 "php_admin_value[session.save_handler]" = "redis";
66 "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=Tools:PhpBB:'";
a8ef1adb
IB
67 };
68 };
69}