On 15.09.2022 20:34, Per Jessen wrote:
Per Jessen wrote:
Andrei Borzenkov wrote:
I am still unsure because the first redirection comes to the local file (not to a mirror), and I do not know whether this redirection is performed by mirrorbrain/MirrorCache or web server on download.o.o itself. But it does not really matter because the final name on mirrors will still include version.
I've already checked the apache config pontifex, I'll do it again.
I have gone over the download.o.o apache config and I see nothing that does any redirection or rewriting based on symlinks. I can only conclude it is being done by mirrorbrain/mirrorcache.
For MirrorCache it apparently was added relatively recently: commit 90e6bf65e20c49a96a974b1a504a2dcea750675f Author: Andrii Nikitin <46994839+andrii-suse@users.noreply.github.com> Date: Thu Dec 9 07:09:53 2021 +0100 Special handling unversioned media symlinks (#235) * Remove outdated variable MIRRORCACHE_COUNTRY_RESCAN_TIMEOUT * Improve test 04-remote-link * Try to use redirect for unversioned media symlinks * Track symlink with hashes for unversioned media files if in the same folder * Do not calcuclate hashes for symlinks I won't claim to understand what MirrorCache tries to do it for, but it only does it for two files - -Media and -Current: +sub _detect_ln { + my ($dir, $file) = @_; + return undef unless $file && $file =~ m/.*(Media|Current)\.iso(\.sha256)?/; + Tests added in the same commit expect that sha256 files are links +echo now change the symlink and make sure redirect changes +( + cd $ap9/dt/folder1 + ln -sf file2.1-Media.iso file-Media.iso + ln -sf file2.1-Media.iso.sha256 file-Media.iso.sha256 +) +$mc/backstage/job -e folder_sync -a '["/folder1"]' +$mc/backstage/shoot +$mc/curl -I /download/folder1/file-Media.iso | grep -C 10 302 | grep /download/folder1/file2.1-Media.iso +$mc/curl -I /download/folder1/file-Media.iso.sha256 | grep -C 10 302 | grep /download/folder1/file2.1-Media.iso.sha256 +$mc/curl -L /download/folder1/file-Media.iso.sha256 | grep -q "2019dd7afaf5759c68cec4d0e7553227657f01c69da168489116a1c48e40270e "