D1 — scaffold + sqlite schema #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
D1 — scaffold + sqlite schema
Sub-issue of
#?(v0.1 scope). First piece of code in the repo.Tasks
1. Scaffold from
hero_templateClone
hero_template→ renamehero_agent→hero_os_tfgrid_deployerthroughout. End state — 4 crates:crates/hero_os_tfgrid_deployer/— lifecycle CLIcrates/hero_os_tfgrid_deployer_server/— JSON-RPC backendcrates/hero_os_tfgrid_deployer_sdk/— generated typed clientcrates/hero_os_tfgrid_deployer_admin/— admin dashboard (Axum + Askama + Bootstrap, per/hero_ui_dashboard_admin)Workspace
Cargo.tomlupdated.cargo build --release --workspacepasses.2. service.toml + health endpoints
Per
/herolib_base+/hero_service:crates/hero_os_tfgrid_deployer_server/service.tomlwith proper metadata, kind=servercrates/hero_os_tfgrid_deployer_admin/service.tomlwith kind=adminhero_admin_lib::socket::bind_admin_socket(admin) and the standard rpc_server pattern (server)/healthand/.well-known/heroservice.json3. sqlite schema
Initial tables (server crate
src/db/schema.sql, using rusqlite or sqlx — pick one consistent with the rest of the workspace):Secrets (Forge token, SSH private key) NEVER stored in plaintext in sqlite — only references to
hero_proc secretentries. The deployer reads them viahero_proc secret getat use-time.4. CLI shape
hero_os_tfgrid_deployer --info --jsonreturns the canonical service info.hero_os_tfgrid_deployer --startstarts the server (which starts admin via service.toml).hero_os_tfgrid_deployer system pingis a sanity smoke check.OpenRPC methods (initial — additional in subsequent sub-issues):
deployer.system_pingdeployer.list_users(empty for now — fills as we add users)deployer.list_vms(empty for now)Acceptance criteria
cargo fmt --check && cargo clippy --workspace --all-targets -- -D warnings && cargo build --workspace --releasepasseslab build hero_os_tfgrid_deployer --download --installworks (after the first CI release)hero_proc service hero_os_tfgrid_deployer --startbrings the server + admin up cleanlycurl --unix-socket ~/hero/var/sockets/hero_os_tfgrid_deployer/rpc.sock http://localhost/health→ HTTP 200References
#?(v0.1 scope)hero_template/hero_service_check_fix·/hero_ui_dashboard_admin·/herolib_base·/hero_service