]>
Commit | Line | Data |
---|---|---|
c9d13ae3 IB |
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 | |
c9d13ae3 IB |
16 | ''; |
17 | }; | |
120bcf4d IB |
18 | chatonsHostingProperties = { |
19 | file.datetime = "2022-08-21T22:50:00"; | |
20 | hosting = { | |
21 | name = "Dokuwiki"; | |
22 | description = "DokuWiki is a simple to use and highly versatile Open Source wiki software"; | |
23 | website = "https://tools.immae.eu/dokuwiki/"; | |
24 | logo = "https://tools.immae.eu/dokuwiki/lib/tpl/dokuwiki/images/apple-touch-icon.png"; | |
25 | type = "INSTANCE"; | |
26 | status.level = "OK"; | |
27 | status.description = "OK"; | |
28 | registration.load = "OPEN"; | |
29 | install.type = "PACKAGE"; | |
30 | }; | |
31 | }; | |
32 | chatonsProperties = { | |
33 | file.datetime = "2022-08-21T22:50:00"; | |
34 | service = { | |
35 | name = "Dokuwiki"; | |
36 | description = "DokuWiki is a simple to use and highly versatile Open Source wiki software"; | |
37 | website = "https://tools.immae.eu/dokuwiki/"; | |
38 | logo = "https://tools.immae.eu/dokuwiki/lib/tpl/dokuwiki/images/apple-touch-icon.png"; | |
39 | status.level = "OK"; | |
40 | status.description = "OK"; | |
41 | registration."" = ["MEMBER" "CLIENT"]; | |
42 | registration.load = "OPEN"; | |
43 | install.type = "PACKAGE"; | |
44 | }; | |
45 | software = { | |
46 | name = "Dokuwiki"; | |
47 | website = "https://www.dokuwiki.org/dokuwiki"; | |
48 | license.url = "http://www.gnu.org/licenses/gpl-2.0.html"; | |
49 | license.name = "GNU General Public License Version 2"; | |
50 | version = webRoot.version; | |
51 | source.url = "https://download.dokuwiki.org/"; | |
52 | modules = map (a: a.pluginName) webRoot.plugins; | |
53 | }; | |
54 | }; | |
34c7b88e | 55 | webRoot = dokuwiki.withPlugins (p: [ p.farmer p.todo ]); |
c9d13ae3 IB |
56 | apache = rec { |
57 | user = "wwwrun"; | |
58 | group = "wwwrun"; | |
59 | modules = [ "proxy_fcgi" ]; | |
750fe5a4 | 60 | root = webRoot; |
5400b9b6 | 61 | vhostConf = socket: '' |
c9d13ae3 IB |
62 | Alias /dokuwiki "${root}" |
63 | <Directory "${root}"> | |
64 | DirectoryIndex index.php | |
65 | <FilesMatch "\.php$"> | |
5400b9b6 | 66 | SetHandler "proxy:unix:${socket}|fcgi://localhost" |
c9d13ae3 | 67 | </FilesMatch> |
b892dcbe | 68 | |
c9d13ae3 IB |
69 | AllowOverride All |
70 | Options +FollowSymlinks | |
71 | Require all granted | |
72 | </Directory> | |
73 | ''; | |
74 | }; | |
75 | phpFpm = rec { | |
76 | serviceDeps = [ "openldap.service" ]; | |
77 | basedir = builtins.concatStringsSep ":" ( | |
78 | [ webRoot varDir ] ++ webRoot.plugins); | |
5400b9b6 IB |
79 | pool = { |
80 | "listen.owner" = apache.user; | |
81 | "listen.group" = apache.group; | |
82 | "pm" = "ondemand"; | |
83 | "pm.max_children" = "60"; | |
84 | "pm.process_idle_timeout" = "60"; | |
b892dcbe | 85 | |
5400b9b6 IB |
86 | # Needed to avoid clashes in browser cookies (same domain) |
87 | "php_value[session.name]" = "DokuwikiPHPSESSID"; | |
88 | "php_admin_value[open_basedir]" = "${basedir}:/tmp"; | |
bbea22c0 IB |
89 | "php_admin_value[session.save_handler]" = "redis"; |
90 | "php_admin_value[session.save_path]" = "'unix:///run/redis-php-sessions/redis.sock?persistent=1&prefix=Tools:Dokuwiki:'"; | |
5400b9b6 | 91 | }; |
b892dcbe | 92 | }; |
c9d13ae3 | 93 | } |