diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 01:35:06 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2023-10-04 02:11:48 +0200 |
commit | 1a64deeb894dc95e2645a75771732c6cc53a79ad (patch) | |
tree | 1b9df4838f894577a09b9b260151756272efeb53 /systems/eldiron/websites/tools/phpbb.nix | |
parent | fa25ffd4583cc362075cd5e1b4130f33306103f0 (diff) | |
download | Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.gz Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.tar.zst Nix-1a64deeb894dc95e2645a75771732c6cc53a79ad.zip |
Squash changes containing private information
There were a lot of changes since the previous commit, but a lot of them
contained personnal information about users. All thos changes got
stashed into a single commit (history is kept in a different place) and
private information was moved in a separate private repository
Diffstat (limited to 'systems/eldiron/websites/tools/phpbb.nix')
-rw-r--r-- | systems/eldiron/websites/tools/phpbb.nix | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/systems/eldiron/websites/tools/phpbb.nix b/systems/eldiron/websites/tools/phpbb.nix new file mode 100644 index 0000000..c1cbd6f --- /dev/null +++ b/systems/eldiron/websites/tools/phpbb.nix | |||
@@ -0,0 +1,69 @@ | |||
1 | { lib, phpbb, gnused }: | ||
2 | rec { | ||
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 | ||
12 | ''; | ||
13 | }; | ||
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 | }; | ||
28 | webRoot = phpbb; | ||
29 | apache = rec { | ||
30 | user = "wwwrun"; | ||
31 | group = "wwwrun"; | ||
32 | modules = [ "proxy_fcgi" ]; | ||
33 | root = webRoot; | ||
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"; | ||
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:'"; | ||
67 | }; | ||
68 | }; | ||
69 | } | ||