Tidy up and added new feature
Added times to print, for better logging.
Simple git curated wiki
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.
To Build the image, something like the following will work (replace podman with docker if you use docker):
$ podman build -t gwiki:latest .
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
configfile, which is just an array containing urls to other repos to be hosted.
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
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!
A valid wiki must have
Makefilein the project root, which builds the website with
Optionally, the wiki repo may have the following
.gwiki/init.shBash/POSIX sh script which sets up the deps.
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' )