Skip to content

Uploads to a wiki should be stored inside the wiki git repository

Editing wiki pages doesn't upload attached files into the repository, but instead uses the uploads directory. This is inconsistent with local Gollum behavior, prevents wikis from being rendered locally and makes it very hard to transport. We should treat the images as content of the repository.

Proposal

Images added through the wiki editor interface should commit the image to the Git repository, instead of being uploaded outside the repository. The image should be committed to the uploads folder in the root of the repository for consistency with Gollum (e.g --allow-uploads <dir> mode).

Future improvements:

Links / references

https://github.com/gollum/gollum#configuration – see --allow-uploads option

Original bug report

What is the current bug behavior?

Attaching the file inserts a markdown link pointing to /uploads/… (which gets expanded during rendering to contain the repo URL, so it will look like $hostname/$group/$repo/uploads/…). Contrary to normal gollum behaviour when executed locally, the file is not uploaded inside the repository, but hosted somewhere inside the gitlab installation, therefore not included in local checkouts.

What is the expected correct behavior?

When attaching files, they should also be added to the repository together with the commit changing the markdown, at the /uploads/ directory inside the git repo root, as done by gollum too (in --allow-uploads dir mode). Requests to URLs pointing to $wiki_url/uploads/ should serve files stored there.

This will fix the currently inconsistent behaviour of not being able to access files being locally uploaded via a local git clone and via running the local gollum editor.

Additionally, the --allow-uploads page mode might be supported via a project wiki setting

Edited by James Ramsay (ex-GitLab)