From 82e7ac75954c973a5c59a02684788c0fb26e14dd Mon Sep 17 00:00:00 2001 From: Martin Ashby Date: Sat, 21 Dec 2024 22:18:18 +0000 Subject: Bump zine 0.3.0 -> 0.8.0 Fix a lot of associated breakage Fix broken rss.xml file as highlighted to me by Matthijs van der Wild (thanks!) --- content/posts/2022-12-31-cgit.smd | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 content/posts/2022-12-31-cgit.smd (limited to 'content/posts/2022-12-31-cgit.smd') diff --git a/content/posts/2022-12-31-cgit.smd b/content/posts/2022-12-31-cgit.smd new file mode 100644 index 0000000..b2895f8 --- /dev/null +++ b/content/posts/2022-12-31-cgit.smd @@ -0,0 +1,25 @@ +--- +.title = "Cgit", +.author = "Martin Ashby", +.date = @date("2022-12-31T23:39:38Z"), +.layout = "single.shtml", +.custom = {"comments": true}, +--- + +In a [previous post](/posts/2022-09-25-back-to-git/) I switched back from fossil to git. I found [gitea](https://gitea.io/) to be a pretty good server. However, it has many features I do not use, and it takes a minimum of 15% of the RAM on my Raspberry Pi home server! I found a simpler setup. + +I have switched to plain git server accessed with SSH, which [git-scm](https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server) documents how to set up. I'd still like a web UI to allow others to see and download my code. [Cgit](https://wiki.archlinux.org/title/Cgit) is a simple web user interface for multiple git repositories. It runs as a CGI application, and I use caddy web server, so thanks to [Luke Hsiao's blog post](https://luke.hsiao.dev/blog/cgit-caddy-gitolite/) and [Andras Schneider's Caddy CGI plugin](https://github.com/aksdb/caddy-cgi) I managed to get it running fairly easily. + +One hitch was adding git LFS support. I use git LFS for some media files on my blog. Gitea includes git LFS support out of the box, but a plain git server does not. I am using the standalone [reference server](https://github.com/git-lfs/lfs-test-server). This has a disclaimer that it's not 'production ready', but since I'm running this behind tailscale I'm reasonably happy it's ok. + +A second hitch was figuring out how to redirect from old repo locations to new ones, so I don't have to update every link in my blog. New repo locations simply don't have the `/martin` prefix. This seemed difficult in caddy, until I found [this post](https://caddy.community/t/modify-uri-and-then-redirect/16686/4) and I wound up with the following configuration, which seems to work well: +``` + ... + handle /martin* { + route { + uri strip_prefix /martin + redir https://{host}{uri} + } + } + ... +``` \ No newline at end of file -- cgit v1.2.3-ZIG