Skip to content

feat(web): daemon registry API under /api/daemons - #375

Closed
futrime wants to merge 1 commit into
mainfrom
feat/web-daemon-registry
Closed

futrime wants to merge 1 commit into
mainfrom
feat/web-daemon-registry

Conversation

@futrime

@futrime futrime commented Oct 12, 2026

Copy link
Copy Markdown
Member

Unit 3 of the multi-daemon + notifications plan (contract C1).

What

  • New src/hmz/web/daemons.py, registered in site.py:
    • GET /api/daemons: Local first (always up), then each ssh daemon with state, detail and version. These come from site.remotes.state(name) when the site has one; otherwise the daemon is idle.
    • POST /api/daemons {name, fields, replace}: add, or edit with replace. The fields are checked the way an SSHRuntime is checked. local, bad names and unknown fields are refused.
    • POST /api/daemons/remove {name}. Local can never be removed.
    • GET /api/daemons/hosts: ssh-config aliases that can become daemons and aren't daemons yet. Only those are resolved with ssh -G.
    • POST /api/daemons/import {aliases}: makes alias-only entries and skips any that already exist. The response lists added.
  • Stored in ~/.hmz/settings.yaml under daemons through coganchor.settings.changes. Each entry is {name, host, user, port, identity_file, proxy_jump, options: [[k,v]], alias, config}.
  • Public helpers saved(), found(name) and LOCAL are there for the remote-reach unit.
  • Docs: added the routes to docs/reference/web.md.

Tests

  • tests/unit/web/test_daemons.py
  • tests/integration/test_web_daemons.py
  • uv run pytest tests/unit and tests/integration/test_web_*.py pass.
  • Checked live with curl against hmz web under a scratch HUMANIZE_HOME.

🤖 Generated with Claude Code

Keep the ssh daemons a page may switch between in settings.yaml under
`daemons`, checked as an ssh runtime is: Local first and implicit, then
each one added by hand or imported from the ssh config. Each carries how
it stands from `site.remotes` where the site has one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 14:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@futrime

futrime commented Oct 12, 2026

Copy link
Copy Markdown
Member Author

Landed together in #385.

@futrime futrime closed this Oct 12, 2026
@futrime
futrime deleted the feat/web-daemon-registry branch October 12, 2026 23:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants