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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
# Firefox Sync on cdg-1
## Deployment
`Unix/minimal-fxa-server/APKBUILD` packages upstream commit
`8ec5f0d160269f5079431d2b75574337f0552940` as `0_git20260225-r7`
(Debian version `0+git20260225-7`), with:
- `enforce-pkce.patch`: 27 production lines enforce S256 PKCE and client-ID
binding in both authorization-code exchange endpoints, plus regression tests.
- `cli-rpc-timeout.patch`: starts CLI RPC deadlines after interactive input,
supports a positive-duration `FXA_TIMEOUT` runtime override and a
`-ldflags="-X main.defaultRPCTimeout=30s"` build-time default override.
Without an override the RPC timeout remains 10 seconds, but time spent typing
passwords or confirming deletion no longer consumes it.
Missing PKCE and `plain` exchanges are intentionally rejected. Existing sessions
and refresh-token exchanges are unchanged. Firefox Desktop 158.0.1's bundled
source sends the required fields; a real browser login remains unverified.
It builds both `minimal-fxa-server` and `fxa-user` with CGO disabled, explicit
Linux/Go architecture selection and static `-buildmode=exe` output. Go strips
symbols itself; abuild's target-prefixed strip is disabled for these binaries.
Use the repository's CI artifacts for deployment, not ad hoc server builds.
CI now selects Debian output for this package. Enroll the signed APT repository
using `~/Projects/foundationpkgs-binaries/docs/apt.md`, then install/upgrade with
`apt install minimal-fxa-server`. The `.deb` owns both live binaries and their
license; its postinst restarts an already-running Accounts service using the
existing administrator-owned unit. It does not create accounts, change secrets,
initialize databases or enable an unconfigured service. Fresh servers still need
the one-time configuration described below.
Previous r2/r3 deployments used APK staging plus copied binaries, not package
ownership. The APT installation supersedes that manual-copy upgrade path.
Live verification on 2026-11-22 found `0+git20260225-6` installed and APT-owned,
with clean `dpkg --verify minimal-fxa-server`, the running server matching the
installed binary, all three services active, and `check-syncserver` passing.
The account socket remains private (directory 0700, socket 0600) and the secret
environment file remains root-only (0600). No reinstall or configuration change
was needed. Revision 7 refreshes tests and documentation only; production Go
source is unchanged from revision 6, so it does not require a service restart
for browser testing. Its CLI regression tests now run in ordinary package checks
without Python, and its PostgreSQL tests additionally reject code replay.
The original deployed **r0 tarball** (not replaced merely by publishing an APK)
was published by CI for repository revision
`0fea439e434b278805ab3aaaa8fd4c39fc5a3ff3`, build key
`48709aa96c4dee2eb5483d471d0b1866ebc7b2584741f69e7fc42f905228be44`:
<https://nply.org/dl/foundationpkgs/x86_64-unknown-linux-gnu/minimal-fxa-server/0_git20260225-r0/48709aa96c4dee2eb5483d471d0b1866ebc7b2584741f69e7fc42f905228be44/manifest>
Verify the accompanying SHA-256 digest. Extract packages into a staging directory,
then use `install -o root -g root -m 755` for the two binaries under `/usr/bin`.
**Do not extract the archive directly over `/`:** tar restores CI ownership and
parent directory modes, which must not replace system directory metadata.
## APK publication
The historical APK rollout selected this recipe in `.config/Jobfile`. The target was
`x86_64-alpine-linux-musl`; build dependencies are provided by the Debian host,
using upstream abuild and the CI user's persistent signing key. Query the pushed
revision rather than assuming success from the push:
```sh
scripts/fpkgs-ci.sh status minimal-fxa-server x86_64-alpine-linux-musl FULL_COMMIT_SHA
```
Use the public key and installation procedure in [CI documentation](ci.md#install-an-apk).
The APK contains both binaries and the MIT license. Static Go binaries avoid a
glibc/musl interpreter dependency. Debian service upgrades now use APT, not APK
management of Debian's root. Publishing a CI artifact alone never restarts a service.
## Services and configuration
- `syncserver.service`: existing native syncstorage-rs 0.21.1; `127.0.0.1:8001`.
- `minimal-fxa-server.service`: CI-built Accounts service; port 8002.
- `/etc/minimal-fxa-server/environment`: root-only environment file containing
PostgreSQL credentials and a persistent PEM RSA signing key. Local accounts;
database `minimal_fxa`, role `minimal_fxa`.
- `/run/fxa/usermgmt.sock`: private account-management socket.
- `/etc/syncserver/config.toml`: storage/token configuration, with
`fxa_email_domain = "sync.nply.org"` and
`fxa_oauth_server_url = "http://127.0.0.1:8003/oauth/"`.
- `/etc/lighttpd/vhosts.d/sync.nply.org.conf`: existing HTTPS certificate;
Accounts at the origin, `/1.0/`, `/1.5/`, and storage health/version endpoints
proxied to syncstorage-rs.
- `/etc/lighttpd/vhosts.d/sync-local-verifier.conf`: internal-only port 8003.
Upstream Accounts binds all interfaces. Its systemd unit uses
`IPAddressDeny=any` plus `IPAddressAllow=localhost`; only local lighttpd and
PostgreSQL traffic is allowed. Direct external access to port 8002 was tested
and blocked. VAPID keys are deliberately unset, disabling outgoing Web Push.
### Why the internal verifier listener exists
syncstorage-rs's native JWT verifier splits the JWT scope string on commas.
minimal-fxa-server emits space-separated scopes, so otherwise valid account
tokens are rejected. Its remote `/oauth/v1/verify` endpoint returns the expected
scope array.
Port 8003 proxies only `/oauth/v1/verify` to Accounts. JWKS requests receive 404,
selecting syncstorage-rs's **existing remote-verification fallback**. The Accounts
server verifies token signatures and expiration. This is configuration, not a
source patch, authentication bypass, or maintained fork. The trailing slash on
`fxa_oauth_server_url` is significant for relative URL joining.
## Create your account
No permanent user or default password was created. Run interactively:
```sh
ssh -t cdg-1 'fxa-user create your-email@example.com'
```
The CLI prompts for a password and confirmation. Take as long as needed at the
prompts; the RPC timeout starts afterward. To allow a longer server response:
```sh
ssh -t cdg-1 'FXA_TIMEOUT=30s fxa-user create your-email@example.com'
```
`FXA_TIMEOUT` must be a positive Go duration (`30s`, `1m`, etc.). This setting
belongs to the CLI process, not the Accounts service environment file.
The email is a local account identifier; it does not register a Mozilla account. Manage accounts with
`fxa-user list`, `fxa-user passwd EMAIL`, and `fxa-user delete EMAIL` (interactive
confirmation required for deletion).
## Firefox Desktop
Prefer a fresh profile for the first test; preserve existing profile data.
In `about:config`, set:
```text
identity.fxaccounts.autoconfig.uri = https://sync.nply.org/
identity.sync.tokenserver.uri = https://sync.nply.org/1.0/sync/1.5
```
Restart Firefox and use its normal sign-in flow with your **local account**.
HTTPS is enabled; do not enable `identity.fxaccounts.allowHttp`.
Upstream documents Android custom Accounts/Sync URLs through its Sync Debug
settings, but its instructions use Mozilla Push. Do not claim the documented
Android flow satisfies complete independence from Mozilla.
## Verification and limitations
Verified with a disposable synthetic account:
- Native CLI account creation with interactive password entry.
- Local password authentication over trusted HTTPS.
- OAuth code exchange, scoped-key JWE response, and local Sync token issuance.
- Hawk-authenticated storage write, read, and delete through HTTPS.
- Accounts autoconfiguration pointing only at this origin.
- Service restart, health/authentication smoke checks, and existing site health.
- Synthetic Accounts sessions/tokens/users and storage/tokenserver fixtures removed.
`/usr/local/bin/check-syncserver` checks trusted HTTPS/database heartbeat and
unauthenticated/invalid-token rejection. Inspect logs with:
```sh
ssh cdg-1 'journalctl -u minimal-fxa-server -u syncserver -n 80'
```
This does **not** verify full Firefox multi-device engine compatibility, key
unwrapping by real Firefox, recovery, mobile behavior, or send-tab/push delivery.
Push is disabled; real-time notifications cannot be promised. Firefox clients
may still have their own Mozilla Push connections until configured otherwise.
The server-side authentication/storage path is local; total client-side Mozilla
network independence remains unverified.
**Test-only security posture:** the PKCE patch does not fix predictable Sync
keys derived from non-secret user ID/timestamp inputs, no-op credential
revocation, or outstanding Go/runtime dependency findings. Do not interpret
successful health checks as security approval for sensitive Sync data.
The original deployment accepted the key-derivation risk; r2 fixes PKCE and r3
adds the CLI timeout correction. Neither release fixes the other security issues.
The patch's unit tests run during package checks. Its PostgreSQL endpoint tests
require `FXA_TEST_DATABASE_URI` pointing at a disposable database (never the live
Accounts database); each case rolls back its transaction. Run against the patched
source with `FXA_TEST_DATABASE_URI='...' go test -race ./oauth`.
The native Go CLI regression tests use synthetic responses from a disposable
Unix-socket gRPC server, not live accounts:
```sh
go test -race ./cmd/fxa-user
go test -ldflags='-X main.defaultRPCTimeout=3s' ./cmd/fxa-user
```
They check default/runtime timeout selection, invalid values, actual RPC timeout
enforcement, and confirmation delayed longer than the RPC budget. They run in
ordinary Go package checks. Password-prompt terminal interaction remains an
interactive check; the old Python-only helper has been removed from the patch.
### Owner-run browser acceptance
Use disposable profiles and non-sensitive test data because the security
limitations above remain. No browser profile or permanent account was changed
as part of the 2026-11-22 verification.
1. Create your local account with the interactive command above, if needed.
2. Set the two HTTPS preferences above in a fresh Firefox profile and restart.
3. Sign in and trigger Sync. Confirm that the expected engines report success.
4. Configure a second fresh profile/device for the same server and local account.
5. Create a distinctive test bookmark on the first device; manually sync both
and confirm it arrives on the second. Edit/delete it there and check the
reverse direction. Repeat with whichever engines you intend to rely on.
6. Restart Firefox and confirm sign-in and subsequent manual sync still work.
Do not use send-tab/push delivery as the pass criterion: push is disabled.
If a step fails, record the Firefox version, engine, step, and time, and inspect
`about:sync-log`. Logs can contain identifiers and tokens; redact before sharing.
Real-browser key handling and multi-device sync remain unverified until this
acceptance succeeds. Account recovery, mobile behavior, and full Mozilla network
independence are separate unverified capabilities, not implied by this checklist.
Back up all three databases (`minimal_fxa`, `syncstorage_rs`, `tokenserver_rs`)
and both secret configuration files before upgrades. Preserve signing/master
keys. Pre-switch configs are under
`/root/sync-before-local-accounts-20261029-150515/`.