From f9a735415809605df2b6e59546a5ac81ab9f496c Mon Sep 17 00:00:00 2001 From: clover caruso Date: Sat, 17 Oct 2026 13:58:42 -0700 Subject: [PATCH] Restore the original Zig mirror signature footer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use Clover’s exact footer for future signed-build pages and replace only the previously generated footer in preserved Markdown tables. Verified all 24 mirror tests and the rendered staged Copyparty page, including custom notes and unchanged timestamps. Assisted-by: gpt-6.1-sol --- service/zig-mirror/build/mirror.py | 7 +++++-- tools/zig-mirror-test.py | 9 ++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/service/zig-mirror/build/mirror.py b/service/zig-mirror/build/mirror.py index 6290e279de3c6d731b27e89dd5aacab3ef95c3ed..08f1e5d655fbf756231855d2f9320c4f74e2f07c 100644 --- a/service/zig-mirror/build/mirror.py +++ b/service/zig-mirror/build/mirror.py @@ -31,6 +31,7 @@ VERSION = re.compile(r'\d+\.\d+\.\d+(?:-dev\.\d+\+[0-9a-f]+)?\Z') PUBLIC_KEY = 'RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U' OFFICIAL = 'https://ziglang.org' NEKTRO = 'http://mirrors.nektro.net/zig/' +SIGNATURE_NOTE = 'Don\'t forget to verify your build signatures!  (the 🔐 is a link to the minisig)' MAX_ARTIFACT = 2 * 1024**3 _index_cache = (float('-inf'), {}) _index_lock = threading.Lock() @@ -196,7 +197,7 @@ def version_readme(version, artifacts, development=False): lines.append('| ' + architecture + ' | ' + ' | '.join(' '.join(targets[architecture].get(system, [])) or '—' for system in columns) + ' |') lines += ['', ''] if any(Path(str(artifact) + '.minisig').is_file() for artifact in artifacts): - lines += ['', 'Verify your build signatures. The 🔐 links open the Minisign signatures.', ''] + lines += ['', SIGNATURE_NOTE, ''] else: lines += ['', 'This historical release has no Minisign signatures. Verify its [official SHA-256](https://ziglang.org/download/index.json).', ''] return '\n'.join(lines).encode() @@ -416,7 +417,9 @@ class Mirror: if '-dev.' not in directory.name: preserved = preserved.replace(f'\n[Development builds](/mirrors/zig/{directory.name}/dev/)\n'.encode(), b'') if artifacts and linked == required and preserved.startswith(introduction) and b'https://file.paperclover.net' not in preserved: - content = preserved + content = preserved.replace( + b'\nVerify your build signatures. The 🔐 links open the Minisign signatures.\n', + b'\n' + SIGNATURE_NOTE.encode() + b'\n', 1) if previous == content: return None return {'path': str(path.relative_to(self.root)), 'before': before, diff --git a/tools/zig-mirror-test.py b/tools/zig-mirror-test.py index 48d7099a24f09f2af0a9cc455dcb801a73589f91..de3f6a8661d88073bfd1ba80dabb636fe5c24fd1 100644 --- a/tools/zig-mirror-test.py +++ b/tools/zig-mirror-test.py @@ -394,9 +394,11 @@ class MirrorTests(unittest.TestCase): artifact = self.cache.path('zig-x86_64-linux-0.17.0.tar.xz') artifact.parent.mkdir() artifact.write_bytes(b'already verified archive') + signature = Path(str(artifact) + '.minisig') + signature.write_bytes(b'already verified signature') (artifact.parent / 'dev').mkdir() stamp = mirror.stable_time('0.17.0') - for path in [artifact, artifact.parent, self.cache.root]: + for path in [artifact, signature, artifact.parent, self.cache.root]: mirror.set_mtime(path, stamp) release = {'date': '2026-10-01', 'docs': 'https://ziglang.org/documentation/0.17.0/', 'src': {'tarball': mirror.upstream(artifact.name), 'shasum': 'unused-cached-hash'}} @@ -405,11 +407,12 @@ class MirrorTests(unittest.TestCase): mirror.set_mtime(artifact.parent, stamp) readme = artifact.parent / 'preadme.md' custom = readme.read_text().replace('| Architecture |', '| Target |') + '\nCustom table notes.\n' - readme.write_text(custom.replace('
Verify your build signatures. The 🔐 links open the Minisign signatures.') + readme.write_text(stale.replace('