Hosting


All Pages > wiki-ng docs > Hosting

Wiki-ng is just static html, so it can be hosted everywhere a webserver can be run.

Configuration

Update script

One option to keep the contents of the wiki up to date is to use the update script. To use the script, a gitea API token is required.

Usage: 
    ./update.sh -f <file> -t <api_token> -e 
      -f --file <dir>: location of the output directory
      -t --token <api_token>: gitea api token
      -e --extract: extract the tarball after download
    From environment: 
      FILE="/path/to/dir"
      TOKEN="api_token"

The extract option will extract the contents to the $FILE/public directory.

Example cron

*/5 * * * * /path/to/update.sh -f "/var/www/wiki-ng" -t "1234567890" -e

Zola

The other option to keep the contents of the wiki up to date is to pull the repository und build the files. To do that, install zola, clone the repository and run zola build in it. The contents will be located in the /public directory again.

Example script and cron

#!/bin/bash 

cd /path/to/repository 
git pull && zola build 
*/5 * * * * /path/to/update.sh

Nginx example config

server {
    listen [::]:80 http2;
    listen [::]:443 ssl http2;

    server_name dn42.cc;

    merge_slashes off;

    ssl_certificate /path/to/cert;
    ssl_certificate_key /path/to/key;

    root {/path/to/webroot}/public;
    # Remove this line if serving to dn42 
    rewrite /wiki/internal /403-internal permanent;

    error_page 404 /404.html;
}