e4e9eb0928becfa4e48484dde85ef5032671d582
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
459d668b35 |
sync: pick what syncs, preview a sync, undo the last one (#6428)
jinpwng (#6428, on X) syncs two computers and wants only Library and memory to go between them: each keeps its own providers, settings and models. They also want to see what a sync would change before it applies, and to roll the last one back. What syncs: providers, settings and profiles now have switches like agents' models, library and memory (Config.Providers/Settings/Profiles, *bool, nil = synced as before, so an existing setup syncs exactly what it did). The sync form shows Providers (and its API keys), Settings and Agents' models up front; Profiles, usage and sign-ins sit under Advanced, closed unless one is set away from its default. The form sends a part's choice only when it is or was off. A part left out stays as it is here and on the server; turning it back on joins it like a first sync (st.Off, rejoin). The sync's line says which parts each computer keeps ("Stays as it is on each computer: ..."). The setup text and the CLI carry it: magpie <webdav|s3|github> set providers=no settings=no profiles=no. Preview: davsync.Preview (plan.go) says, per part, what syncing now would bring in, send up, or leave; library items and memory files by name, sign-ins and plugins gone. Preview... in Settings > Sync shows it, and Sync now from there runs SyncPreviewed(token): if the server or this computer changed since, it says so and shows the new plan instead of syncing something else. CLI: magpie <kind> preview. Undo: a sync that brings parts in records them (st.Applied) and keeps a sealed copy of this computer first (keepSealed, as Restore does). Undo the last sync puts those parts back from that copy, on this computer only (st.Local, so the next sync sends it up rather than fetching the server's again). If one of them changed here since, it asks first (409 changed, Undo anyway). CLI: magpie <kind> undo-sync [anyway]. Restore's own Undo is unchanged. docs/subsystems/sync-backup.md and the site's sync docs (en, zh, ja) have a section on it. i18n: zh, zh-TW, ja, de. Run (worktree at base |
||
|
|
48e394146b |
davsync: the setup text's body regexp is compiled when first used (#6534)
|
||
|
|
d21cb563e9 |
sync: Copy setup gives the sync setup as text, sealed with the passphrase (WJaunita45604 on X)
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 |