feat(services): add service_mail.nu lifecycle module (#158) #168
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_skills!168
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_service_mail"
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
Add
tools/modules/services/service_mail.nu— a Nushell lifecycle module for thehero_mailHero service exposinginstall | start [--reset] | stop | status. Follows the user-level multi-binary pattern established byservice_browser.nu/service_livekit.nu: registershero_mail_server(RPC) andhero_mail_ui(admin dashboard) as two separate hero_proc actions composed into ahero_mailservice. No manager binary.hero_mail_cliis built and shipped to~/hero/bin/but not registered as an action.Related issue
Closes #158
Companion (canonical-layout work that doesn't block this PR): lhumina_code/hero_mail#1
Changes
tools/modules/services/service_mail.nu(307 lines)SVX_BINARIES = [hero_mail_server, hero_mail_ui, hero_mail_cli],SVX_ACTIONS = [hero_mail_server, hero_mail_ui].svx_server_action/svx_ui_action— pin canonical socket layout~/hero/var/sockets/hero_mail/{rpc,ui}.sockvia--bind unix:/--server unix://flags in the actionscriptfield, working around hero_mail's flat-default socket behavior.svx_check_stalwart— soft preflight for the external Stalwart dependency. Pure-bash TCP probe (</dev/tcp/HOST/PORT, noncrequired) to${HERO_MAIL_STALWART_ENDPOINT:-127.0.0.1:25}, falling back towhich stalwart-cli/stalwart-mail/stalwart. Warns but does not fail —hero_mail_serveralready tolerates Stalwart's absence (returnsstalwart_running:false).startsummary block prints service / actions / state / sockets / UI URL / Stalwart preflight status /hero_mail_clipath / a four-line test plan, pernu_service_use.svx_check_stalwartreferencesinstallers.nu::install_bun(#137) as the precedent for a future hard-prereq + auto-install path.Validation
All parse / load / help-render checks pass — see #158 (comment):
nu -c "source tools/modules/services/service_mail.nu; print 'parsed ok'"nu -c "use tools/modules/services/mod.nu *; print 'mod.nu ok'"help service_mail {install,start,stop,status}No automated test infrastructure exists for nu modules in this repo —
.forgejo/workflows/build.yaml::scripts/test.shonly validatesSKILL.mdfrontmatter underclaude/skills/. Target-host smoke testing (acceptance step "becomes healthy") is a follow-up on a real host withhero_procrunning.Caveats
--bind unix:is passed to both the server and UI actions for consistency. Ifhero_mail_uirejects--bind, a one-line follow-up can drop it fromsvx_ui_action.--rootis exposed on the public surface for tree-uniformity even thoughhero_mailitself doesn't need root (Stalwart owns the privileged ports). Documented inline.Add a Nushell lifecycle module for the hero_mail Hero service exposing install | start [--reset] | stop | status. Two-action shape (no manager): registers hero_mail_server (RPC) and hero_mail_ui (admin dashboard) as separate hero_proc actions composed into a hero_mail service. hero_mail_cli is built and shipped to ~/hero/bin/ but not registered. Action script fields pin canonical socket layout ~/hero/var/sockets/hero_mail/{rpc,ui}.sock via --bind / --server flags so binaries land in the per-service subdir regardless of their flat-default behavior. Stalwart is treated as a soft external prerequisite: TCP probe to ${HERO_MAIL_STALWART_ENDPOINT:-127.0.0.1:25} via pure-bash </dev/tcp/..., fallback to a `which stalwart-cli` lookup. Warns but does not fail when absent — hero_mail_server already runs in stub mode in that case. #158