Publishing Gitlab wiki?

Matt,

That would be great! I’m a total newbie at this JSON business but am determined to get this up and running.

The support here is brilliant, and appreciated.

{
	"apps": {
		"http": {
			"servers": {
				"srv0": {
					"listen": [":80"],
					"routes": [{
						"match": [{
							"host": ["docs.caminfo.local"]
						}],
						"handle": [{
							"handler": "subroute",
							"routes": [{
								"handle": [{
									"handler": "file_server",
									"hide": ["Caddyfile"]
								}]
							}]
						}],
						"terminal": true
					}]
				}
			}
		},
		"git": {
			"clients": [{
				"repo": {
					"url": "http://gitlab.caminfo.local/root/system.wiki.git",
					"path": "/var/www"
				},
				"service": {
					"type": "poll",
					"interval": "10m"
				}
			}]
		}
	}
}

I’ve now got the above, Caddy is happy with it, saying it’s a valid config.

I then navigate to the page to browse the end result and get the following:

This docs.caminfo.local page can’t be found
No web page was found for the web address: http://docs.caminfo.local/

Before I added in the “file_server” option, which I believe is essential for anything to be displayed, I was just getting a blank page…

Anyone have any thoughts?

Good, that’s progress!

I think you’ll need to at least have root * /var/www (Caddyfile directive) to tell Caddy where to serve files from. You might also want to enable encode gzip for compression.

I don’t know how your wiki is structured. You’ll likely need to use the templates directive plus push some files to the wiki repo as a layout wrapper around your markdown pages:

Francis,

The wiki is just a set of .md files with an uploads folder containing images. Bog standard so to speak.

Alright - so you’ll want to add in an index.html file that acts as your template entrypoint. You’ll rewrite all requests to that file, like rewrite * /index.html. Using the templates, you can grab the original path and load the markdown file requested. See the Caddy website repo for an example:

Does anyone have an example of this working?

It’s all starting to get a bit beyond me unfortunately!

Unfortunately, your request is very much specific to your unique situation. All the information you need is available, you just need to put the pieces together to make it work.

That’s the thing, I thought several people would use Gitlab Wiki to publish documentation as it can do some great stuff and I love the fact you can take a screen shot and literally copy and paste it into your document.

I was starting to look at setting up Gitlab Pages which achieves the same thing but Caddy seemed much simpler!

I also looked at mkdocs which produces nice output but couldn’t seem to find support for dragging and dropping/copying and pasting images to it.

I almost gave in and tried to get this working on Caddy 1 today but then realised this wasn’t the right route to take!

This topic was automatically closed after 30 days. New replies are no longer allowed.