--examples is not fully offline: root Before hook still bootstraps the client #611

Closed
opened 2026-08-08 15:14:33 +00:00 by the.auditor · 1 comment
Owner

examples.Apply short-circuits --examples inside the command's Action, but the root command's Before hook (config load, newClient → keychain token resolve, TLS config) runs first. So tpagectl site create --examples still requires a successful bootstrap: a malformed config, a genuine keychain error (propagated by resolveToken), or a broken --ca-cert path makes --examples fail instead of printing — contradicting the "works offline" claim.

Short-circuit earlier (e.g. skip client construction in the root Before when --examples is set, or handle --examples in a command-level Before).

See #610

`examples.Apply` short-circuits `--examples` inside the command's Action, but the root command's `Before` hook (config load, `newClient` → keychain token resolve, TLS config) runs first. So `tpagectl site create --examples` still requires a successful bootstrap: a malformed config, a genuine keychain error (propagated by `resolveToken`), or a broken `--ca-cert` path makes `--examples` fail instead of printing — contradicting the "works offline" claim. Short-circuit earlier (e.g. skip client construction in the root `Before` when `--examples` is set, or handle `--examples` in a command-level `Before`). See https://git.lan.thwap.org/thwap/thwap-pagesd/pulls/610
Owner

Fixed in #634: --examples output is generated without config/client bootstrap (covered by the new offlineCommand), so it works with a broken config or no server.

Fixed in #634: `--examples` output is generated without config/client bootstrap (covered by the new `offlineCommand`), so it works with a broken config or no server.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
thwap/thwap-pagesd#611
No description provided.