From 77003a01d8cd262cad6ac202982d6eea3e8291a2 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Fri, 21 Feb 2025 19:24:10 +0100 Subject: [PATCH] rottenraptor-server: add vhost for dokuwiki --- .../files/extras/rottenraptor-server/dokuwiki | 33 +++++++++++++++++++ nodes/rottenraptor-server.toml | 17 ++++++++++ 2 files changed, 50 insertions(+) create mode 100644 data/nginx/files/extras/rottenraptor-server/dokuwiki diff --git a/data/nginx/files/extras/rottenraptor-server/dokuwiki b/data/nginx/files/extras/rottenraptor-server/dokuwiki new file mode 100644 index 0000000..2e9b682 --- /dev/null +++ b/data/nginx/files/extras/rottenraptor-server/dokuwiki @@ -0,0 +1,33 @@ + location ~ ^/lib.*\.(js|css|gif|png|ico|jpg|jpeg|svg)$ { + expires 365d; # browser caching + } + + location ~ /(install.php) { deny all; } + + location ~ /(\.ht|\.git|\.hg|\.svn|\.vs|data|conf|bin|inc|vendor|README|VERSION|SECURITY.md|COPYING|composer.json|composer.lock) { + #return 404; # https://www.dokuwiki.org/install:nginx?rev=1734102057#nginx_particulars + deny all; # Returns 403 + } + + # Support for X-Accel-Redirect + location ~ ^/data/ { + internal; + } + + location / { + try_files $uri $uri/ @dokuwiki; + + # This means; where $uri is 'path', if 'GET /path' doesnt exist, redirect + # client to 'GET /path/' directory. If neither, goto @dokuwiki rules. + } + + location @dokuwiki { + rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; + rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; + rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; +# rewrite ^/tag/(.*) /doku.php?id=tag:$1&do=showtag&tag=tag:$1 last; #untested + rewrite ^/(.*) /doku.php?id=$1&$args last; + + # rewrites "doku.php/" out of the URLs if you set the userewrite + # setting to .htaccess in dokuwiki config page + } diff --git a/nodes/rottenraptor-server.toml b/nodes/rottenraptor-server.toml index 407bb70..1af14fb 100644 --- a/nodes/rottenraptor-server.toml +++ b/nodes/rottenraptor-server.toml @@ -8,6 +8,7 @@ bundles = [ "docker-goauthentik", "docker-immich", "ipmitool", + "php", "redis", "smartd", "zfs", @@ -28,12 +29,24 @@ gateway6 = "2001:67c:b54:1::1" redirect = "https://www.rottenraptor.com/" mode = 302 +[metadata.nginx.vhosts.dokuwiki] +domain = "wiki.rotten.city" +php = true +extras = true +webroot_config.owner = "www-data" + [metadata.nginx.vhosts.goauthentik] domain = "sso.rotten.city" [metadata.nginx.vhosts.immich] domain = "immich.rotten.city" +[metadata.php] +version = "8.2" +packages = [ + "xml", +] + [metadata.smartd] disks = [ "/dev/disk/by-id/ata-HUH721008ALN600_7SGH125C", @@ -43,6 +56,10 @@ disks = [ "/dev/disk/by-id/nvme-TOSHIBA-RC100_58UPC29HPW5S", ] +[metadata.vm] +cpu = 4 +ram = 8 + [metadata.zfs.pools.tank.when_creating] ashift = 12