From: Omar Polo Subject: Re: nginx rewrites to migrate from cgit to gotwebd To: Landry Breuil Cc: gameoftrees@openbsd.org Date: Tue, 28 May 2024 15:51:06 +0200 On 2024/05/28 09:37:20 +0200, Landry Breuil wrote: > hi, > > currently migrating services, i'd like to get rid of cgit because slowcgi, but > the urls are handy. i've come up with the following that isn't perfect but is a > start, and works for some cgit-like urls. > > [...] > > the /c/ is for testing rewrites, the final idea is to have this location block > at the root to replace cgit. Nice! this reminded me however of my plan to change gotwebd URLs so that we don't have all those querystrings. What I'm currently trying is this: repo/action/path/to/file?commit=xyz (or ?headref=xyz) but could even eventually have something like repo/action/(commit or branch name)/path/to/file because https://git.omarpolo.com/amused.git/blob/feature-a/compat/foo.c is IMHO more readable than [...]?action=blob&path=amused.git&file=foo.c&folder=compat%2F&headref=feature-a and I guess it would also make the migrations from/to cgit or other viewers via URL rewrites easier. > one thing i've noticed is that gotwebd complains with invalid query string when > the commit arg is unset, couldn't we assume it's the HEAD commit in that case? IIRC Stefan really wanted this behaviour, and he kind of has a point. URLs with commit IDs are "snapshots" of the repository at that time, instead of whatever the latest main is. (see for e.g. github that for some time now adds a banner with "see the repo at that time" when you click on an old issue link that doesn't have a commit id.)