1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# Foundation Packages APT repository
Supported suite: Debian 13 (`trixie`), architecture `amd64` (and architecture-independent packages).
Public URL: <https://nply.org/dl/foundationpkgs-binaries/apt>.
## Signing and trust
APT verifies the OpenPGP signature on `InRelease` (or `Release.gpg` + `Release`).
That metadata authenticates the package indexes; the indexes contain the `.deb`
checksums. The `.deb` files are not individually OpenPGP-signed. HTTPS provides
transport security, not a replacement for repository signature verification.
Dedicated archive key:
- Identity: `Foundation Packages Archive <packages@nply.org>`
- Fingerprint: **`9EF366A63EC38FB0A160549D33F4C03101AEC8D2`**
- Algorithm: RSA-3072, signing capability; created 2026-10-29 UTC, expires 2028-10-28.
- Public keys: `keys/foundationpkgs-archive-keyring.gpg` and `keys/foundationpkgs-archive.asc`.
This is NOT the APK CI RSA key or an SSH key. The always-on publisher runs as
`fpkgs-publisher` on `cdg-1`, separately from the `git` build identity. Its private
OpenPGP key is in `/var/lib/foundationpkgs-publisher/gnupg` (0700), outside Git and
all publicly served trees. The existing key is retained so clients do not need
to change trust. The Mac's original key directory and private backup are recovery
copies, not a requirement for normal publication. The key has no passphrase for
unattended signing; account/file permissions protect it, not encryption.
A private-key export and revocation certificate are saved under
`~/.local/share/foundationpkgs/key-backups/` (directory 0700, files 0600). This is
an on-disk backup, not protection against disk loss. Copy it to encrypted/offline
storage under the owner's control. Never place it in the public repository.
Renew or rotate the key before expiry; distribute a replacement through an
already trusted channel. A revocation certificate must remain private until used.
## Enable on a Debian client
Obtain the key from this trusted checkout, or compare its full fingerprint over
an independently trusted channel before enrolling a downloaded copy. Do not
blindly trust a key merely because it arrived from the package server.
```sh
sudo install -d -m755 /etc/apt/keyrings
sudo install -m644 keys/foundationpkgs-archive-keyring.gpg /etc/apt/keyrings/
```
Create `/etc/apt/sources.list.d/foundationpkgs.sources`:
```text
Types: deb
URIs: https://nply.org/dl/foundationpkgs-binaries/apt
Suites: trixie
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/foundationpkgs-archive-keyring.gpg
```
Then use normal APT commands:
```sh
sudo apt update
sudo apt install minimal-fxa-server
sudo apt upgrade
```
The initial application release is `minimal-fxa-server` `0+git20260225-4`,
built by foundationpkgs CI at `fe3ac9a198f2d49b1bccd59e46662071204da9d5`.
Its package SHA-256 is
`bfccab54c4416b88b3f3726b5a9eed2aba1374c21fdcb22f7eee913cb9ef3110`.
On `cdg-1`, APT adopted the previously unmanaged binaries without changing their
bytes. The `.deb` owns both binaries and the license, not configuration, units,
secrets or databases. Its postinst uses `try-restart` for the existing Accounts
service; it does not enable an unconfigured service or restart Sync/lighttpd.
A root-only pre-adoption backup of binaries/configuration and three PostgreSQL
dumps is referenced by `/root/fxa-apt-adoption-latest-backup`.
Only packages actually published to the signed index are available. Existing
bootstrap tools (`abuild`, `apk-tools`) are also published. This does not mirror
Debian's dependency repositories. Ordinary APT updates are supported;
`unattended-upgrades` is a separate administrator policy and is not enabled here.
## Retained archive and publication on cdg-1
`archive/pool/` retains every imported package version. `repository-releases/`
retains complete signed snapshots, and `repository` points to the current local
snapshot. These are deliberately excluded from Git, but remain on the local
disk. Existing bootstrap binaries and their sources remain tracked in Git.
`provenance/` additionally retains downloaded CI artifacts/manifests/checksums,
build logs, and the exact recipe/tool snapshot; it too is excluded from Git.
Never delete these directories as if they were disposable build outputs.
The public CI artifact store independently retains the release provenance.
The authoritative data root is `/var/lib/foundationpkgs-publisher` on `cdg-1`.
The existing Mac archive remains a recovery copy. All new automation is POSIX
`sh`, using native Debian `apt-ftparchive`, `dpkg-deb`, GnuPG, rsync, curl and
checksum tools; no other scripting runtime is used.
The foundationpkgs Jobfile runs `checks → plan → packages → transfer → deploy`:
1. `packages` builds and tests the selected `.deb` files as the unprivileged CI user.
2. `transfer` looks up SHA-256-verified artifacts for the exact pushed commit,
copies each artifact/manifest/checksum/build log plus a `git archive` source
snapshot into a temporary handoff, and invokes the fixed publisher receiver.
3. `receive` rechecks the copied revision, target, control metadata, safe paths
and checksums, then retains them in `provenance/<commit>/`. It does not execute
or extract the supplied source snapshot. Repeated transfers must match.
4. `deploy` requires that retained receipt, checks immutable-version collisions
before importing, generates native APT indexes and a 90-day Release, and signs
with the existing archive key. Changed package bytes require a new `pkgrel`.
5. It retains a complete signed snapshot, verifies the staged public copy,
atomically switches the public `apt` symlink, then checks every file over HTTPS.
Only successful HTTPS verification records `provenance/<commit>/DEPLOYED`.
The two entry points are deliberately narrow:
```sh
sudo -n -u fpkgs-publisher /usr/local/libexec/foundationpkgs-apt receive FULL_SHA /var/lib/foundationpkgs-handoff/BUNDLE
sudo -n -u fpkgs-publisher /usr/local/libexec/foundationpkgs-apt deploy FULL_SHA
```
The wrapper clears the caller's environment and invokes root-owned
`/usr/local/libexec/foundationpkgs-publisher/publish-apt.sh`. The CI user has no
publisher shell or general sudo grant. Publication necessarily trusts the CI
identity to submit package content; that identity cannot read the signing key
or replace the installed publisher. Changes to publisher code require an explicit
administrator installation, not execution of scripts from the tested branch.
The versioned `scripts/ci-publisher-wrapper.sh` is the installation template.
A failed HTTPS check may occur after activation; report failure and inspect the
retained snapshot rather than claiming successful delivery. Inspect a stale
`.apt-publish-lock` before removing it; concurrent publishes fail closed.
`apt-repository.json` records the native host/destination/fingerprint; the installed
wrapper fixes production defaults. Publishing never installs or upgrades clients.
Metadata expires after 90 days to limit replay. Republish before expiry even
when package versions have not changed. A new snapshot retains old by-hash
indexes for clients downloading during publication. No historical `.deb` is
pruned automatically. A file-based APT source can use the local `repository`
path, provided APT's user can traverse its parent directories.
## CI-produced application packages
The `foundationpkgs` repository owns recipes and patches. Its opt-in Debian
backend produces `.deb` files as an unprivileged user with `dpkg-deb
--root-owner-group`; it never installs packages or holds this signing key.
Pacstall 6.3.11's build-only implementation still invokes sudo, so it is not used
in the unprivileged CI build. No broad sudo grant or Pacstall fork is introduced.
For each release, retain its verified CI `.deb`, manifest, checksums and build
log under `provenance/` before importing it. Source recipes and patches remain
in foundationpkgs; copy their release snapshot locally too. An offline rebuild
also needs the Go module cache and compiler/toolchain; keeping `.deb` files alone
does not guarantee one. Offline installation can require Debian dependency
packages not present in this repository.
## Application security is separate
Repository signatures authenticate the distributed bytes; they do not make the
application safe. The current FxA release still has predictable Sync encryption
keys and incomplete credential/token revocation, among other unresolved findings.
Use synthetic data until those are addressed. Real Firefox multi-device testing
also remains separate from the passing HTTP/CLI smoke checks.
## Checks
```sh
for file in scripts/*.sh tests/*.sh; do sh -n "$file" || exit; done
# On Debian with native tools: temporary fixture key/archive, no production state.
sh tests/apt-publisher.sh
# On a Debian client; network required, no installation or live-source changes:
sh tests/apt-client.sh
```
The client test verifies a real publication with isolated APT state and checks
an invalid signing key is rejected. It passed before live enrollment. The
publisher also compares every downloaded HTTPS file with the local archive. The local archive is not an
off-site backup; keep an additional copy for disk-loss recovery.