summaryrefslogtreecommitdiff
path: root/manifests/wiki.pp
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-10-30 23:08:11 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-10-30 23:31:23 +0100
commit513c01ba9cbcbd895fcfbefc0be2932f38ba9855 (patch)
treea5503de92bc31da3a4d9973b7a88574588ba1c04 /manifests/wiki.pp
parentAdd xandikos. (diff)
downloadprofiles-513c01ba9cbcbd895fcfbefc0be2932f38ba9855.tar.gz
profiles-513c01ba9cbcbd895fcfbefc0be2932f38ba9855.tar.xz
Add wiki module.
Diffstat (limited to 'manifests/wiki.pp')
-rw-r--r--manifests/wiki.pp54
1 files changed, 54 insertions, 0 deletions
diff --git a/manifests/wiki.pp b/manifests/wiki.pp
new file mode 100644
index 0000000..b730e31
--- /dev/null
+++ b/manifests/wiki.pp
@@ -0,0 +1,54 @@
+class profiles::wiki (
+ String $wwwroot = '/var/www/wiki/',
+) {
+
+ # TODO letsencrypt for this
+
+ ensure_packages([
+ 'vimwiki-scripts',
+ 'xapian-omega',
+ ])
+
+ $cert_dir = $facts['letsencrypt_directory'][$::fqdn]
+ nginx::resource::server { "wiki.${::fqdn}":
+ ipv6_enable => true,
+ ipv6_listen_options => '',
+ ssl_redirect => true,
+ ssl => true,
+ ssl_cert => "${cert_dir}/fullchain.pem",
+ ssl_key => "${cert_dir}/privkey.pem",
+ www_root => $wwwroot,
+ use_default_location => false,
+ autoindex => 'on',
+ }
+
+ $auth_basic = {
+ auth_basic => '"Please log in"',
+ auth_basic_user_file => '"/var/tmp/htpasswd"',
+ }
+
+ nginx::resource::location {
+ default:
+ server => "wiki.${::fqdn}",
+ ssl => true,
+ ssl_only => true,
+ ;
+ 'wiki /search':
+ location => '/search',
+ fastcgi_params => 'fastcgi_params',
+ fastcgi_param => {
+ 'SCRIPT_FILENAME' => '/usr/lib/cgi-bin/omega/omega',
+ },
+ # TODO build fastcgi module, since this path changes between distros
+ fastcgi => 'unix:/run/fcgiwrap.socket',
+ location_cfg_append => $auth_basic,
+ ;
+ 'wiki /private':
+ location => '/private',
+ location_cfg_append => $auth_basic,
+ ;
+ 'wiki /':
+ location => '/',
+ ;
+ }
+}