Gollum wiki image including omnigollum OAuth.
383
This image offers an easy way to deploy any git-based wiki repository. Just tell where your wiki is located and it will deploy a web application that allows to edit/add/remove pages. A basic authentication system is preinstalled and can be configured to only allow certain users to make changes to the wiki content.
This wiki uses gollum and omnigollum.
docker build -t hotmaps/wiki .
docker run -d --rm
-p 80:80
--name wiki
-e GITHUB_CLIENT_ID=0123456789
-e GITHUB_CLIENT_SECRET=0123456789
-e AUTH_USERS=email1,email2,email3
-e [email protected]
-e GIT_USER_NAME=web
-e GIT_BRANCH=master
-v /path/to/wiki_dir:/root/wikidata
-v /path/to/ssh_dir:/root/.ssh
hotmaps/wiki
Create .env file based on .env.example, update environment variables and make the volume point to your wiki directory.
# ./docker-compose.yml
version: '3.2'
services:
wiki:
env_file: .env
build: .
ports:
- "80:80"
volumes:
- "/path/to/wiki_dir:/root/wikidata"
- "/path/to/ssh_dir:/root/.ssh"
Run docker-compose (in terminal)
docker-compose up -d
Here are the environment variables that you need to configure to make the container work:
Here is the volumes you need to configure:
Gollum pushes commits automatically using post_commit hook. In order to push to the git remote you need to configure and register an ssh key.
You need to add two files in the ssh directory:
Find more information on how to generate an ssh key and register it to GitHub here (registeration process might slighty defer depending on where your git remote is hosted).
You also need to add a volume to share your ssh key with the container:
You will also need to edit the config.rb file:
# ./config.rb
# [...]
# Hooks
Gollum::Hook.register(:post_commit, :hook_id) do |committer, sha1|
system('/root/wikidata/.git/hooks/post-commit')
end
Of course you can add any other kind of hooks.
For GitHub, you need to create client ID and client secret on GitHub website on the settings page of your account or ogranization, in developer settings, OAuth Apps.
To add another provider you should also edit config.rb:
# ./config.rb
# [...]
options = {
# OmniAuth::Builder block is passed as a proc
:providers => Proc.new do
# GitHub
provider :github, ENV['GITHUB_CLIENT_ID'], ENV['GITHUB_CLIENT_SECRET'],
# LDAP
provider :ldap,
:host => '127.0.0.1',
:port => 389,
:method => :plain,
:base => 'dc=example,dc=com',
:uid => 'uid',
:bind_dn => 'cn=manager,dc=example,dc=com',
:password => 'password'
# Twitter
provider :twitter, 'CONSUMER_KEY', 'CONSUMER_SECRET'
# OpenID
provider :open_id, OpenID::Store::Filesystem.new('/tmp')
# others ...
# [...]
}
Omnigollum allows many OAuth providers. You can find more information about this here.
Content type
Image
Digest
Size
345.6 MB
Last updated
about 6 years ago
docker pull hotmaps/gollum