diff --git a/docs/identity.md b/docs/identity.md index 31b2484..65ee49f 100644 --- a/docs/identity.md +++ b/docs/identity.md @@ -132,10 +132,12 @@ A current 3.6 install has only `Capture/…` and `Playback/…` rows there. ### `ts3clientui_qt.secrets.conf` -Some TeamSpeak 3 builds keep an obfuscated copy of the identity list in this -Qt config file next to `settings.db`. Voelin scans it for `identity=` lines -in the `.ini` form above and ignores the rest. It is **not** supported beyond -that: the file's own container format is not decoded. +Some TeamSpeak 3 builds keep the identity list in this Qt config file next to +`settings.db`. It is read by the same line scanner as the `.ini` export: every +`identity=` line becomes an identity and everything else is ignored. No such +file existed on the installation this was developed against, so that path is +best-effort — if a build wraps the lines in a container of its own, Voelin +finds nothing in it rather than guessing. ## Default locations @@ -154,21 +156,42 @@ installs keep `settings.db` next to the executable; point `--from` at it. ## What Voelin does +`voelin_core::identity` reads and writes these forms; `voelinctl` drives it: + ``` -voelinctl identity import --auto [--dry-run] -voelinctl identity import --from [--dry-run] -voelinctl identity export +voelinctl identity import --auto [--dry-run] [--store ] +voelinctl identity import --from [--dry-run] [--store ] +voelinctl identity list [--store ] +voelinctl identity export [--store ] ``` -- **Import** lists what it found as nickname, unique id and security level, +`--store` defaults to the desktop app's client database, +`/voelin/client.db`, so the CLI and the app share identities. + +- **Import** prints what it found as nickname, unique id and security level — + all three are public, everything else in an identity is the private key — and stores each one through `voelin-store` under its nickname. An identity whose TeamSpeak 3 unique id is already in the store is reported as a - duplicate and not added twice. `--dry-run` lists and stores nothing. -- The source file is opened read-only (`SQLITE_OPEN_READ_ONLY`, and the - `immutable` URI flag so a database the client currently has open is never - locked or recovered) and never written, moved or copied. + duplicate instead of being added twice, including repeats within one run. + `--dry-run` reads and stores nothing. With `--auto`, a location that holds + no identity is reported and skipped rather than ending the run. +- Source files are opened read-only (`SQLITE_OPEN_READ_ONLY`) **and + `immutable`**, so SQLite takes no lock, creates no `-shm` file and does not + replay a write-ahead log the running client left behind. Nothing of the + user's is written, moved or copied. The cost is that an identity the client + has written but not yet checkpointed into the main database file is not + seen; closing the official client first makes sure everything is there. - **Export** writes the TeamSpeak 3 `.ini` form, which the official client and - every other tool read. The file is created with mode `0600` on Unix. + every other tool read. A new file is created with mode `0600` on Unix, + before anything is written into it. + +An import is only trusted when the key pair is whole: the public key derived +from the private scalar has to verify what that scalar signs. The tests check +this on synthetic identities, and on a real installation when +`VOELIN_IDENTITY_IMPORT_CHECK` points `cargo test -p voelin-core` at a +database — which is how this was verified without any client's data entering +the repository. Every fixture in the tests is generated by +`tsclientlib::Identity::create`. ## Not supported @@ -183,3 +206,7 @@ voelinctl identity export so it writes them to `settings.db`, then import from there. - **Writing back to the official clients.** Voelin only reads them. Use the `.ini` export and the client's own import. +- **Bringing the nickname's history along.** Only the key pair and the + nickname are imported. Which servers an identity was used on, its badges and + its myTeamSpeak links stay behind; servers re-associate by unique id on the + next connection, which is the part that matters.