From 513c01ba9cbcbd895fcfbefc0be2932f38ba9855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sun, 30 Oct 2022 23:08:11 +0100 Subject: Add wiki module. --- manifests/wiki.pp | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 manifests/wiki.pp (limited to 'manifests/wiki.pp') 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 => '/', + ; + } +} -- cgit v1.2.3