]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/tools/tools/dokuwiki.nix
Add chatons infos
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / tools / dokuwiki.nix
1 { lib, stdenv, dokuwiki, dokuwiki-plugins }:
2 rec {
3 varDir = "/var/lib/dokuwiki";
4 activationScript = {
5 deps = [ "wrappers" ];
6 text = ''
7 if [ ! -d ${varDir} ]; then
8 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
9 ${varDir}/animals
10 cp -a ${webRoot}/conf.dist ${varDir}/conf
11 cp -a ${webRoot}/data.dist ${varDir}/data
12 cp -a ${webRoot}/
13 chown -R ${apache.user}:${apache.user} ${varDir}/config ${varDir}/data
14 chmod -R 755 ${varDir}/config ${varDir}/data
15 fi
16 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
17 '';
18 };
19 chatonsHostingProperties = {
20 file.datetime = "2022-08-21T22:50:00";
21 hosting = {
22 name = "Dokuwiki";
23 description = "DokuWiki is a simple to use and highly versatile Open Source wiki software";
24 website = "https://tools.immae.eu/dokuwiki/";
25 logo = "https://tools.immae.eu/dokuwiki/lib/tpl/dokuwiki/images/apple-touch-icon.png";
26 type = "INSTANCE";
27 status.level = "OK";
28 status.description = "OK";
29 registration.load = "OPEN";
30 install.type = "PACKAGE";
31 };
32 };
33 chatonsProperties = {
34 file.datetime = "2022-08-21T22:50:00";
35 service = {
36 name = "Dokuwiki";
37 description = "DokuWiki is a simple to use and highly versatile Open Source wiki software";
38 website = "https://tools.immae.eu/dokuwiki/";
39 logo = "https://tools.immae.eu/dokuwiki/lib/tpl/dokuwiki/images/apple-touch-icon.png";
40 status.level = "OK";
41 status.description = "OK";
42 registration."" = ["MEMBER" "CLIENT"];
43 registration.load = "OPEN";
44 install.type = "PACKAGE";
45 };
46 software = {
47 name = "Dokuwiki";
48 website = "https://www.dokuwiki.org/dokuwiki";
49 license.url = "http://www.gnu.org/licenses/gpl-2.0.html";
50 license.name = "GNU General Public License Version 2";
51 version = webRoot.version;
52 source.url = "https://download.dokuwiki.org/";
53 modules = map (a: a.pluginName) webRoot.plugins;
54 };
55 };
56 webRoot = dokuwiki.withPlugins (p: [ p.farmer p.todo ]);
57 apache = rec {
58 user = "wwwrun";
59 group = "wwwrun";
60 modules = [ "proxy_fcgi" ];
61 root = webRoot;
62 vhostConf = socket: ''
63 Alias /dokuwiki "${root}"
64 <Directory "${root}">
65 DirectoryIndex index.php
66 <FilesMatch "\.php$">
67 SetHandler "proxy:unix:${socket}|fcgi://localhost"
68 </FilesMatch>
69
70 AllowOverride All
71 Options +FollowSymlinks
72 Require all granted
73 </Directory>
74 '';
75 };
76 phpFpm = rec {
77 serviceDeps = [ "openldap.service" ];
78 basedir = builtins.concatStringsSep ":" (
79 [ webRoot varDir ] ++ webRoot.plugins);
80 pool = {
81 "listen.owner" = apache.user;
82 "listen.group" = apache.group;
83 "pm" = "ondemand";
84 "pm.max_children" = "60";
85 "pm.process_idle_timeout" = "60";
86
87 # Needed to avoid clashes in browser cookies (same domain)
88 "php_value[session.name]" = "DokuwikiPHPSESSID";
89 "php_admin_value[open_basedir]" = "${basedir}:/tmp";
90 "php_admin_value[session.save_path]" = "${varDir}/phpSessions";
91 };
92 };
93 }