Skip to content

apt: reach every Debian and Ubuntu archive over https, through the mirror shim - #123

Merged
TusanHomichi merged 2 commits into
mainfrom
claude/project-thread-q7ic4n
Oct 16, 2026
Merged

TusanHomichi merged 2 commits into
mainfrom
claude/project-thread-q7ic4n

Conversation

@TusanHomichi

Copy link
Copy Markdown
Member

What this adds

This PR changes the adapters, the shim, the VM tier and the spec. It adds no route, so the template's route lines don't apply. It is item 4 of the data-trust audit, HTTPS for the deb archives, and follows #104.

Before: deb.debian.org, archive.ubuntu.com and old-releases.ubuntu.com were plain http. On any walk without --run, and on every hop before the signed ones (etch to stretch, trusty), anyone on the network path could serve the box any .deb.

After: every Debian and Ubuntu archive is a host/path mirror through tools/mirror.py. The box talks plain http to the shim on 127.0.0.1, and the shim fetches from the archive over https. That covers etch's and trusty's apt, which can't do https on their own. Runs now pin https://deb.debian.org/... and https://archive.ubuntu.com/....

How:

  • adapters/debian.toml: current = "deb.debian.org/debian". The archived releases were already shimmed by debian: fetch archived releases from a dated snapshot.debian.org tree #106.
  • adapters/ubuntu.toml: archive and current become host/path, and a new [mirror] section uses the same shim and port as EL and Debian. The probe is trusty's Release.
  • tools/mirror.py:
    • Allows the three archive hosts.
    • Refetches a live host's apt dists/ metadata on every request, as it already does rpm repodata/, because deb.debian.org's InRelease changes at every point release.
    • Hash-named files (by-hash/) and the dated snapshot.debian.org tree stay cached, since they never change.
  • tools/vm.py: debian-installer's release-pocket proxy runs on the host, so it now reads from the mirror as the host sees it (the shim on 127.0.0.1), not the guest's 10.0.2.2 address. For an http URL mirror that's the same URL as before.
  • SPEC: a "Transport" paragraph under "Signed packages".

Model

None: written by hand.

Evidence

  • ./wend check, every tools/test_*.py, cargo fmt, clippy and test, and client/parity.py all pass, with both engines identical.
  • I ran local chroot replays of this change, the same five files on the previous main, through the shim:
    • ubuntu/trusty-web, trusty→resolute: PASS, 6 hops, 15 min. The run pins only https://archive.ubuntu.com.
    • debian/etch-web, etch→trixie: PASS, 9 hops, 17 min. The run pins only https://deb.debian.org and https://snapshot.debian.org.
  • The gate replays use main's adapters, so CI won't exercise this. I'll ask for a remi VM run once review settles, since the VM tier's Ubuntu installer path changed.
  • Once this merges, the filed runs for bullseye+ and Ubuntu still pin http URLs. Fresh CI runs get filed afterwards, as runs: fresh CI-attested Debian etch-to-trixie runs pinning snapshot.debian.org #121 did for the snapshot.

Self-review

  • Every request still has to name an allow-listed host. The new hosts are three official archives.
  • A live mirror's metadata is never served stale from cache. Package files and hash-named files are, as before.
  • Edits tools/, adapters/ and SPEC on purpose, as a maintainer-requested change from the data-trust audit.
  • Commits are signed off.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EQ9ijFk8JWP18n4iscLJXi


Generated by Claude Code

…rror shim

deb.debian.org, archive.ubuntu.com and old-releases.ubuntu.com were plain
http, so on any walk without --run, and on every hop before the signed
ones, anyone on the network path could serve the box any .deb. The archives
are now host/path mirrors through tools/mirror.py, which the box reaches as
plain http on 127.0.0.1 and which fetches over https: trusty's and etch's
apt have no https of their own. The shim refetches a live archive's dists/
metadata each time, as it does rpm repodata, except by-hash files and the
dated snapshot.debian.org tree. The VM tier's release-pocket proxy fetches
from the shim as the host sees it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EQ9ijFk8JWP18n4iscLJXi
Signed-off-by: Claude <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-16T02:20:25.598726Z 118938c New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 80682a10f3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/mirror.py
@github-actions github-actions Bot added the needs-claude-review Waiting on the Claude review layer label Oct 16, 2026

Copy link
Copy Markdown
Member Author

Claude review of head 80682a10f304d35f249f0f8962ed3092b408c404. No blocking findings. The merge waits only on the remi VM runs.

Checked:

  • Shim allow-list and paths: the three new hosts are official archives. The path checks (no empty or dot segments, realpath inside the cache) are unchanged, so nothing new can escape the cache.
  • Cache freshness:
    • A live host's dists/ metadata is refetched on every request, so deb.debian.org's InRelease can't go stale across point releases.
    • by-hash/<sha256> names count as hashed and stay cached.
    • snapshot.debian.org is FROZEN, so etch's tree isn't refetched.
    • If an upstream 5xx forces the shim to fall back to its last good copy, signed hops still have apt's Valid-Until check. That fallback already existed for EL repodata.
  • --run walks with old runs: the client's verifying proxy keys pins by host/path and fetches with each pin's own scheme (fetch.rs pin_more). Existing runs that pin http://archive.ubuntu.com/... still verify, and fresh runs pin https.
  • Live client walks: Ubuntu now needs the shim, as EL and Debian already do. Without it, the walk refuses before any step with the existing "isn't answering" message (main.rs probe check).
  • VM tier: the release-pocket proxy runs on the host, so it must read through 127.0.0.1:8085, not the guest's 10.0.2.2. For a URL mirror that's the same value as before. The remi trusty run exercises exactly this.
  • Checkers: releases.archive and releases.current are host/path with [mirror].shim present, which both engines accept. Parity is identical.

CI is green on this head, including all five replays, and Codex's single protected-paths finding is answered.


Generated by Claude Code

…ve gaps)

Signed-off-by: Claude <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 118938c261

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tools/mirror.py

Copy link
Copy Markdown
Member Author

Claude sign-off for head 118938c.

  • All 12 checks green on this head, including the five gate replays.
  • The head is a main merge over 80682a1. The PR's diff against main is the same five files remi proved at 80682a1: ubuntu trusty-web passed 6 hops, debian etch-db passed 9 hops, and all 7071 new fetched.log lines are https.
  • Codex's stale-shim finding goes to a follow-up PR, per Peter's call. It's answered on its thread and will be linked there.

Merging under the project's merge policy.


Generated by Claude Code

@TusanHomichi
TusanHomichi merged commit f7278c9 into main Oct 16, 2026
12 checks passed
@TusanHomichi
TusanHomichi deleted the claude/project-thread-q7ic4n branch October 16, 2026 03:02
TusanHomichi pushed a commit that referenced this pull request Oct 16, 2026
Signed-off-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-claude-review Waiting on the Claude review layer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants