~skiqqy/gwiki

Simple git based wiki
dffe3aa1 — Stephen Cochrane 4 months ago
Updated Dockerfile
f588c8b3 — Stephen Cochrane 3 years ago
Tidy up and added new feature
822640f2 — Stephen Cochrane 3 years ago
Added times to print, for better logging.

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~skiqqy/gwiki
read/write
git@git.sr.ht:~skiqqy/gwiki

You can also use your local clone with git send-email.

#gwiki

Simple git curated wiki

#Concept

I like the concept of simple statically generated websites, although they lack the feeling of "live content", that is, content can be updated anywhere, easily.

gwiki is simple, in that all it is, is a docker image which handles hosting of a wiki (and sub wikis), which themselves are hosted in public (or private) git repositories.

When gwiki detects a change in any wiki (be it the root, or sub wikis), they are rebuilt, and redeployed.

The keen reader may realise that this allows us to maintain a wiki (or arbitrary website) only through the actions of pushing updates to a repository.

The nice thing is gwiki doesnt have to be a wiki, it can be a basic website as well, it is essentially the concept of the dev server of my website, but improved.

#Building

To Build the image, something like the following will work (replace podman with docker if you use docker):

$ podman build -t gwiki:latest .

#Running

To run the image, the following is suitable

$ podman run --name gwiki \
		-p 80:80 \
		--env CONFIG_HOME=https://some.website/repo.git \
		--env TIMER=60 \
		gwiki:latest

Notable environment variables

  • CONFIG_HOME : The url to the root wiki, which should contain a config file, which is just an array containing urls to other repos to be hosted.
  • TIMER : Time in seconds between checking if a rebuild must occur.

#Getting Started

This repo ships with a basic "root" wiki script, to get started, the following will suffice, note mkdocs is used.

$ bash <(curl https://git.sr.ht/~skiqqy/gwiki/blob/master/setup)

Once the project has been creating, the only file of importance is config located in the root of the project that was just created.

This config file consists of a single array, with each element consisting of a url to a repository (this repository can be anything, but typically it would be a mkdocs project), gwiki then pulls, builds, and deploys this wiki.

Then if you wish to add a wiki to be deployed, you simply have to update config appropriatly, and push the changes, gwiki does the rest!

#Valid wiki repo

A valid wiki must have

  • Makefile in the project root, which builds the website with $ make

Optionally, the wiki repo may have the following

  • .gwiki/init.sh Bash/POSIX sh script which sets up the deps.
    • Note, the container is alpine based, hence you may install needed packages using alpines package manager apk.
  • config, this may specfiy subwikis, in which gwiki must pull, and build, it also acts in a similar manor to .gwiki/init.sh, except it gets called every build cycle, to specfiy subwikis, config should contain something like below: wikis=( 'https://some.git.repo/' 'https://another.git.repo' )