Setting sync up on a second computer meant typing the server, user,
password (or S3 keys, or GitHub token) and every tick again. Settings ›
Sync's form, with sync on, now has Copy setup. It copies one line,
`magpie-sync:…`, to paste into the same form on the other computer.
- The line is not base64 of the settings. It is the setup (server,
password or token, endpoint, region, path style, branch, the ticks)
sealed with the sync passphrase by backup.SealData, the AES-GCM and
PBKDF2 envelope the server's file already uses. The passphrase is never
in it. Whoever has the line and not the passphrase has nothing. The
copied note says what it holds and that the same passphrase opens it.
- Pasted into any field of the form, the line is not typed in; the form
asks for the passphrase, opens it (POST /api/davsync/setup-open), picks
WebDAV, S3 or GitHub from its address and fills every field and tick.
Nothing is saved until Turn on, and Turn on opens a pasted line first. A
wrong passphrase, or text that isn't a setup, is said in the reader's
language. A line a chat wrapped, or text around it, still opens.
- Not built: GitLab or MySQL sync backends.
Run (mica):
- At the pushed tree (run as 8fadc2ef8, the same tree before these bodies): go test ./internal/gui ./internal/davsync
ok; sync-setup-text, i18n-keys and i18n-en-no-cjk in the 110 of 110 the
commit before names. At the base 5b25d7e9e: ./internal/backup ok too.
New TestSetupTextOpensWithItsPassphrase (WebDAV, S3, GitHub; no secret
readable in the text or its decoded bytes; wrapped line; wrong
passphrase), TestSetupTextNeedsSyncAndItsOwnText and
TestDavsyncSetupTextRoutes (through the page's routes: off, copy, open on
a computer with sync off, wrong passphrase, nothing saved).
- New sync-setup-text.test.cjs, Chromium and WebKit, en, zh, zh-TW, ja, de
at 900px and en, zh at 440px: 42 of 42. The sync GUI files and
i18n-keys / i18n-en-no-cjk: green but s3-sync webkit en, red the same
alone on origin/main e4ea31321 (#3413).
- GOOS=linux go vet -tags nogui, GOOS=windows go vet: clean. gofmt clean.
- Broken by hand: SetupText unsealed (base64 of the JSON) made
TestSetupTextOpensWithItsPassphrase red ("dav-app-password-9z is
readable"); Turn on without opening the pasted line made all seven
"pasted setup fills" GUI tests red. Both restored green.
Not tried: a real WebDAV, S3 or GitHub server between two computers, a
paste in the real app, WebKitGTK.