Nethence Newdoc Olddoc Lab Your IP BBDock  

Setting up Gollum on Ubuntu

Introduction

Gollum is a Wiki-like engine that allows different kinds of formatting, mainly Markdown but also MediaWiki.

I am considering three use-cases:

Installation

as root

Install the needed packages, and use gem to install system-wide Gollum & addons,

apt -y install ruby ruby-dev make zlib1g-dev libicu-dev build-essential git cmake
gem install gollum
gem install github-markdown # sate-of-the-art markdown formatting with tables capability
gem install wikicloth # mediawiki formatting
gem install gollum-rugged_adapter # https://github.com/gollum/gollum/wiki/Git-adapters
which gollum
gollum -v

note. github-markdown for the tables to display correctly

another method that I do not recommend (unless you figure out how to install addons),

#apt -y install git ruby ruby-dev zlib1g-dbg zlib1g-dev libicu-dev make build-essential
#gem install bundle
#git clone https://github.com/gollum/gollum.git
#git clone https://github.com/sekhmeth13/gollum-tweaked.git
#cd gollum/
#git pull
#bin/gollum -v
#bundle install

GIT setup to handle the documentation

Setup the GIT profile that corresponds to the non-authenticated Gollum WUI: try to use some mailing-list address and shared name. You will be able to setup binding to some Directory Server afterwards anyway.

git config --global user.email "project@example.com"
git config --global user.name "ACME Project"

Create either a locally editable,

git init operations/

or a Bare GIT repository (prefered for server usage),

git init --bare operations.git/

Configuration

You can also use the config file to setup Wiki options and environment,

cd ~/
vi gollum.rb

wiki_options = {
  :live_preview => false,
  :allow_uploads => true,
  :allow_editing => true,
  :h1_title => true,
  :universal_toc => true
}

Precious::App.set(:wiki_options, wiki_options)

Precious::App.set(:environment, :production)

Notes.

Operations

as user on a workstation

as gollum on a server or container (possibly with matching UID with the docker host)

Eventually make some handy symlinks,

cd ~/
ln -s /var/lib/gems/2.3.0/gems/gollum-4.1.2/config.rb gollum.rb.dist
ln -s /var/lib/gems/2.3.0/gems/gollum-4.1.2

And run it as user,

/usr/local/bin/gollum gitrepo/ --config gollum.rb --adapter rugged
#/usr/local/bin/gollum gitrepo.git/ --bare --config gollum.rb --adapter rugged

Notes.

Check that you can now access the Markdown GUI,

http://SERVER_ADDRESS:4567/

Everything’s fine? You can now proceed with the reverse-proxy setup.

Also provide some custom script to start it at boot time,

mkdir -p ~/bin/
vi ~/bin/run_gollum

!/bin/bash
cd $HOME/
/usr/local/bin/gollum gitrepo/ --config gollum.rb --adapter rugged > $HOME/gollum.log 2>&1 &

chmod +x ~/bin/run_gollum

sudo vi /etc/rc.local

echo -n Starting Gollum as USER_HERE user...
su - USER_HERE -c '$HOME/bin/run_gollum' && echo Done

Notes.

Editing the documents

You can now edit the documents with your editor of choice + git commit, either locally (workstation) or remotely (normal or bare through ssh).

Make sure you’ve got git available on your workstation and setup your GIT profile (if not already done),

git config --global user.email "your email"
git config --global user.name "your name"

Remote editing

Send your public SSH key (ssh-keygen && cat ~/.ssh/id_rsa.pub) to user_id_1000@dockerhost access list (~/.ssh/authorized_keys) and try to log into it without a password,

ssh user_id_1000@dockerhost

if that works, you’re ready to maintain the Documentation tru GIT e.g.,

git clone ssh://user_id_1000@dockerhost/data/gollumprod/operations.git/
cd operations/

(edit/add files)

when finished, commit your changes and push to the hosted repository,

#git add or git commit -a
git commit
git push

References


Home | GitHub | Donate | Contact