mirror of
https://github.com/Studio-Saelix/sencho.git
synced 2026-08-11 03:06:54 +00:00
feat: guide missing external network creation during deploy (#1645)
* feat: guide missing external network creation during deploy Detect missing external networks before Compose runs, prompt or auto-create safe bridge networks, and keep unsupported declarations blocked with trusted deploy provenance. * test: align deploy context and settings fixtures with missing-network gate Update caller spies, EffResource expectations, StacksSection save keys, and git-source spy cleanup so CI matches the new deployStack context and auto-create setting. * fix: drop unused renderError binding in missing-network resolver Satisfies no-unused-vars so backend ESLint CI passes; callers already key only on model presence. * fix: use HTTP-safe clipboard helper in missing-network dialog navigator.clipboard fails on plain HTTP LAN hosts; route copy actions through copyToClipboard so Docker and Compose copy buttons work on self-hosted instances. * fix: simplify missing-network dialog actions and copy label Drop the Compose snippet escape hatch, move secondary actions under More, and rename the terminal copy action to Copy create command so the footer is a clear Cancel / Create decision.
This commit is contained in:
@@ -136,7 +136,7 @@ The rules in this category (except "Node-state checks skipped" itself) read live
|
||||
| Rule | Severity | What it detects |
|
||||
|------|----------|----------------|
|
||||
| Node-state checks skipped | Info | The Docker daemon could not be reached; node-state rules did not run and this result is partial. |
|
||||
| External network not found | Blocker | A network declared `external: true` does not exist on this node. The deploy will fail. |
|
||||
| External network not found | Blocker | A network declared `external: true` does not exist on this node. Deploy is blocked until the network exists. For safe default bridge networks, Doctor may offer a create remediation; advanced drivers and custom options stay manual. |
|
||||
| External volume not found | Blocker | A volume declared `external: true` does not exist on this node. The deploy will fail. |
|
||||
| New network will be created | Info | A non-external network that does not yet exist on this node will be created on first deploy. |
|
||||
| New volume will be created | Info | A named volume that does not yet exist on this node will be created on first deploy. |
|
||||
|
||||
@@ -92,7 +92,7 @@ The Networks section lists every network the effective model declares:
|
||||
|
||||
When a stack declares no explicit networks, the section shows **default network only**: all services share the implicit Docker bridge that Compose creates automatically.
|
||||
|
||||
External networks that do not exist on the node when you deploy will cause the deploy to fail. Compose Doctor flags missing external networks before you apply a change.
|
||||
External networks that do not exist on the node are detected before Compose runs. Interactive deploy opens a guided dialog so you can create safe bridge networks, copy a terminal create command, cancel, or open the Networking view. Automatic creation of those safe networks is optional under Settings → Stacks. Unsupported drivers or options are never created silently; the deploy stays blocked until you fix the Compose declaration or create the network yourself. Compose Doctor also flags missing external networks before you apply a change.
|
||||
|
||||
## Services
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ Admins can open **Create network** from the page header. The dialog matches the
|
||||
|
||||
## Findings
|
||||
|
||||
The **Findings** tab lists Compose-first networking issues Sencho derives from the effective model plus one live Docker snapshot per refresh, grouped into **Needs action**, **Review recommended**, and **Informational**. Examples include missing external networks, duplicate network names across stacks, host-network exposure mismatches, and stacks whose model could not be rendered.
|
||||
The **Findings** tab lists Compose-first networking issues Sencho derives from the effective model plus one live Docker snapshot per refresh, grouped into **Needs action**, **Review recommended**, and **Informational**. Examples include missing external networks, duplicate network names across stacks, host-network exposure mismatches, and stacks whose model could not be rendered. Missing external findings only offer create actions when the declaration is a safe default bridge network.
|
||||
|
||||
Findings also fold in the networking-relevant results from your last Compose Doctor run on each stack. A finding both engines detect shows **Live · also found by Doctor**; a finding only Doctor caught (Doctor checks a few things the live engine does not, such as host port conflicts) shows **Last Doctor run** with the timestamp of that run. Doctor's contribution is always the cached result of the last run on that stack, not a fresh check, so run Doctor again on a stack if you want its findings current. An active acknowledgement on a Doctor finding excludes it here too.
|
||||
|
||||
|
||||
@@ -76,11 +76,16 @@ Every Sencho release ships with a static list of capabilities. The current list
|
||||
| `registries` | Private registry management |
|
||||
| `self-update` | Self-update from the dashboard |
|
||||
| `vulnerability-scanning` | Image vulnerability scanning |
|
||||
| `compose-doctor` | Compose Doctor preflight |
|
||||
| `compose-networking` | Stack Networking tab and node Networking overview |
|
||||
| `guided-external-network-preflight` | Guided missing-external-network check before deploy |
|
||||
|
||||
<Note>
|
||||
`vulnerability-scanning` is advertised only when the Trivy binary is present on the node. If a node does not have Trivy installed, it omits this capability and the scanning UI is replaced by a lock card.
|
||||
</Note>
|
||||
|
||||
Nodes that do not advertise `guided-external-network-preflight` keep legacy deploy behavior (no guided missing-external dialog). When the capability is present but the check cannot run, deploy fails closed instead of guessing.
|
||||
|
||||
## Handling nodes that do not advertise metadata
|
||||
|
||||
If a remote node does not respond to `/api/meta` (for example, an unreachable instance, a slow handshake, or one that does not implement the endpoint), Sencho falls back to an offline metadata record with no version and an empty capability list. In that state:
|
||||
|
||||
@@ -22,7 +22,7 @@ Each entry in the activity list contains four pieces of information:
|
||||
|
||||
## Event categories
|
||||
|
||||
Ten categories have a dedicated icon. Any other notification scoped to a stack (deploy failures, scan findings, monitor alerts) also flows into the timeline and renders with a generic activity icon.
|
||||
Ten categories have a dedicated icon. Any other notification scoped to a stack (deploy failures, scan findings, monitor alerts) also flows into the timeline and renders with a generic activity icon. Automatic creation of missing external networks during deploy writes a history-only activity row (`network_auto_created`) on the stack timeline; it does not appear in the notification bell.
|
||||
|
||||
| Category | Example message |
|
||||
|----------|-----------------|
|
||||
|
||||
Reference in New Issue
Block a user