You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: architecture/gateway-deploy-connect.md
+19-11Lines changed: 19 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,11 @@ This document describes how the CLI resolves a gateway and communicates with it
11
11
When any CLI command needs to talk to the gateway, it resolves the target through a priority chain (`crates/openshell-cli/src/main.rs` -- `resolve_gateway()`):
12
12
13
13
1.`--gateway-endpoint <URL>` flag (direct URL, reusing stored metadata when the gateway is known).
14
-
2.`--cluster <NAME>` / `-g <NAME>` flag.
14
+
2.`--gateway <NAME>` / `-g <NAME>` flag.
15
15
3.`OPENSHELL_GATEWAY` environment variable.
16
16
4. Active gateway from `~/.config/openshell/active_gateway`.
17
17
18
-
Resolution loads `ClusterMetadata` from disk to get the `gateway_endpoint` URL and `auth_mode`. When `--gateway-endpoint` is used, the CLI still tries to match the URL to stored metadata so edge auth tokens and TLS bundles continue to resolve by cluster name.
18
+
Resolution loads `GatewayMetadata` from disk to get the `gateway_endpoint` URL and `auth_mode`. When `--gateway-endpoint` is used, the CLI still tries to match the URL to stored metadata so edge auth tokens and TLS bundles continue to resolve by gateway name.
|`ca.crt`|Cluster CA certificate -- verifies the gateway's server cert |
54
+
|`ca.crt`|Gateway CA certificate -- verifies the gateway's server cert |
55
55
|`tls.crt`| Client certificate -- proves the CLI's identity to the gateway |
56
56
|`tls.key`| Client private key |
57
57
@@ -81,24 +81,32 @@ For gateways behind an edge proxy (e.g., Cloudflare Access), the CLI routes traf
81
81
3. The gateway's `ws_tunnel.rs` handler upgrades the WebSocket and bridges it to an in-memory `MultiplexService` instance.
82
82
4. The gRPC channel connects to `http://127.0.0.1:<local_port>` (plaintext HTTP/2 over the tunnel).
83
83
84
-
Authentication uses a browser-based flow: `gateway add` opens the user's browser to the gateway's `/auth/connect` endpoint, which reads the `CF_Authorization` cookie and relays it back to a localhost callback server. The token is stored at `~/.config/openshell/clusters/<name>/edge_token`.
84
+
Authentication uses a browser-based flow: `gateway add` opens the user's browser to the gateway's `/auth/connect` endpoint, which reads the `CF_Authorization` cookie and relays it back to a localhost callback server. The token is stored at `~/.config/openshell/gateways/<name>/edge_token`.
85
85
86
86
### Plaintext connection
87
87
88
88
When the gateway is deployed with `--plaintext`, TLS is disabled entirely. The CLI connects over plain HTTP/2. This mode is intended for gateways behind a trusted reverse proxy or tunnel that handles TLS termination.
89
89
90
+
The CLI also treats an explicit `http://...` registration as plaintext mode:
0 commit comments