Serve the self-hosted APT repo from apt.learningequality.org and migrate existing consumers
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
Move the self-hosted Debian/Ubuntu APT repo — currently served per-installer at learningequality.github.io/kolibri-installer-debian/ and …/kolibri-server/ — onto a self-owned subdomain, apt.learningequality.org, and self-migrate the existing installed base onto it with no user action. The subdomain becomes the canonical, backend-independent APT URL.
Piloting on kolibri-server (low-risk); a hard prerequisite for kolibri-installer-debian's seamless publish.
Complexity: High · Target branch: develop
Context
The self-hosted APT repos are the documented install method for Debian 13 (Trixie) and up (via manual curl pubkey.asc + echo "deb …" > sources.list.d/…) at:
deb [signed-by=…] https://learningequality.github.io/kolibri-installer-debian/ stable maindeb [signed-by=…] https://learningequality.github.io/kolibri-server/ stable main
Researched constraints that shape the mechanism:
- The source is manually added, not package-owned, so it can't be rewritten by simply upgrading a config package that owns it.
- apt follows real HTTP 301/302 redirects (Location header, since 0.7.21) and GPG-verifies against the
signed-bykey regardless of host — but agithub.iopath can't do a 301 redirect. - Archived repos keep their Pages serving (read-only, frozen at last push) — so once the old repos are archived at their cutover state, stragglers still resolve the old URL and still get the cutover release whenever they next upgrade.
- Kubernetes'
apt.kubernetes.io→pkgs.k8s.iomove shows the failure mode: a manual source on a non-redirectable host, not tied to an auto-upgrading package, forced a manual cutover that broke stragglers. Ours avoids that because the source rides withkolibri/kolibri-server, which auto-upgrade.
The Change
-
A
repreproAPT-repo publish workflow that:- syncs the current repo state (
db/,pool/,dists/,conf/) down from the bucket, adds the new.deb(s) withreprepro includedeb stable, and syncs back up (read-modify-write); - so packages and versions from prior releases persist — a release shipping only
kolibrileaves the existingkolibri-serverpackage live; - syncs with
gcloud storage rsync(-c -d); - authenticates via
google-github-actions/auth+setup-gcloud, reusingrelease_kolibri.yml'sGH_UPLOADER_GCP_SA_CREDENTIALS; - targets
KOLIBRI_PUBLIC_RELEASE_GCS_BUCKETat anapt/path; - uses
rsync(not theupload-cloud-storageaction, which is upload-only) so it can do the sync-down leg; - signs the repo (
conf/distributionswith astablesuite + exportedpubkey.asc); - serializes publishes with a
concurrencylock so concurrent releases can't clobber the shared repo state; - replaces server's Pages-artifact deploy and debian's
gh-pagesforce-push (which rebuilt fresh each release) with one unified, stateful publish.
- syncs the current repo state (
-
A
kolibri-archive-keyringrepo-config package (its owndebian/packaging underplatforms/, thepackages-microsoft-prodpattern) that:- ships an apt source file (
/etc/apt/sources.list.d/kolibri.sources) pointing atapt.learningequality.org, plus the signing key; - replaces the manual
curl+echorecipe with one downloadable package; - carries future URL/key changes as its own updates.
A new user then installs with:
curl -fsSLO https://apt.learningequality.org/kolibri-archive-keyring.deb sudo dpkg -i kolibri-archive-keyring.deb sudo apt update && sudo apt install kolibri - ships an apt source file (
-
A
postinstcutover snippet, written for the kolibri-server package here, that:- if a
github.ioKolibri source exists in/etc/apt/sources.list.d/, replaces it with the keyring package's.sources(or rewrites the URL); - is a no-op when absent (e.g. Launchpad-PPA installs);
- is reused by debian for the
kolibripackage in its own migration.
- if a
-
A one-shot, committed seed script that:
- pushes a given
.debto the oldgithub.iogh-pagesbranch(es) exactly once; - is run for the cutover release — the first release after this merges, carrying the
postinst; - lets existing consumers on the old URL receive it and self-migrate;
- is documented as run-once, not part of the ongoing release.
- pushes a given
Out of Scope
- The installer migrations (server, debian) themselves — they publish to this host.
- The Launchpad PPA path — unaffected; this is the self-hosted repo only.
- server/debian package consolidation — #141.
- Bucket-hosting the backend — a later, invisible DNS switch.
- Retaining multiple older versions of a package (reprepro
Limit) — deferred; latest-per-suite for now, restore an older version if support is ever dropped. - Admin/ops/infra setup (subdomain + Cloudflare, secrets, running the one-shot seed, the readthedocs user-manual update, archiving the old repos) — tracked on #13720, not code here.
Acceptance Criteria
- [ ] The publish workflow read-modify-writes the
repreprorepo on the release GCS bucket'sapt/path (gcloud storage rsyncdown →includedeb→ rsync up, auth reused fromrelease_kolibri.yml). - [ ] The published repo is signed with the repo key, and serves
pubkey.asc. - [ ] A second publish adds its
.debwithout dropping packages/versions already in the repo (publish A, then B, then both resolve). - [ ] The
kolibri-archive-keyring.debbuilds and installs the apt source file + signing key. - [ ] After installing it,
apt updateworks with no manually-added source line. - [ ] kolibri-server's
postinstrewrites an existinggithub.iosource to the new URL (verified on Debian 13). - [ ] The
postinstis a no-op when nogithub.iosource is present (Launchpad-PPA install). - [ ] The seed script pushes a
.debto the oldgh-pagesbranch(es), safe to run once. - [ ] The seed script is documented as run-once.
- [ ] End-to-end on Debian 13: a client on the old
github.iosource, after upgrading to the cutover release, is rewritten toapt.learningequality.organd fetches later updates from there — no manual action.
References
- Docs (Debian 13 self-hosted-repo warning): https://kolibri.readthedocs.io/en/latest/install.html
- apt follows HTTP redirects: https://bugs.launchpad.net/bugs/18645
- GitHub Pages can't emit real 301s: https://github.com/orgs/community/discussions/22407
- Archived repos keep Pages serving: https://docs.github.com/en/repositories/archiving-a-github-repository
- Repo-config-package prior art: https://github.com/microsoft/linux-package-repositories
- Migration cautionary tale — Kubernetes: https://kubernetes.io/blog/2023/08/31/legacy-package-repository-deprecation/
AI usage
Used Claude Code to research and draft this issue; I drove scope and decisions. Claude verified the mechanism's constraints against GitHub's own docs, the Launchpad apt bug tracker, and the reprepro/GCS documentation.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
Fixed in #15054 - remaining tasks will be handled out of band of code changes.