Repository navigation
Name Keel in apt and dpkg, and stop leaking the appliance identity - #8
Conversation
/etc/dpkg/origins/default resolved to a TurnKey file, so dpkg-vendor answered TurnKey and every bug reporting tool on the appliance addressed turnkeylinux/tracker. Closes the vendor half of #6. The overlay now ships a Keel origin file and no TurnKey one, and the conf script points default at it. The Keel file keeps Parent: Debian, so Dpkg::Vendor resolves the same vendor object dpkg-dev used before and package building is unaffected. tests/dpkg-vendor.bats takes every verdict from the real dpkg-vendor, pointed at the tree the script produced through dpkg's own DPKG_ORIGINS_DIR, rather than reading back the symlink the script wrote: --query Vendor, --query Bugs, --is, --derives-from. 15 bats, the script at 100 percent of 6 lines under kcov, covering both refusals.
mk/turnkey.mk and mk/turnkey-desktop.mk wrote a per-appliance /etc/apt/apt.conf.d/01turnkey: Acquire::http::User-Agent "TurnKey APT-HTTP/1.3 (turnkey-wordpress-19.0-trixie-amd64)"; so deb.debian.org, security.debian.org, every mirror in between and anyone watching the connection were told which appliance this machine is and which version it runs, on every apt run it ever made. Closes the User-Agent half of #6. The header is now a fixed file the overlay ships, 01keel, naming the distribution and nothing else. apt's https method reads the same setting, measured, so one line covers both schemes. conf/turnkey.d/apt-identity exists because apt reads apt.conf.d in lexical order and the last assignment of a scalar wins: a 01turnkey inherited from a parent layer built before this change silently beats the 01keel beside it, measured, and the appliance goes back to announcing itself. The script removes it and refuses if 01keel is not there. tests/apt-identity.bats reads every User-Agent verdict off the wire. tests/ua-recorder.py records the header a real apt-get update sent, over http and over TLS, so what is asserted is what apt announces rather than what the file says it should. The stale-01turnkey hazard has a test that measures it both ways. 11 bats, the script at 100 percent of 4 lines.
Every source conf/bootstrap_apt wrote for archive.turnkeylinux.org was plain http, including trixie-security. The archive serves https: measured 2026-09-28, HTTP/2 200 with a certificate that verifies, on the Release file of trixie, trixie-security and trixie-testing. Part of #6. The three deb822 stanzas and the three legacy sources.list lines written for pre-Trixie releases all move to https. The Debian sources beside them are left on http: they are Debian's own default, and the build host reaches them through a caching proxy that http is what feeds. This does not remove the TurnKey suites. 39 installed packages still resolve to that archive and none of them is available from Debian, so removing the sources would stop the build; the measurement and the plan per package are in the pull request and the follow-up issue. tests/apt-identity.bats extracts the stanzas from conf/bootstrap_apt itself, renders them with a build's variables and asks apt with apt-get indextargets what it would fetch, so the verdict is apt's own resolution rather than a grep over the file.
A changelog entry for the three changes, in changes/turnkey.changelog where an appliance changelog picks it up, and the measured coverage in COVERAGE.md: three files, all at 100 percent, 33 bats under kcov 43. Also records a defect the work uncovered: a bare "! cmd" in a bats test body asserts nothing, because bash does not apply errexit to a negated command. Both new suites use "run ! cmd". tests/postfix-local.bats has three bare ones left, noted for whoever owns that file next.
|
Review of The measurement, re-derived rather than acceptedRun read-only with
So the conclusion stands: the suites are load bearing and removing them today would remove packages nothing replaces. Three corrections to how it is stated are below. MEDIUM —
|
…cord An overlay only adds, so on a layer built over a parent from before this change /etc/dpkg/origins/TurnKey stayed on disk and dpkg kept knowing that vendor by name; the review found it on both live containers. The conf script now removes it, as apt-identity removes a stale 01turnkey. The test asks the real dpkg-vendor for TurnKey's Bugs field before and after, and failed without the change. The script now says why "Parent: Debian" in the Keel origin file is required rather than decoration. COVERAGE.md said a bare "! cmd" in a bats test never asserts. It does when it is the last command, because bats takes the last status as the verdict, so of the three bare negations in tests/postfix-local.bats only line 96 is inert. Corrected there and in the two suites' headers.
|
b10ae1e removes an inherited |
#8 landed on 19.x with its own paragraph on bare negations, which said the inert one in tests/postfix-local.bats was left for the pull request that owns that file. This is that pull request, and the merge kept both paragraphs. The first one now ends with what this branch did, and the second is gone.
…ning 19.x gained #8 and #10, and tests/coverage.sh in #8's shape: one kcov run per measured file, each with the suite that exercises it. This branch had rewritten it into one run over a list; its files move into #8's shape as targets (samba-rootpass, rootpass, webmin-enable, webmin-pam, each with its own suite, all at 100), and the two suites that measure no file of their own, before-firstboot.bats and pam-unix.bats, run after the loop so they still gate. The changelog keeps both sides' entries; COVERAGE.md keeps this branch's section under 19.x's baseline heading. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SfWQScmDZ94KCS5DMYrfe6
Name Keel in apt and dpkg, and stop leaking the appliance identity
#8 landed on 19.x with its own paragraph on bare negations, which said the inert one in tests/postfix-local.bats was left for the pull request that owns that file. This is that pull request, and the merge kept both paragraphs. The first one now ends with what this branch did, and the second is gone.
…ning 19.x gained #8 and #10, and tests/coverage.sh in #8's shape: one kcov run per measured file, each with the suite that exercises it. This branch had rewritten it into one run over a list; its files move into #8's shape as targets (samba-rootpass, rootpass, webmin-enable, webmin-pam, each with its own suite, all at 100), and the two suites that measure no file of their own, before-firstboot.bats and pam-unix.bats, run after the loop so they still gate. The changelog keeps both sides' entries; COVERAGE.md keeps this branch's section under 19.x's baseline heading.
Three of the four ways a Keel appliance still reported to TurnKey. The
fourth, the apt suites themselves, is measured here and deliberately not
touched: see "What this does not do".
Closes #6.
The dpkg vendor
/etc/dpkg/origins/defaultresolved to aTurnKeyfile, sodpkg-vendoranswered TurnKey and every bug reporting tool on the appliance addressed
turnkeylinux/tracker. The overlay now ships aKeelfile and no TurnKeyone, and
conf/turnkey.d/dpkg-vendorpointsdefaultat it.Parent: Debianis kept. That matters: there is noDpkg::Vendor::Keelperl module, so
dpkg-parsechangeloganddpkg-buildpackagefall back tothe parent's vendor object, which is the same
Dpkg::Vendor::Debiantheygot through TurnKey before. Package building is unaffected.
How it is asserted. Not by reading back the symlink the script wrote.
tests/dpkg-vendor.batsarranges the origins tree the overlay ships, runsthe conf script, and then asks the real
dpkg-vendorwhat it makes ofit, through dpkg's own
DPKG_ORIGINS_DIR(Dpkg::Vendorhonours it):--query VendoranswersKeel,--query Bugsanswers our tracker,--is TurnKeyfails,--is Keelsucceeds,--derives-from Debiansucceeds and
--derives-from Ubuntufails. The upgrade path is coveredtoo: a
defaultinherited as a symlink to TurnKey, as a regular file, andas a directory are each replaced, and the vendor query is what says so.
The apt User-Agent
mk/turnkey.mkandmk/turnkey-desktop.mkeach wrote a per-appliance/etc/apt/apt.conf.d/01turnkey:so
deb.debian.org,security.debian.org, every mirror in between andanyone watching the connection were told which appliance this machine is
and which version it runs, on every apt run it ever made.
It is now a fixed file the overlay ships,
01keel, naming the distributionand nothing else. Measured: apt's https method reads the same
Acquire::http::User-Agent, so one line covers both schemes.conf/turnkey.d/apt-identityexists for a reason worth stating. apt readsapt.conf.din lexical order and the last assignment of a scalar wins, soa
01turnkeyinherited from a parent layer built before this changesilently beats the
01keelbeside it:The script removes it, and refuses if
01keelis not there.How it is asserted. Off the wire.
tests/ua-recorder.pyis a localserver that records the
User-Agentheader of every request; a realapt-get updateis pointed at it and the test reads what apt actuallysent, over http and over TLS. So the verdict is apt's behaviour, not the
file's content. One test drives the stale-
01turnkeyhazard both ways: itmeasures TurnKey's header going out, runs the conf script, and measures
Keel's.
The strings the old header leaked each have their own refutation: the
sent header contains no
(, noTurnKey, noturnkey, nowordpress,no
trixie, noamd64and no19.0.https on the TurnKey archive
It is available. Measured 2026-09-28:
ssl_verify=0is a certificate that verifies against the system truststore.
trixie-securityandtrixie-testinganswer 200 over https aswell. So all six places
conf/bootstrap_aptwrotehttp://archive.turnkeylinux.org(the three deb822 stanzas and the threelegacy
sources.listlines still written for pre-Trixie releases) move tohttps.
The Debian sources beside them stay on http in this change, for one reason: that is Debian's own default and the payload is signed either way. (An earlier version of this description also said the build host's caching proxy only feeds http; it does not, squid there bumps https too, so that is not a reason.) The request stream over http still tells the path which packages at which versions an appliance fetches, the same confidentiality question the User-Agent change answers, so flipping the Debian URIs is worth its own change and is recorded in #7.
How it is asserted. The test extracts the heredoc bodies from
conf/bootstrap_aptitself, renders them with a build's variables, so thebytes under test are the generator's own output, not a copy in the test;
writes them into a scratch apt tree and asks apt with
apt-get indextargetswhich URIs it would fetch. No network. The verdictis apt's resolution of our sources: nothing under
http://archive.turnkeylinux.org, and all three suites present underhttps://. The Debian URIs are asserted unchanged so the scope of thechange is visible in the suite.
What this does not do
It does not remove the TurnKey apt suites. The measurement #6 asked
for is done and it says the suites are load bearing:
webminalone is 103 of them). Measured on thewordpress-democontainer (which never went through the container patch): 39 installed packages have their apt candidate in the TurnKey archive (41 of the 141 names are installed;confconsoleandinithooksare the other two, served byarchive.keellinux.orgat 1001). The count is per appliance: onforumit is 32. None is available from Debian at all.apt-cache policyover every installed package finds 0 where theTurnKey archive overrides Debian today.
trixie-testingisEnabled: noon a built appliance, so two suites areenabled, not three.
trixie-securityfrom TurnKey carries exactly one package,tklbam,at the version already installed.
/etc/apt/preferencespinningo=turnkeylinuxat 999,above Debian's 500, from
overlays/bootstrap_apt/etc/apt/preferences.It shadows nothing today; it would the day a name collides. Removing it is a change to how every appliance resolves packages, so by BRIEF section 12 (preserve upstream behaviour when in doubt) it goes with the migration in Migrate what the TurnKey apt suites still provide, then remove them #7 rather than riding here.
Of the 39: 7 are appliance infrastructure that must move to our pool,
7 are TurnKey Hub clients that should be dropped, 1
(
turnkey-keys) goes with the sources it exists to verify, and 24 arewebminand its modules, which is a product decision before it is apackaging one. Full table and plan per package: #7.
Removing a source the build still needs is worse than leaving it, so that
is a separate change.
Overlap with #5, and how to resolve it
This touches lines #5 also touches. #5 was read before these edits.
Trial-merged locally; three files conflict and every resolution is
mechanical. I have run the merged tree.
mk/turnkey.mk: the real one. Write /etc/keel_version beside the compatibility file #5 replaces the version-string lineswith a
keel-version-filescall; this removes the twoturnkey_aptconflines beside them. Take Write /etc/keel_version beside the compatibility file #5's call and drop the User-Agent lines:
Write /etc/keel_version beside the compatibility file #5's
turnkey_version=$$(cat .../etc/turnkey_version)goes too; it onlyexisted to build the header this deletes.
tests/coverage.sh: both branches replace the single-target scriptwith the same per-target loop. This branch deliberately uses Write /etc/keel_version beside the compatibility file #5's exact
loop so the resolution is a union of the
targetsarrays, fiveentries, nothing else.
COVERAGE.md: both add a table and prose; keep both.Merged tree measured, all five files at 100 percent:
postfix-local17/17,dpkg-vendor6/6,apt-identity4/4,version-files.sh15/15,keel-version-files36/36.Whichever merges first, the other rebases. Happy either way.
One thing #5 does not do and this does:
mk/turnkey-desktop.mkis asecond copy of the same
root.patched/postblock. #5 changes onlymk/turnkey.mk, so desktop appliances would keep writing the old headerand would not get
/etc/keel_version. This fixes the header in both; thekeel_versiongap in the desktop makefile is #5's to close and is nottouched here.
Tests
33 bats, all three measured files at 100 percent under kcov 43 with
bats 1.11, the threshold the gate is set to:
Both refusals of each new conf script are covered, which is every non-zero
exit either can produce.
Each assertion was mutation-checked rather than assumed: reverting one
deb822 URI to http fails tests 8 and 9; reverting the legacy line fails
test 11; setting
Vendor: TurnKeyfails 9 of the vendor tests; restoringthe leaking User-Agent fails 4 of the apt tests.
A defect this uncovered
A bare
! cmdin a bats test body asserts nothing. Bash does not applyerrexit to a negated command, so the test passes whatever happens and
execution continues. Measured:
Both new suites use
run ! cmdwithbats_require_minimum_version 1.5.0.tests/postfix-local.batshas three bare ones (lines 66, 96, 97), of which only line 96 is inert (the other two are last in their tests, and bats takes the last status as the verdict); they are left alone here so this diff stays on itsown subject, and are recorded in
COVERAGE.md. It is the same family asthe
docs/traps.mdentry "A bats suite cannot see a library that kills itscaller".
Test plan
COVERAGE_THRESHOLD=100 tests/coverage.sh: three files, all 100 percentshellcheck -S warningclean on every file this adds or changesarchive.turnkeylinux.orgmeasured before the scheme was changedapt-get update, http and TLSdpkg-vendor01keelin the image,no
01turnkey, anddpkg-vendor --query Vendoranswering Keel on abooted appliance. Not run: the build host's
core.tar.zstis in aknown-inconsistent state and a repair is pending, so the build lock
was deliberately not taken.
appliance / build-and-bootboots the layer the mirror already serves, notthis branch, so it cannot prove a change to the core layer either way
(Keel-Linux/.github#11).
Related
boot page, and with it the only reader of the
01turnkeythis deletes(
29tagidparsed the build tag out of that User-Agent).bin/secalerts.shreads the same file but is guarded and falls back toturnkey-version; measured that it survives the file's removal.Org-wide context: Keel-Linux/tracker#15.