Follow dev-updater's own config to RON
The same move, for the same reason: this file is written and read by hand, and JSON has no comments to say why a host is configured the way it is. Both house rules come across with it, in config.rs's `format` module and nowhere else -- a file is the *body* of the config, so no outer parentheses and nothing indented for them, and `Some` is implicit, which is what makes `skip_serializing_if` on every optional field load-bearing rather than tidiness. The switch is outright: there is no reader for the old format. That is invisible everywhere except here, because this file holds the enrolled token hashes -- starting empty leaves the phone unable to talk to the server and looks, from the phone, like the config having been lost. So a config.json left beside the new file is named in the log and left alone, rather than read or deleted. One wart, documented at DriverKind: the kebab-case spelling is the string the phone compares against, so it stays, and the file pays for it with `kind: r#claude-cli` -- a hyphen is not a RON identifier. Renaming the variant would change what an already-installed build is talking to. Verified: cargo test, cargo clippy --all-targets, and a real start against a scratch state directory -- a hand-typed config with comments and a bare `port: 2222` loads, and what the server writes back sits at column 0 with no Some(...) in it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xn8nHw1tw1R6PtiY1eEtw
This commit is contained in:
1 parent
effefdeb03
commit
19de699bfa
13 files changed
+167
-30
No files matched your search
@@ -33,13 +33,19 @@ repo is in PLAN.md's "Backend layout" section.
|
||||
- `server/` — Rust backend (`ai-server`). `main.rs` bootstraps (TLS, the
|
||||
auth layer, token/QR enrollment, wg0 binding), `routes.rs` has the HTTP
|
||||
table in its module doc comment, `auth.rs` the bearer-token middleware,
|
||||
`config.rs` the persisted schema, `session/` the manager (registry
|
||||
pattern), `Driver` trait + event model, `EchoDriver`, and transcripts.
|
||||
`config.rs` the persisted schema and the RON its file is written in,
|
||||
`session/` the manager (registry pattern), `Driver` trait + event model,
|
||||
`EchoDriver`, and transcripts.
|
||||
- `app/` — Compose Android app, single `:androidApp` module, package
|
||||
`com.example.aiapp`, label "AI Sessions". `AppRoot.kt` is the navigation
|
||||
`when`; `Api.kt`/`EventStream.kt` the REST + SSE clients; `Events.kt` the
|
||||
event model mirror; `ServerConfig.kt` settings + Keystore-sealed token;
|
||||
screens in `SessionListScreen/SessionScreen/SpawnScreen/SettingsScreen`.
|
||||
- `.dev-updater.ron` — what Dev Updater is asked to do with this checkout:
|
||||
the backend (built in `server/`, installed and controlled through
|
||||
`server/service`) and then the APK (built in `app/`), in that order. The
|
||||
project it serves is the repository, not either half of it, which is why
|
||||
this sits at the root rather than in `app/`.
|
||||
- `server/src/certs.rs` — the TLS certificates, generated in process on
|
||||
first start into `$XDG_CONFIG_HOME/ai-app/certs`: idempotent CA, leaf
|
||||
reissued every start covering every local IPv4 plus 127.0.0.1 and
|
||||
@@ -121,7 +127,7 @@ Established 2026-08-25, and it decides more than it looks like:
|
||||
(qemu `hostfwd`) — usermode networking has none by default.
|
||||
- **Nothing secret goes in the repo.** The VM is treated as untrusted (see
|
||||
PLAN.md's security section), and the repo is shared read-write with the
|
||||
host, so state lives outside it: `$XDG_CONFIG_HOME/ai-app/config.json`
|
||||
host, so state lives outside it: `$XDG_CONFIG_HOME/ai-app/config.ron`
|
||||
and `certs/`, `$XDG_DATA_HOME/ai-app/sessions/`, owner-only.
|
||||
- Certificates are generated **by the server, on first start**, into
|
||||
`$XDG_CONFIG_HOME/ai-app/certs` (`--certs` overrides). The CA is created
|
||||
@@ -130,7 +136,7 @@ Established 2026-08-25, and it decides more than it looks like:
|
||||
separate throwaway dev CA for emulator work — never install a build
|
||||
pinning that on the real phone.
|
||||
- Point development at a scratch state directory rather than the real one:
|
||||
`--config /tmp/…/config.json --data-dir /tmp/…/sessions --port 8444`, or
|
||||
`--config /tmp/…/config.ron --data-dir /tmp/…/sessions --port 8444`, or
|
||||
`XDG_CONFIG_HOME=… XDG_DATA_HOME=…`.
|
||||
|
||||
## Things that have bitten
|
||||
|
||||
Reference in new issue
Block a user