Gollum
Gollum is a simple wiki system built on top of Git. A Gollum Wiki is simply a git repository (either bare or regular) of a specific nature:
- A Gollum repository's contents are human-editable, unless the repository is bare.
- Pages are unique text files which may be organized into directories any way you choose.
- Other content can also be included, for example images, PDFs and headers/footers for your pages.
Gollum pages:
- May be written in a variety of markups.
- Can be edited with your favourite system editor or IDE (changes will be visible after committing) or with the built-in web interface.
- Can be displayed in all versions (commits).
As you'll note in the (real world) screenshot above, my requirements for a personal wiki are:
- Portable across my devices
- Supports images
- Full-text search
- Supports inter-note links
- Revision control
Gollum meets all these requirements, and as an added bonus, is extremely fast and lightweight.
Note
Since Gollum itself offers no user authentication, this design secures gollum behind traefik-forward-auth, so that in order to gain access to the Gollum UI at all, authentication must have already occurred.
Gollum Requirements
Ingredients
Already deployed:
- Docker swarm cluster with persistent shared storage
- Traefik configured per design
- DNS entry for the hostname you intend to use (or a wildcard), pointed to your keepalived IP
Related:
- Traefik Forward Auth or Authelia to secure your Traefik-exposed services with an additional layer of authentication
Preparation
Setup data locations
We'll need an empty git repository in /var/data/gollum for our data:
mkdir /var/data/gollum
cd /var/data/gollum
git init
Gollum Docker Swarm config
Create a docker swarm config file in docker-compose syntax (v3), something like the example below:
Fast-track with premix! 🚀
"Premix" is a git repository which includes necessary docker-compose and env files for all published recipes. This means that you can launch any recipe with just a git pull
and a docker stack deploy
👍.
🚀 Update: Premix now includes an ansible playbook, enabling you to deploy an entire stack + recipes, with a single ansible command! (more here)
version: '3'
services:
app:
image: dakue/gollum
volumes:
- /var/data/gollum:/gollum
networks:
- internal
- traefik_public
deploy:
labels:
# traefik common
- traefik.enable=true
- traefik.docker.network=traefik_public
# traefikv1
- traefik.frontend.rule=Host:gollum.example.com
- traefik.port=4567
# traefikv2
- "traefik.http.routers.gollum.rule=Host(`gollum.example.com`)"
- "traefik.http.services.gollum.loadbalancer.server.port=4567"
- "traefik.enable=true"
# Remove if you wish to access the URL directly
- "traefik.http.routers.wekan.middlewares=forward-auth@file"
command: |
--allow-uploads
--emoji
--user-icons gravatar
networks:
traefik_public:
external: true
internal:
driver: overlay
ipam:
config:
- subnet: 172.16.9.0/24
Note
Setup unique static subnets for every stack you deploy. This avoids IP/gateway conflicts which can otherwise occur when you're creating/removing stacks a lot. See my list here.
Serving
Launch Gollum stack
Launch the Gollum stack by running docker stack deploy gollum -c <path-to-docker-compose.yml>
Chef's notes 📓
-
In the current implementation, Gollum is a "single user" tool only. The contents of the wiki are saved as markdown files under /var/data/gollum, and all the git commits are currently "Anonymous" ↩
Tip your waiter (sponsor) 👏
Did you receive excellent service? Want to compliment the chef? (..and support development of current and future recipes!) Sponsor me on Github / Ko-Fi / Patreon, or see the contribute page for more (free or paid) ways to say thank you! 👏
Employ your chef (engage) 🤝
Is this too much of a geeky PITA? Do you just want results, stat? I do this for a living - I'm a full-time Kubernetes contractor, providing consulting and engineering expertise to businesses needing short-term, short-notice support in the cloud-native space, including AWS/Azure/GKE, Kubernetes, CI/CD and automation.
Learn more about working with me here.
Flirt with waiter (subscribe) 💌
Want to know now when this recipe gets updated, or when future recipes are added? Subscribe to the RSS feed, or leave your email address below, and we'll keep you updated.