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/dokuwiki.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/dokuwiki.nix')
-rw-r--r-- | systems/eldiron/websites/tools/dokuwiki.nix | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/systems/eldiron/websites/tools/dokuwiki.nix b/systems/eldiron/websites/tools/dokuwiki.nix new file mode 100644 index 0000000..813c426 --- /dev/null +++ b/systems/eldiron/websites/tools/dokuwiki.nix | |||
@@ -0,0 +1,106 @@ | |||
1 | { lib, stdenv, dokuwiki, dokuwiki-plugins, config }: | ||
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 | ''; | ||
17 | }; | ||
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 | }; | ||
55 | webRoot = dokuwiki.withPlugins (p: [ p.farmer p.todo ]); | ||
56 | apache = rec { | ||
57 | user = "wwwrun"; | ||
58 | group = "wwwrun"; | ||
59 | modules = [ "proxy_fcgi" ]; | ||
60 | root = webRoot; | ||
61 | vhostConf = socket: '' | ||
62 | Alias /dokuwiki "${root}" | ||
63 | <Directory "${root}"> | ||
64 | DirectoryIndex index.php | ||
65 | <FilesMatch "\.php$"> | ||
66 | SetHandler "proxy:unix:${socket}|fcgi://localhost" | ||
67 | </FilesMatch> | ||
68 | |||
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); | ||
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"; | ||
85 | |||
86 | # Needed to avoid clashes in browser cookies (same domain) | ||
87 | "php_value[session.name]" = "DokuwikiPHPSESSID"; | ||
88 | "php_admin_value[open_basedir]" = "${basedir}:/tmp"; | ||
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:'"; | ||
91 | }; | ||
92 | }; | ||
93 | monitoringPlugins = [ "http" ]; | ||
94 | monitoringObjects.service = [ | ||
95 | { | ||
96 | service_description = "dokuwiki website is running on tools.immae.eu"; | ||
97 | host_name = config.hostEnv.fqdn; | ||
98 | use = "external-web-service"; | ||
99 | check_command = ["check_https" "tools.immae.eu" "/dokuwiki/" "<title>start"]; | ||
100 | |||
101 | servicegroups = "webstatus-webapps"; | ||
102 | _webstatus_name = "Dokuwiki"; | ||
103 | _webstatus_url = "https://tools.immae.eu/dokuwiki/"; | ||
104 | } | ||
105 | ]; | ||
106 | } | ||