Skip to content

Fleet Panel: remote host settings (DB path, port, binary, logs) #355

Description

@jeonghun-jj-lee

Important

Approach

Add a Host Settings section to the Fleet Panel that exposes configurable settings for
the canonical server — read and written over SSH (reusing the SSH infrastructure from
the setup wizard). When the current machine IS the server, settings are read/written
locally. Changes that require a server restart show an indicator with one-click restart.


Acceptance Criteria

  • Host Settings section visible in the Fleet Panel when in fleet mode (server or client)
  • Settings exposed:
    • Session database path (where the opencode server stores sessions)
    • Server port (what port the canonical server listens on)
    • Binary path (which opencode binary the server runs)
    • Log directory (where server logs are written)
  • Read settings: on panel load and on explicit refresh, reads current values from the
    canonical server machine (over SSH for clients; locally for servers)
  • Write settings: inline edit → save → writes the config on the host machine
  • Restart required indicator: after a setting change that requires restart, shows a
    yellow "Restart required" badge with a "Restart Server" button
  • One-click restart: stops + starts the launchd/systemd service on the canonical
    server (over SSH for clients; locally for servers)
  • Validation: port must be numeric 1024-65535; paths must be absolute; binary path
    must exist on the host (validated before save)
  • Hidden when standalone: section not rendered when fleet role is standalone

Testing Decisions

  • Unit test: fleet_host_settings.test.ts — mock SSH reads/writes, verify correct
    commands generated for each setting
  • Unit test: validation logic — invalid port, relative path, missing binary → rejected
    with specific error
  • Unit test: restart-required detection — which settings trigger it (port, binary, DB path)
    vs. which don't (log dir)

Key Decisions

Decision Rationale
SSH for remote reads/writes Reuses wizard's SSH infrastructure; no new server-side API needed
Local path when "this machine" is server No SSH overhead for the common single-machine case
Restart-required per setting (not blanket) Log dir change doesn't need restart; port change does. Be precise.

Constraints & Invariants

  • Settings MUST NOT be cached stale — always read from the host on panel open/refresh
  • Write is atomic (tmp + mv) on the host side
  • Restart waits for health probe confirmation (server back up) before clearing the indicator

Source

Part of #350
Blocked by #354
ADR 0007: docs/adr/0007-fleet-panel-and-profile-ui.md

Metadata

Metadata

Labels

afkImplementable without human interactionenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions