Debian / debiman

debiman generates a static manpage HTML repository out of a Debian archive
Apache License 2.0
195 stars 46 forks source link

do not redirect stable -> bullseye nor bookworm -> testing #132

Open pabs3 opened 3 years ago

pabs3 commented 3 years ago

I think it would be useful to be able to include the suite name in URLs instead of the codename, for URLs that are meant to always point at stable or testing etc, no matter which release is current.

At the same time it would also be useful to be able to point at bookworm and not have the browser URL change to testing, which when copy-pasted could in the future be a different URL than the one intended.

stapelberg commented 3 years ago

Are you suggesting we keep around 2 copies of each manpage? I think having only 1 copy with a stable URL and redirecting to it is the cleaner approach.

Currently, stable releases (e.g. bullseye currently) get a stable URL, while testing, unstable and experimental are subject to change and hence reflected in the URL as such.

pabs3 commented 3 years ago

No, keeping one copy around and then instead of having redirects, just have one symlink per suite name pointing at the corresponding codename, preferably automatically updated after each release, or even just daily based on the contents of the local mirror. As long as the web server is configured to follow symlinks, this should work fine.

So the solution would be something like this:

ln -sf jessie /srv/manpages.debian.org/www/oldoldoldstable ln -sf stretch /srv/manpages.debian.org/www/oldoldstable ln -sf buster /srv/manpages.debian.org/www/oldstable ln -sf bullseye /srv/manpages.debian.org/www/stable mv /srv/manpages.debian.org/www/{testing,bookworm} ln -sf bookworm /srv/manpages.debian.org/www/testing mv /srv/manpages.debian.org/www/{unstable,sid} ln -sf sid /srv/manpages.debian.org/www/unstable mv /srv/manpages.debian.org/www/{experimental,rc-buggy} ln -sf rc-buggy /srv/manpages.debian.org/www/experimental

Or even just this:

find /srv/mirrors/debian/dists/ -maxdepth 1 -type l ! -name Debian* -print0 | xargs -0 -I{} cp -P {} /srv/manpages.debian.org/www/

-- bye, pabs

https://bonedaddy.net/pabs3/

stapelberg commented 3 years ago

Thanks for the details. To implement this suggestion, there are a couple of relevant points in addition to renaming/symlinking the directories:

pabs3 commented 3 years ago

Thanks, that sounds much more complicated than I thought.

Do you know if it is possible to put a regular rewrite before the RewriteMap, but passing the final rewrite decision along? If so then the existing RewriteMap could stay in place, but we could hardcode the current suite mappings in the Apache config and update it after releases. Or maybe the RewriteMap could rewrite for the suites once and then rewrite again.

stapelberg commented 3 years ago

Do you know if it is possible to put a regular rewrite before the RewriteMap, but passing the final rewrite decision along?

Unfortunately, I don’t know. The RewriteMap setup was pretty tricky to get right, so this would require some experimentation.