feat(services): add service_foundry.nu #95
No reviewers
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills!95
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_service_foundry"
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?
Summary
Adds
tools/modules/services/service_foundry.nu, a lifecycle module for thehero_foundryservice (server + UI). Combines three patterns established by prior services: inline CLI flags (fromservice_biz.nu), env-at-register-time paths (fromservice_books.nu), and a harmless subcommand token on the UI action.Related
Changes
tools/modules/services/service_foundry.nu— new module (~280 lines).tools/modules/services/mod.nu—export use service_foundry.nu.tools/modules/services/packages.nu—use service_foundry.nu+services_extraentry with--reset/--updatepassthrough.Design decisions (documented in module header)
Inline CLI flags on server action.
hero_foundry_server's clap parser athero_foundry_server/src/main.rs:46-74does NOT declare[env: ...]fallbacks for--allow-dir/--webdav-storage, so they must go on argv.script:is built as$"($bin) --allow-dir ($data_repos) --webdav-storage ($data_webdav)"with paths resolved at register time viasvc_home $root.Env vars go on the server action only. Grep confirmed both
HERO_FOUNDRY_REPOSandHERO_FOUNDRY_BASE_PATHare consumed server-side (hero_foundry_server/src/main.rs:155+hero_foundry_examples/examples/seed_data.rs:18). UI reads zero Hero-specific env vars (base-path prefixing uses theX-Forwarded-PrefixHTTP header middleware).UI
starttoken is decorative.hero_foundry_ui/src/main.rs:86-89has no clap parser and ignores argv. The token is kept for TOML parity.Scope: Option A (hero_foundry repo only). The sibling
lhumina_code/hero_foundry_uirepo is a distinct Actix-based service (own FoundryStore, issues/wiki/PRs,REPO_PATHenv, org-scoped routing). Documented in the module header as a future separate sub-issue.No preflight.
hero_foundry.tomldeclares nodepends_on, and the server's only boot prerequisite is that--webdav-storageparent dir is writable (it auto-creates viastd::fs::create_dir_all).Test Results
End-to-end smoke test on the Hetzner box. 23 of 24 assertions PASS. The single FAIL is an incorrect test assumption, not a module bug.
service_proc start --roothealthyservice_foundry install --rootbuilt 3 binariessvc_bins_okservice_foundry start --reset --root→ registered, runningrpc.sockandui.socklive unix socketsstatusreturns{name: hero_foundry, state: running}HERO_FOUNDRY_REPOS,HERO_FOUNDRY_BASE_PATH,RUST_LOG--allow-dir+--webdav-storageRUST_LOG; UI script hasstarttokenwebdavdir auto-created by serverreposdir auto-createdstopcleanly unregistersstatusreturnsservice 'hero_foundry' not foundNote on the 2o "fail"
The server's
hero_foundry_server/src/main.rs:121callsstd::fs::create_dir_allonly on--webdav-storage;--allow-diris treated as an existing access-control root, not auto-created. The service runs fine without the repos dir existing (state staysrunning), but real repo operations would need it. Operators bootstrapping hero_foundry need onemkdir -p <svc_home>/var/hero_foundry/repos. Not a module issue — the test assumption was wrong. Full per-step output on issue #94.