Skip to content

Commit f14f276

Browse files
committed
docs: clarify and visualize VPS deployment workflow
1 parent fa55ed6 commit f14f276

1 file changed

Lines changed: 93 additions & 4 deletions

File tree

DEPLOYMENT.md

Lines changed: 93 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,45 @@ The primary supported topology is:
1818
- a dedicated EventHorizon deployment directory and no conflicting production
1919
workloads, Compose projects, containers, volumes, or ports.
2020

21-
Raspberry Pi is a validated test environment, not a required deployment host.
22-
Native macOS, Windows/WSL, non-`x86_64` VPSs, multi-VPS deployment, provider
23-
firewall automation, and VPSs with conflicting production workloads are
24-
explicitly untested.
21+
The supported topology has three trust domains. The workstation proves the
22+
commit and controls deployment, GitHub supplies trusted source and CI evidence,
23+
and the VPS fetches and runs that exact commit:
24+
25+
```mermaid
26+
flowchart LR
27+
GH["Trusted upstream<br/>Git commit and push CI"]
28+
29+
subgraph OPERATOR["Operator workstation"]
30+
CTRL["Deployment controller<br/>vps_field_deploy.sh"]
31+
CFG["Ignored mode-0600<br/>target configuration"]
32+
end
33+
34+
subgraph VPS["Authorized Linux VPS"]
35+
FW["Provider and host firewall"]
36+
CHECKOUT["Exact commit checkout"]
37+
COMPOSE["Docker Compose field stack"]
38+
TARPITS["Telnet :23<br/>MQTT :1883"]
39+
MONITORING["Loopback monitoring<br/>:3000 :8081 :9090 :9101"]
40+
41+
FW -->|"SSH"| CHECKOUT
42+
FW -->|"protocol traffic"| TARPITS
43+
CHECKOUT --> COMPOSE
44+
COMPOSE --> TARPITS
45+
COMPOSE --> MONITORING
46+
end
47+
48+
CFG -.->|"read only for full deployment"| CTRL
49+
CTRL -->|"Git and read-only gh proof"| GH
50+
GH -->|"VPS fetches exact commit"| CHECKOUT
51+
CTRL -->|"source-restricted SSH"| FW
52+
CTRL -->|"source-restricted smoke on 23 and 1883"| FW
53+
CTRL -.->|"must be unreachable directly"| MONITORING
54+
```
55+
56+
Arrow labels define the allowed communication paths. The dashed configuration
57+
arrow is a local data dependency used only by full deployment. The dashed path
58+
to monitoring is explicitly forbidden: the workstation must observe those
59+
loopback-bound services as unreachable directly.
2560

2661
## 2. Security and exposure boundary
2762

@@ -40,12 +75,24 @@ The supported restricted validation posture is:
4075
| Prometheus | `127.0.0.1:9090/tcp` | unreachable directly |
4176
| Exporter | `127.0.0.1:9101/tcp` | unreachable directly |
4277

78+
The firewall requirement depends on the operation:
79+
80+
| Operation | VPS firewall requirement |
81+
| --- | --- |
82+
| `--help` | none; it is side-effect-free and performs no network access |
83+
| `--check-only` | none; it does not read the target file, use SSH, or contact the VPS |
84+
| full deployment | the configured SSH management port, TCP 23, and TCP 1883 are limited to the authorized workstation source; monitoring ports remain non-public |
85+
4386
Before deployment, configure provider and host firewall policy so TCP 23 and
4487
1883 are limited to the authorized workstation source. Keep the existing
4588
management SSH path source-restricted. The controller observes reachability
4689
from one workstation; it cannot prove firewall posture from every network and
4790
does not change firewall rules.
4891

92+
**Do not change SSH, TCP 23, or TCP 1883 ingress to `Any` for restricted
93+
validation.** Broad public ingress is outside the deployment workflow and
94+
requires a separate, explicitly authorized public-observation procedure.
95+
4996
Deployment authorization does not authorize prolonged public exposure.
5097
Starting public observation is a separate, explicit workflow.
5198

@@ -143,6 +190,11 @@ Do not continue if the outcome is `BLOCKED`, `FAIL`, `INCONCLUSIVE`, or
143190
`ERROR`. Use the reported next action and retained evidence; do not bypass a
144191
gate or substitute local checks for trusted CI.
145192

193+
A passing `--check-only` run neither requires nor verifies VPS firewall rules.
194+
Before proceeding to the full deployment command, confirm the full-deployment
195+
row in the security and exposure table above: the configured SSH management
196+
port, TCP 23, and TCP 1883 must be source-restricted, never opened to `Any`.
197+
146198
## 5. Deploy the same exact commit
147199

148200
Review authorization and firewall policy, then run from an interactive terminal:
@@ -156,6 +208,43 @@ Review authorization and firewall policy, then run from an interactive terminal:
156208
The command repeats commit eligibility before parsing target data or contacting
157209
the VPS. It then performs the fixed sequence:
158210

211+
```mermaid
212+
flowchart TD
213+
START["Invoke vps_field_deploy.sh"] --> MODE{"Operation?"}
214+
215+
MODE -->|"--help"| HELP["Print help<br/>no result and no network"]
216+
MODE -->|"--check-only"| CHECK["1. Deployment policy<br/>2. Candidate and trusted CI"]
217+
MODE -->|"full deployment"| LOCAL["1. Deployment policy<br/>2. Candidate and trusted CI"]
218+
219+
CHECK -->|"proven"| CI["PASS<br/>CI_VALIDATED<br/>no VPS contact"]
220+
CHECK -->|"not proven"| EARLY["Stop<br/>partial evidence<br/>no VPS mutation"]
221+
222+
LOCAL -->|"proven"| CONFIG["3. Strict target configuration"]
223+
LOCAL -->|"not proven"| EARLY
224+
CONFIG -->|"valid"| PREFLIGHT["4. Remote preflight"]
225+
CONFIG -->|"not valid"| EARLY
226+
PREFLIGHT -->|"proven"| AUTH["5. Interactive exact-phrase authorization"]
227+
PREFLIGHT -->|"not proven"| EARLY
228+
AUTH -->|"declined or interrupted"| EARLY
229+
AUTH -->|"accepted"| BOUNDARY["REMOTE MUTATION BEGINS"]
230+
231+
BOUNDARY --> DEPLOY["6. Exact-source deployment"]
232+
DEPLOY --> VERIFY["7. Runtime, bindings, and port verification"]
233+
VERIFY --> SMOKE["8. Deterministic Telnet and MQTT smoke"]
234+
SMOKE --> RETRIEVE["9. Retrieve and verify allowlisted evidence"]
235+
RETRIEVE --> ENV["PASS<br/>ENVIRONMENT_VALIDATED<br/>services remain running"]
236+
237+
DEPLOY -.->|"not proven"| LATE["Stop<br/>partial evidence<br/>attempt exact-service stop"]
238+
VERIFY -.->|"not proven"| LATE
239+
SMOKE -.->|"not proven"| LATE
240+
RETRIEVE -.->|"not proven"| LATE
241+
```
242+
243+
The upper branches are non-mutating. Remote contact starts at preflight, but
244+
remote mutation starts only after the exact authorization phrase is accepted.
245+
Every real invocation writes evidence even when it stops early; `--help` is the
246+
only exception.
247+
159248
```text
160249
1. deployment policy
161250
2. deployment candidate and trusted CI

0 commit comments

Comments
 (0)