Using gollum to modify gitlab wiki's

Hello,

I’m using:

  • ubuntu 20.04

  • GitLab Community Edition 14.1.2

  • Gollum 5.2.3

Gitlab and Gollum are installed via the ubuntu packet manager:

sudo apt-get install ruby ruby-dev make zlib1g-dev libicu-dev build-essential git cmake libssl-dev
sudo gem install gollum

When I manually create an empty git repository:

mkdir tester
cd tester
git init
gollum

I can reach, add and modify the repository via firefox using the url:

localhost:4567

When I export a gitlab wiki:

git clone git@gitlab1.vhel.invalid:vhelmont/grea
t-test-project.wiki.git

cd great-test-project.wiki
gollum

I can reach the repository via firefox using the url:

localhost:4567

But the url opens with the Home.md file although this file doesn’t exists in the gitlab wiki repository.
When I enter some data in it and save the file, the Home.md file and its modifications don’t appear in the great-test-project.wiki directory.
The command:

git status

tells me that the file is added and deleted:

git status
On branch main
Your branch is up to date with ‘origin/main’.

Changes to be committed:
(use “git restore --staged …” to unstage)
new file: Home.md

Changes not staged for commit:
(use “git add/rm …” to update what will be committed)
(use “git restore …” to discard changes in working directory)
deleted: Home.md

Does somebody else see this strange behaviour and how can it be fixed?

Regards,
Albert

Hi,

I haven’t used Gollum yet, a quick search for gollum home.md brought up this issue with a default setting override: [question]: is there a way to change the default Home.md? · Issue #1569 · gollum/gollum · GitHub

Maybe the below works, untested:

$ vim config.rb

Precious::App.set(:wiki_options, { :index_page => 'README' })

$ gollum --config config.rb

Cheers,
Michael

Hello Michael,

Thanks for the tip.
A config.rb file containing:

Precious::App.set(:wiki_options, { :index_page => 'home.md' })

indeed makes the gollum web interface start by opening the home.md file instead of the Home.md file.

There seems to be an additional issue.
The gitlab wiki creates main as the top branch while gollum expects master to be the top branch. This gives problems when you save your changes in the gollum web interface who tries to commit the changes to the non existing master branch.

A quick an dirty solution is to checkout a new master branch when in the main branch do your thing in the gollum web interface and when finished merge the master branch back into the main branch.

This is a complicated solution for the problem. Would it be possible to add an additional command to the config.rb file forcing gollum to work with the main branch instead of the master branch.

Regards,
Albert

Hello,
I found the answer to my question. You have to start gollum with the –ref option. In my case this becomes:

gollum --config config.rb --ref main

Regards,
Albert

1 Like