1 { lib, stdenv, dokuwiki, dokuwiki-plugins }:
3 varDir = "/var/lib/dokuwiki";
7 if [ ! -d ${varDir} ]; then
8 install -m 0755 -o ${apache.user} -g ${apache.group} -d ${varDir} \
10 cp -a ${webRoot}/conf.dist ${varDir}/conf
11 cp -a ${webRoot}/data.dist ${varDir}/data
13 chown -R ${apache.user}:${apache.user} ${varDir}/config ${varDir}/data
14 chmod -R 755 ${varDir}/config ${varDir}/data
16 install -m 0750 -o ${apache.user} -g ${apache.group} -d ${varDir}/phpSessions
19 webRoot = dokuwiki.withPlugins (builtins.attrValues dokuwiki-plugins);
23 modules = [ "proxy_fcgi" ];
24 webappName = "tools_dokuwiki";
25 root = "/run/current-system/webapps/${webappName}";
27 Alias /dokuwiki "${root}"
29 DirectoryIndex index.php
31 SetHandler "proxy:unix:${phpFpm.socket}|fcgi://localhost"
35 Options +FollowSymlinks
41 serviceDeps = [ "openldap.service" ];
42 basedir = builtins.concatStringsSep ":" (
43 [ webRoot varDir ] ++ webRoot.plugins);
44 socket = "/var/run/phpfpm/dokuwiki.sock";
48 group = ${apache.group}
49 listen.owner = ${apache.user}
50 listen.group = ${apache.group}
53 pm.process_idle_timeout = 60
55 ; Needed to avoid clashes in browser cookies (same domain)
56 php_value[session.name] = DokuwikiPHPSESSID
57 php_admin_value[open_basedir] = "${basedir}:/tmp"
58 php_admin_value[session.save_path] = "${varDir}/phpSessions"