diff --git a/charts/agent-relay/Chart.lock b/charts/agent-relay/Chart.lock index fdc3dbe2..6a1de246 100644 --- a/charts/agent-relay/Chart.lock +++ b/charts/agent-relay/Chart.lock @@ -13,7 +13,7 @@ dependencies: version: 0.4.22 - name: relay-webapp repository: file://../relay-webapp - version: 0.2.7 + version: 0.2.8 - name: relayflows repository: file://../relayflows version: 0.2.5 @@ -35,5 +35,5 @@ dependencies: - name: relaygate repository: file://../relaygate version: 0.1.10 -digest: sha256:5ecc32b3b39aed5ff642ed7b00101409c7f0081bbf01f18f4b214d46de24d636 -generated: "2026-11-19T07:44:50.985407885-08:00" +digest: sha256:ad3504a7f5e142fccd57d6512c8936dbfd9ce0647d8a65b647c5ab88ede640ea +generated: "2026-11-19T19:13:06.938977005Z" diff --git a/charts/agent-relay/Chart.yaml b/charts/agent-relay/Chart.yaml index f1b515a2..f6d578d2 100644 --- a/charts/agent-relay/Chart.yaml +++ b/charts/agent-relay/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: agent-relay description: Self-hosted Agent Relay messaging and sessions suite type: application -version: 0.7.66 +version: 0.7.67 appVersion: "0.1.0" kubeVersion: ">=1.28.0-0" annotations: @@ -33,7 +33,7 @@ dependencies: repository: file://../relay-control condition: components.control - name: relay-webapp - version: 0.2.7 + version: 0.2.8 repository: file://../relay-webapp condition: components.webapp - name: relayflows diff --git a/charts/agent-relay/README.md b/charts/agent-relay/README.md index 7f980dc7..07184143 100644 --- a/charts/agent-relay/README.md +++ b/charts/agent-relay/README.md @@ -251,10 +251,28 @@ of the durable-actors, Relayfile and flows proof overlays. One umbrella GKE Ingress reserves a global static address (`gkeIngress.staticIpName`), uses one Google ManagedCertificate for all four hosts, and enables HTTP-to-HTTPS redirect through a FrontendConfig. +The dashboard host routes `/mcp`, `/cloud/mcp`, +`/.well-known/oauth-protected-resource`, +`/.well-known/oauth-authorization-server`, `/.well-known/openid-configuration`, +`/cloud/.well-known` and `/cloud/oauth` to Control before the `/` dashboard +catch-all. These cover MCP, OAuth discovery, JWKS and browser consent for the +pinned Control 0.5.24 image (source `edad6432`). Token, registration and +revocation already use `/cloud/api`. Only the named root discovery prefixes +are claimed; `/.well-known/acme-challenge` remains available for ACME. +The leaf and GKE Ingress share `relay-webapp.controlPaths`; app-prefixed paths +are derived from the parent of `runtime.apiBasePath` (default `/cloud`). +With `/api` at the root, only named root discovery prefixes are routed; +the broad `/.well-known` route is omitted. + +The GKE dashboard rule has 11 Prefix paths in split-host mode and 12 in +single-host mode. All Control paths reuse the `api` backend and its +BackendConfig timeout (`gkeIngress.backends.api.timeoutSec`, default 3600). + For a base domain `relay.example.com`: - `relay.example.com`: `/cloud/api`, `/login` and `/relay-node` to the - control API, then `/` to the dashboard. `/relay-node/v1/*` (Desktop node + control API, plus the MCP and OAuth prefixes above, then `/` to the dashboard. + `/relay-node/v1/*` (Desktop node enrolment and the `GET /relay-node/v1/ws` node WebSocket) is served only at the root path, never under `/cloud`, and Desktop calls it on this sign-in origin. @@ -429,7 +447,7 @@ eksIngress: | `eksIngress.chief.serviceName`, `servicePort` | `EKS_ALB_CHIEF_SERVICE`, `_PORT` | empty (off), `3200` | | `eksIngress.control.serviceName` | `EKS_ALB_CONTROL_SERVICE` | `relay-control` | | `eksIngress.webapp.serviceName` | `EKS_ALB_WEBAPP_SERVICE` | `relay-webapp` | -| `eksIngress.controlPaths` | none | `[/cloud/api, /login, /relay-node]` | +| `eksIngress.controlPaths` | none | `[/cloud/api, /login, /relay-node, /mcp, /cloud/mcp, /.well-known/oauth-protected-resource, /.well-known/oauth-authorization-server, /.well-known/openid-configuration, /cloud/.well-known, /cloud/oauth]` | The render refuses what the script refuses: no domain or certificate; read-only without the history host or with ingest on; ingest off on a history host that is @@ -441,7 +459,9 @@ name, a certificate that is not an ARN, and malformed `controlPaths`. `controlPaths` is the list of dashboard-host (``) paths sent to the control API ahead of the dashboard catch-all, in order (Prefix paths; with Chief on, each becomes Exact plus `/*` after the Chief wildcards). The script has -no such option; the default is the list it emits. Pin the list your live ALB has +no such option; the default is the list it emits, including the MCP and OAuth +discovery/consent prefixes. Only the named root discovery prefixes are routed; +`/.well-known/acme-challenge` stays available. Pin the list your live ALB has so that a chart upgrade which changes the default does not change your listener rules unannounced. @@ -644,7 +664,8 @@ helm template agent-relay . -n agent-relay -f values-gcp.yaml -f values-single-h For `global.singleHost.host: relay.example.com`: - `relay.example.com`: `/cloud/api`, `/login`, `/relay-node` and `/api` to - the control API, then `/` to the dashboard. `/api` carries the flows worker endpoints and the + the control API, along with the MCP and OAuth prefixes listed above, then + `/` to the dashboard. `/api` carries the flows worker endpoints and the integrations OAuth callback, which relaycontrol hands out as `/api/v1/...`; it is not routed in the default mode, where the api host serves them. diff --git a/charts/agent-relay/templates/_helpers.tpl b/charts/agent-relay/templates/_helpers.tpl index 4890f89b..b720e877 100644 --- a/charts/agent-relay/templates/_helpers.tpl +++ b/charts/agent-relay/templates/_helpers.tpl @@ -287,3 +287,14 @@ hyphens, so no empty label ("a..b") and no label starting or ending with "-". */ {{- end -}} {{- if $ok }}true{{ end -}} {{- end }} + +{{- /* Compatibility default for upgrades whose saved values predate eksIngress. +Keep in step with values.yaml; the script/chart equivalence tests exercise both +normal defaults and the missing/null-key fallback, with Chief off and on. */ -}} +{{- define "agent-relay.eksDefaultControlPaths" -}} +{{- list "/cloud/api" "/login" "/relay-node" "/mcp" "/cloud/mcp" + "/.well-known/oauth-protected-resource" + "/.well-known/oauth-authorization-server" + "/.well-known/openid-configuration" + "/cloud/.well-known" "/cloud/oauth" | toJson -}} +{{- end -}} diff --git a/charts/agent-relay/templates/eks-alb-ingress.yaml b/charts/agent-relay/templates/eks-alb-ingress.yaml index a00ac6aa..642c1f12 100644 --- a/charts/agent-relay/templates/eks-alb-ingress.yaml +++ b/charts/agent-relay/templates/eks-alb-ingress.yaml @@ -82,7 +82,11 @@ published and not read-only. */ -}} {{- /* Dashboard-host paths sent to the control API. The default is the list the script emits; a path here is a Prefix route (Exact plus "/*" with Chief on), so it may not be "/", end in "/", or hold "*" or "//". */ -}} -{{- $controlPaths := dig "controlPaths" (list "/cloud/api" "/login" "/relay-node") $e -}} +{{- /* Old saved values may lack this key. Use the compatibility helper for +an absent or null key, but preserve an explicitly empty list. */ -}} +{{- $defaultControlPaths := include "agent-relay.eksDefaultControlPaths" . | fromJsonArray -}} +{{- $controlPaths := dig "controlPaths" $defaultControlPaths $e -}} +{{- if kindIs "invalid" $controlPaths }}{{ $controlPaths = $defaultControlPaths }}{{ end -}} {{- if not (kindIs "slice" $controlPaths) }}{{ fail "eksIngress.controlPaths must be a list of paths" }}{{ end -}} {{- range $p := $controlPaths }} {{- if not (and (kindIs "string" $p) (regexMatch "^(/[-A-Za-z0-9._~%!$&'()+,;=:@]+)+$" $p)) }}{{ fail (printf "eksIngress.controlPaths entry %v must be an absolute path such as /cloud/api: not \"/\", no trailing \"/\", \"//\", \"*\" or spaces" $p) }}{{ end -}} diff --git a/charts/agent-relay/templates/gke-ingress.yaml b/charts/agent-relay/templates/gke-ingress.yaml index 6264a14e..08b54279 100644 --- a/charts/agent-relay/templates/gke-ingress.yaml +++ b/charts/agent-relay/templates/gke-ingress.yaml @@ -582,34 +582,10 @@ spec: - host: {{ $hostRoot | quote }} http: paths: - - path: /cloud/api - pathType: Prefix - backend: - service: - name: {{ index $backendNames "api" }} - port: { number: {{ $gke.backends.api.servicePort }} } - - path: /login - pathType: Prefix - backend: - service: - name: {{ index $backendNames "api" }} - port: { number: {{ $gke.backends.api.servicePort }} } - # relay-node broker routes (POST /relay-node/v1/nodes, the - # GET /relay-node/v1/ws node socket, ...) are served only at the - # root path, never under /cloud. Desktop uses this sign-in origin as - # its control_url, so they must reach relay-control here, not the - # dashboard. The api BackendConfig timeout keeps the socket open. - - path: /relay-node - pathType: Prefix - backend: - service: - name: {{ index $backendNames "api" }} - port: { number: {{ $gke.backends.api.servicePort }} } - {{- if $singleHost }} - # Single-host mode: flows workers and the integrations OAuth - # callback call /api/v1/...; the api BackendConfig - # timeout covers the worker queue SSE stream here too. - - path: /api + # Control's MCP streams share the existing api BackendConfig timeout. + {{- $dashboardContext := dict "Values" (merge (dict "global" .Values.global) (deepCopy $dashboard)) }} + {{- range include "relay-webapp.controlPaths" $dashboardContext | fromJsonArray }} + - path: {{ . }} pathType: Prefix backend: service: diff --git a/charts/agent-relay/templates/local-kind.yaml b/charts/agent-relay/templates/local-kind.yaml index 131a21ff..c6720aa7 100644 --- a/charts/agent-relay/templates/local-kind.yaml +++ b/charts/agent-relay/templates/local-kind.yaml @@ -51,7 +51,8 @@ spec: - { protocol: UDP, port: 53 } - { protocol: TCP, port: 53 } --- -# Dashboard leaf ingress already handles /cloud/api, /login and /relay-node. +# Dashboard leaf ingress uses relay-webapp.controlPaths for /cloud/api, +# /login, /relay-node, MCP and OAuth discovery/consent paths. # Route the Desktop and integration /api entry point to the same control plane # as well. apiVersion: networking.k8s.io/v1 diff --git a/charts/agent-relay/values-eks.yaml b/charts/agent-relay/values-eks.yaml index abfec685..b52125db 100644 --- a/charts/agent-relay/values-eks.yaml +++ b/charts/agent-relay/values-eks.yaml @@ -60,7 +60,19 @@ gkeIngress: # enabled: true # domain: relay.example.com # REQUIRED OVERRIDE # certificateArn: arn:aws:acm:... # REQUIRED OVERRIDE (covers all four names) -# controlPaths: [/cloud/api, /login, /relay-node] # pin the live ALB's list +# # Pin the live ALB's list; the current default is: +# controlPaths: +# - /cloud/api +# - /login +# - /relay-node +# - /mcp +# - /cloud/mcp +# - /.well-known/oauth-protected-resource +# - /.well-known/oauth-authorization-server +# - /.well-known/openid-configuration +# - /cloud/.well-known +# - /cloud/oauth +# # An explicit earlier three-path list keeps its existing listener rules. eksIngress: enabled: false diff --git a/charts/agent-relay/values.yaml b/charts/agent-relay/values.yaml index b2676735..9844de5e 100644 --- a/charts/agent-relay/values.yaml +++ b/charts/agent-relay/values.yaml @@ -245,6 +245,13 @@ eksIngress: - /cloud/api - /login - /relay-node + - /mcp + - /cloud/mcp + - /.well-known/oauth-protected-resource + - /.well-known/oauth-authorization-server + - /.well-known/openid-configuration + - /cloud/.well-known + - /cloud/oauth # Child values are intentionally not populated with credentials or image # placeholders here. Every leaf chart fails closed until its existingSecret, diff --git a/charts/relay-webapp/Chart.yaml b/charts/relay-webapp/Chart.yaml index 1e255228..53d9a160 100644 --- a/charts/relay-webapp/Chart.yaml +++ b/charts/relay-webapp/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: relay-webapp description: Static self-hosted Agent Relay sessions and messaging dashboard type: application -version: 0.2.7 +version: 0.2.8 appVersion: "0.1.0" kubeVersion: ">=1.28.0-0" annotations: diff --git a/charts/relay-webapp/README.md b/charts/relay-webapp/README.md index 093f01ea..520bf644 100644 --- a/charts/relay-webapp/README.md +++ b/charts/relay-webapp/README.md @@ -9,7 +9,21 @@ settings are passed with `DASHBOARD_PUBLIC_URL`, `DASHBOARD_APP_PATH`, The browser calls `runtime.apiBasePath` (default `/cloud/api`) on its current origin. When ingress is enabled, the chart routes `runtime.apiBasePath` and -`runtime.loginPath` to `api.serviceName` and `/` to the dashboard. +`runtime.loginPath` and `/relay-node` to `api.serviceName` and `/` to the dashboard. + +The dashboard host also routes `/mcp`, `/cloud/mcp`, +`/.well-known/oauth-protected-resource`, +`/.well-known/oauth-authorization-server`, `/.well-known/openid-configuration`, +`/cloud/.well-known` and `/cloud/oauth` to Control before the `/` dashboard +catch-all. These cover MCP, OAuth discovery, JWKS and browser consent for the +pinned Control 0.5.24 image (source `edad6432`). Token, registration and +revocation already use `/cloud/api`. Only the named root discovery prefixes +are claimed; `/.well-known/acme-challenge` remains available for ACME. +The leaf and GKE Ingress share `relay-webapp.controlPaths`; app-prefixed paths +are derived from the parent of `runtime.apiBasePath` (default `/cloud`). +With `/api` at the root, only named root discovery prefixes are routed; +the broad `/.well-known` route is omitted. + `api.serviceName` has no default and is required with ingress: set it to the relay-control Service in the same namespace, which is that release's fullname (`-relay-control`, or its `fullnameOverride`; for example diff --git a/charts/relay-webapp/templates/_helpers.tpl b/charts/relay-webapp/templates/_helpers.tpl index d18a507a..ecc8ab5f 100644 --- a/charts/relay-webapp/templates/_helpers.tpl +++ b/charts/relay-webapp/templates/_helpers.tpl @@ -115,3 +115,23 @@ different backends, which controllers reject or resolve unpredictably. */ -}} {{- if and .Values.networkPolicy.enabled (empty .Values.networkPolicy.ingressFrom) }}{{ fail "ingress with networkPolicy requires networkPolicy.ingressFrom" }}{{ end -}} {{- end -}} {{- end -}} + +{{- /* Dashboard-origin paths served by Control. Reused by the umbrella GKE +Ingress; keep the EKS and Azure definitions in step (test_ingress_routes.py). +The app base is the parent of runtime.apiBasePath (normally /cloud/api). +Never claim all of /.well-known: ACME uses /.well-known/acme-challenge. */ -}} +{{- define "relay-webapp.controlPaths" -}} +{{- $api := trimSuffix "/" .Values.runtime.apiBasePath -}} +{{- $base := trimSuffix "/api" $api -}} +{{- $paths := list $api .Values.runtime.loginPath "/relay-node" + "/mcp" (printf "%s/mcp" $base) + "/.well-known/oauth-protected-resource" + "/.well-known/oauth-authorization-server" + "/.well-known/openid-configuration" -}} +{{- /* An API mounted at /api has no app base: claim only named root +discovery paths, leaving ACME and unrelated /.well-known routes alone. */ -}} +{{- if $base }}{{ $paths = append $paths (printf "%s/.well-known" $base) }}{{ end -}} +{{- $paths = append $paths (printf "%s/oauth" $base) -}} +{{- if include "relay-webapp.singleHost" . }}{{ $paths = append $paths "/api" }}{{ end -}} +{{- $paths | uniq | toJson -}} +{{- end -}} diff --git a/charts/relay-webapp/templates/ingress.yaml b/charts/relay-webapp/templates/ingress.yaml index a891fc86..e5269037 100644 --- a/charts/relay-webapp/templates/ingress.yaml +++ b/charts/relay-webapp/templates/ingress.yaml @@ -25,40 +25,14 @@ spec: paths: # Must precede "/" for ingress controllers that preserve declaration # order. Longest-path matching is also required by networking.k8s.io/v1. - - path: {{ .Values.runtime.apiBasePath }} + {{- range include "relay-webapp.controlPaths" . | fromJsonArray }} + - path: {{ . }} pathType: Prefix backend: service: - name: {{ .Values.api.serviceName }} + name: {{ $.Values.api.serviceName }} port: - number: {{ .Values.api.servicePort }} - - path: {{ .Values.runtime.loginPath }} - pathType: Prefix - backend: - service: - name: {{ .Values.api.serviceName }} - port: - number: {{ .Values.api.servicePort }} - # relay-node broker routes (/relay-node/v1/*, including the - # GET /relay-node/v1/ws node WebSocket) are served only at the root - # path, never under the API alias. Desktop calls them on this origin. - - path: /relay-node - pathType: Prefix - backend: - service: - name: {{ .Values.api.serviceName }} - port: - number: {{ .Values.api.servicePort }} - {{- if include "relay-webapp.singleHost" . }} - # Single-host mode: flows workers and the integrations OAuth - # callback use /api/v1/... on this host. - - path: /api - pathType: Prefix - backend: - service: - name: {{ .Values.api.serviceName }} - port: - number: {{ .Values.api.servicePort }} + number: {{ $.Values.api.servicePort }} {{- end }} - path: / pathType: Prefix diff --git a/charts/relay-webapp/values.yaml b/charts/relay-webapp/values.yaml index 63f9381e..a2fa00b1 100644 --- a/charts/relay-webapp/values.yaml +++ b/charts/relay-webapp/values.yaml @@ -53,7 +53,9 @@ runtime: # See the README "Customer profile" section. customerProfile: {} -# A leaf Ingress can proxy /cloud/api, /login and /relay-node to this Service. +# A leaf Ingress proxies /cloud/api, /login, /relay-node, /mcp, /cloud/mcp, +# /.well-known/{oauth-protected-resource,oauth-authorization-server, +# openid-configuration}, /cloud/.well-known and /cloud/oauth to this Service. # The GKE proof uses the umbrella Ingress instead and leaves this ingress # disabled. Required when ingress.enabled=true: the relay-control Service name # in this namespace, i.e. its fullname (-relay-control unless diff --git a/ci/agent-relay/kind/test_stack.py b/ci/agent-relay/kind/test_stack.py index b3176f32..8560ff56 100644 --- a/ci/agent-relay/kind/test_stack.py +++ b/ci/agent-relay/kind/test_stack.py @@ -131,6 +131,11 @@ def test_dashboard_ingress_routes_relay_node_to_control(self): dashboard = next(d for d in docs if d["kind"] == "Ingress" and d["metadata"]["name"] == "relay-webapp") paths = {p["path"]: (p["pathType"], p["backend"]["service"]["name"]) for p in dashboard["spec"]["rules"][0]["http"]["paths"]} self.assertEqual(paths["/relay-node"], ("Prefix", "relay-control")) + for prefix in ("/mcp", "/cloud/mcp", "/.well-known/oauth-protected-resource", + "/.well-known/oauth-authorization-server", "/.well-known/openid-configuration", + "/cloud/.well-known", "/cloud/oauth"): + self.assertEqual(paths[prefix], ("Prefix", "relay-control")) + self.assertEqual(paths["/"], ("Prefix", "relay-webapp")) def test_local_scope_guard_and_configurable_api_ingress(self): self.assertIn("allowLocalOnly", self.render(extra=["--set", "localKind.allowLocalOnly=false"], ok=False)) diff --git a/ci/agent-relay/render.sh b/ci/agent-relay/render.sh index 4c44f6f9..81fe4274 100755 --- a/ci/agent-relay/render.sh +++ b/ci/agent-relay/render.sh @@ -5,6 +5,7 @@ cd "$(dirname "$0")/../.." # Helm does not recursively vendor file:// dependency children. helm dependency build charts/sessions-pipeline >/dev/null helm dependency build charts/agent-relay >/dev/null +python3 ci/agent-relay/test_ingress_routes.py out=$(helm template proof charts/agent-relay -n agent-relay --no-hooks \ -f charts/agent-relay/values-gcp-proof.yaml \ -f charts/agent-relay/ci/gcp-proof-values.yaml) @@ -44,7 +45,7 @@ test "$root_login" = relay-control root_paths=$(yq 'select(.kind == "Ingress" and .metadata.name == "agent-relay-gcp-proof") | .spec.rules[] | select(.host == "gcp-proof.agentrelay.com") | .http.paths[] | .path + " " + .pathType + " " + .backend.service.name' <<<"$out") -test "$root_paths" = "$(printf '%s\n' '/cloud/api Prefix relay-control' '/login Prefix relay-control' '/relay-node Prefix relay-control' '/ Prefix relay-webapp')" \ +test "$root_paths" = "$(printf '%s\n' '/cloud/api Prefix relay-control' '/login Prefix relay-control' '/relay-node Prefix relay-control' '/mcp Prefix relay-control' '/cloud/mcp Prefix relay-control' '/.well-known/oauth-protected-resource Prefix relay-control' '/.well-known/oauth-authorization-server Prefix relay-control' '/.well-known/openid-configuration Prefix relay-control' '/cloud/.well-known Prefix relay-control' '/cloud/oauth Prefix relay-control' '/ Prefix relay-webapp')" \ || { echo "unexpected routes on the root host: $root_paths" >&2; exit 1; } test "$(yq 'select(.kind == "BackendConfig" and .metadata.name == "agent-relay-gcp-proof-api") | .spec.timeoutSec' <<<"$out")" = 3600 \ || { echo "api BackendConfig must keep the relay-node WebSocket open (timeoutSec 3600)" >&2; exit 1; } @@ -831,7 +832,7 @@ sh_args=(-f charts/agent-relay/values-gcp-proof.yaml -f charts/agent-relay/ci/si sh_host=relay.gcp-proof.agentrelay.com sh_out=$(helm template proof charts/agent-relay -n agent-relay --no-hooks "${sh_args[@]}") sh_paths() { yq "select(.kind == \"Ingress\") | .spec.rules[] | select(.host == \"$1\") | .http.paths[] | .path + \" \" + .backend.service.name" <<<"$sh_out"; } -test "$(sh_paths "$sh_host")" = "$(printf '%s\n' '/cloud/api relay-control' '/login relay-control' '/relay-node relay-control' '/api relay-control' '/ relay-webapp')" \ +test "$(sh_paths "$sh_host")" = "$(printf '%s\n' '/cloud/api relay-control' '/login relay-control' '/relay-node relay-control' '/mcp relay-control' '/cloud/mcp relay-control' '/.well-known/oauth-protected-resource relay-control' '/.well-known/oauth-authorization-server relay-control' '/.well-known/openid-configuration relay-control' '/cloud/.well-known relay-control' '/cloud/oauth relay-control' '/api relay-control' '/ relay-webapp')" \ || sh_fail "unexpected routes on $sh_host: $(sh_paths "$sh_host")" test "$(yq 'select(.kind == "Ingress") | .spec.rules[].host' <<<"$sh_out" | sort | tr '\n' ' ')" = \ "cast.gcp-proof.agentrelay.com history.gcp-proof.agentrelay.com $sh_host " || sh_fail "unexpected Ingress hosts (an api host must not render)" @@ -876,7 +877,7 @@ expect_sh_failure "publicUrl is derived from global.singleHost.host" --set relay expect_sh_failure "runtime.publicUrl is derived from global.singleHost.host" --set relay-webapp.runtime.publicUrl=https://gcp-proof.agentrelay.com # Leaf charts on their own (non-GKE edge): the dashboard Ingress carries /api. leaf_sh=$(helm template ci charts/relay-webapp -n ci --no-hooks -f charts/relay-webapp/ci/single-host-values.yaml) -test "$(yq 'select(.kind == "Ingress") | .spec.rules[] | .host + " " + ([.http.paths[].path] | join(","))' <<<"$leaf_sh")" = "$sh_host /cloud/api,/login,/relay-node,/api,/" \ +test "$(yq 'select(.kind == "Ingress") | .spec.rules[] | .host + " " + ([.http.paths[].path] | join(","))' <<<"$leaf_sh")" = "$sh_host /cloud/api,/login,/relay-node,/mcp,/cloud/mcp,/.well-known/oauth-protected-resource,/.well-known/oauth-authorization-server,/.well-known/openid-configuration,/cloud/.well-known,/cloud/oauth,/api,/" \ || sh_fail "relay-webapp leaf Ingress in single-host mode" # The leaf Ingress outside single-host mode still sends /relay-node to Control. leaf_mh=$(helm template ci charts/relay-webapp -n ci --no-hooks -f charts/relay-webapp/ci/default-values.yaml) diff --git a/ci/agent-relay/subdomain-golden.sha256 b/ci/agent-relay/subdomain-golden.sha256 index 5c6c9c82..c1406b73 100644 --- a/ci/agent-relay/subdomain-golden.sha256 +++ b/ci/agent-relay/subdomain-golden.sha256 @@ -1,11 +1,11 @@ # helm v4.3.1 c71a7948f27bd5a9df7dd91ec77bd0e4bb6da2144672f3d63af49e35138f2e93 eks-rds-native.yaml -d7634c03f7104f7c601ec8778cd34e9e67db7e3a8804e52a1d126bcb373a9e00 gcp-durable-actors.yaml -d9c77f7ab7d0b596305adb7a0b78607d2f5c7e152c99c91cad766b6f25cd464a gcp-proof-flows.yaml -8cfbc78501640e685465e2991d0592c08aa235aeab0d4e6871a64a36fca6618c gcp-proof-live.yaml -0695c2b8b2f804cb0a817bd9dcba04538808283c996d9695235b006d3bc3deec gcp-proof.yaml -afae896b7542fae37150ee8b9fccb6a487b5e3f66cc904b509fd307024fd8996 gcp-supported-100.yaml -82877cbcd88840ce8c93805b1d93a88e9cdd383027791e358301541a6cc03fef gcp.yaml +144ca65adee66eade341241629904deb2333d07d6e6a73020229fb3ee29ef600 gcp-durable-actors.yaml +0fafdd5840024ad47d585d159cc9d691f257bccbafa465aec99cbb6e2f598a3e gcp-proof-flows.yaml +6f23e1d3e9eae71754aa5c8ed0a9f67372a5ce1819a969e163684baaa6c43b32 gcp-proof-live.yaml +66912be89079b82f54baf9252f143e82fab8cc38062c12052985f70471d120f6 gcp-proof.yaml +27d9fdb88972af2ea6a12e5fcc4350a0ab05bdaa786e608af835202b79a05663 gcp-supported-100.yaml +746894290d46885f64616f7c6e7e22e9a50386f7e6776f62828103e5075e9eae gcp.yaml 3e3f87fde30fafb454dad5c0d4d935cde221ef8e2d3210ed242e77f04da94f56 kind-durable-actors.yaml fdc618e39628ef38a9cdb1f323a7e92d167573b84872079f986c01a7dc4fc963 relay-control.yaml -18606a2d87c10f97b7e33c323283c6221daf97543e3d0d9e388db5cd913e74a4 relay-webapp.yaml +dfb644a6f10249294131293d9764e2384dd9a1f366425ee5d25d970feb111d32 relay-webapp.yaml diff --git a/ci/agent-relay/test_eks_alb_ingress.py b/ci/agent-relay/test_eks_alb_ingress.py index e959b90f..0e167736 100644 --- a/ci/agent-relay/test_eks_alb_ingress.py +++ b/ci/agent-relay/test_eks_alb_ingress.py @@ -21,6 +21,19 @@ BASE_ENV = {'EKS_ALB_DOMAIN': 'relay.example.com', 'EKS_ALB_CERT_ARN': 'arn:aws:acm:us-east-1:111111111111:certificate/00000000-0000-0000-0000-000000000000'} +DEFAULT_CONTROL_PATHS = [ + '/cloud/api', + '/login', + '/relay-node', + '/mcp', + '/cloud/mcp', + '/.well-known/oauth-protected-resource', + '/.well-known/oauth-authorization-server', + '/.well-known/openid-configuration', + '/cloud/.well-known', + '/cloud/oauth', +] + # Script variable -> eksIngress option path. OPTIONS = { 'EKS_ALB_INGRESS_NAME': 'name', @@ -195,13 +208,36 @@ def test_backends_need_no_component_of_this_release(self): def test_control_paths_default_is_the_script_list(self): for env in ({}, {'EKS_ALB_CHIEF_SERVICE': 'relaychief-control'}): with self.subTest(env=env): - self.assert_same(env, {'controlPaths': ['/cloud/api', '/login', '/relay-node']}) + self.assert_same(env, {'controlPaths': DEFAULT_CONTROL_PATHS}) + + def test_control_paths_missing_or_null_use_defaults(self): + for env in ({}, {'EKS_ALB_CHIEF_SERVICE': 'relaychief-control'}): + with self.subTest(env=env): + self.assert_same(env) + # Helm removes the null key during coalescing, just as older + # saved defaults lack it when upgrading with --reuse-values. + self.assert_same(env, {'controlPaths': None}) + result = helm(chart_values(env), extra=['--set', 'eksIngress.controlPaths=null']) + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual(comparable(ingress(result.stdout)), comparable(ingress(script(env).stdout))) + + def test_control_paths_can_be_empty(self): + for env in ({}, {'EKS_ALB_CHIEF_SERVICE': 'relaychief-control'}): + with self.subTest(env=env): + want = ingress(script(env).stdout) + result = helm({**chart_values(env), 'controlPaths': []}) + self.assertEqual(result.returncode, 0, result.stderr) + removed = {path for p in DEFAULT_CONTROL_PATHS for path in (p, p + '/*')} + for rule in want['spec']['rules']: + if rule['host'] == 'relay.example.com': + rule['http']['paths'] = [p for p in rule['http']['paths'] if p['path'] not in removed] + self.assertEqual(comparable(ingress(result.stdout)), comparable(want)) def test_control_paths_drop_only_the_relay_node_rules(self): for env in ({}, {'EKS_ALB_CHIEF_SERVICE': 'relaychief-control'}, {'EKS_ALB_RELAYFILE_CONTROL': 'true'}): with self.subTest(env=env): want = ingress(script(env).stdout) - result = helm({**chart_values(env), 'controlPaths': ['/cloud/api', '/login']}) + result = helm({**chart_values(env), 'controlPaths': [p for p in DEFAULT_CONTROL_PATHS if p != '/relay-node']}) self.assertEqual(result.returncode, 0, result.stderr) got = ingress(result.stdout) for rule in want['spec']['rules']: @@ -211,6 +247,19 @@ def test_control_paths_drop_only_the_relay_node_rules(self): self.assertEqual(comparable(got), comparable(want)) self.assertFalse([p for p in paths(got, 'relay.example.com') if 'relay-node' in p[0]]) + def test_control_paths_can_pin_legacy_lists(self): + for pinned in (DEFAULT_CONTROL_PATHS[:3], DEFAULT_CONTROL_PATHS[:2]): + for env in ({}, {'EKS_ALB_CHIEF_SERVICE': 'relaychief-control'}, {'EKS_ALB_RELAYFILE_CONTROL': 'true'}): + with self.subTest(pinned=pinned, env=env): + want = ingress(script(env).stdout) + result = helm({**chart_values(env), 'controlPaths': pinned}) + self.assertEqual(result.returncode, 0, result.stderr) + removed = {path for p in DEFAULT_CONTROL_PATHS if p not in pinned for path in (p, p + '/*')} + for rule in want['spec']['rules']: + if rule['host'] == 'relay.example.com': + rule['http']['paths'] = [p for p in rule['http']['paths'] if p['path'] not in removed] + self.assertEqual(comparable(ingress(result.stdout)), comparable(want)) + def test_control_paths_extend_in_order(self): result = helm({**chart_values({}), 'controlPaths': ['/cloud/api', '/login', '/relay-node', '/mcp', '/.well-known/openid-configuration']}) self.assertEqual(result.returncode, 0, result.stderr) diff --git a/ci/agent-relay/test_ingress_routes.py b/ci/agent-relay/test_ingress_routes.py new file mode 100644 index 00000000..3e466476 --- /dev/null +++ b/ci/agent-relay/test_ingress_routes.py @@ -0,0 +1,113 @@ +#!/usr/bin/env python3 +"""Offline drift contract for dashboard-origin Control routing on every edge.""" +import json +import os +from pathlib import Path +import subprocess +import unittest + +ROOT = Path(__file__).resolve().parents[2] +# Control 0.5.24, edad6432: src/mcp/{routes,oauth/routes,oauth/protocol}.ts. +MCP_PATHS = ( + "/mcp", "/cloud/mcp", "/.well-known/oauth-protected-resource", + "/.well-known/oauth-authorization-server", "/.well-known/openid-configuration", + "/cloud/.well-known", "/cloud/oauth", +) +CONTROL_PATHS = ("/cloud/api", "/login", "/relay-node", *MCP_PATHS) + + +def run(*args, env=None): + return subprocess.check_output(args, cwd=ROOT, env=env, text=True) + + +def documents(raw): + # yq is already required by both chart render suites; no Python YAML dependency. + result = subprocess.run(["yq", "-o=json", "-I=0", "."], input=raw, + text=True, capture_output=True, check=True) + return [json.loads(line) for line in result.stdout.splitlines() if line != "null"] + + +def dashboard(docs, host=None): + return next(rule["http"]["paths"] for doc in docs if doc["kind"] == "Ingress" + for rule in doc["spec"]["rules"] + if (host is None or rule["host"] == host) + and any(p["backend"]["service"]["name"].endswith("relay-webapp") + for p in rule["http"]["paths"])) + + +class Routes(unittest.TestCase): + def assert_routes(self, paths, expected=CONTROL_PATHS, chief=False): + target = lambda p: p["backend"]["service"] + control = [p for p in paths if target(p)["name"].endswith("relay-control")] + want = [(p, "Exact" if chief else "Prefix") for p in expected] + if chief: + want += [(p + "/*", "ImplementationSpecific") for p in expected] + self.assertEqual([(p["path"], p["pathType"]) for p in control], want) + self.assertTrue(all(target(p)["port"] == {"number": 80} for p in control)) + self.assertEqual(paths[-1]["path"], "/*" if chief else "/") + self.assertTrue(target(paths[-1])["name"].endswith("relay-webapp")) + self.assertFalse(any(p["path"] in ("/.well-known", "/.well-known/*") for p in paths)) + + def test_leaf_split_single_and_custom_base(self): + for fixture, extra, expected in ( + ("default", (), CONTROL_PATHS), + ("single-host", (), (*CONTROL_PATHS, "/api")), + ("default", ("--set", "runtime.apiBasePath=/custom/api"), + tuple(p.replace("/cloud", "/custom") for p in CONTROL_PATHS)), + ("default", ("--set", "runtime.apiBasePath=/api"), + tuple(dict.fromkeys(p.replace("/cloud", "") for p in CONTROL_PATHS + if p != "/cloud/.well-known"))), + ): + with self.subTest(fixture=fixture, extra=extra): + docs = documents(run("helm", "template", "ci", "charts/relay-webapp", "-f", + f"charts/relay-webapp/ci/{fixture}-values.yaml", *extra)) + self.assert_routes(dashboard(docs), expected) + + def test_gke_split_and_single(self): + for single in (False, True): + with self.subTest(single=single): + extra = ("-f", "charts/agent-relay/values-single-host-example.yaml") if single else () + docs = documents(run("helm", "template", "ci", "charts/agent-relay", "-n", "agent-relay", + "-f", "charts/agent-relay/values-gcp-proof.yaml", + "-f", "charts/agent-relay/ci/gcp-proof-values.yaml", *extra)) + paths = dashboard(docs) + self.assert_routes(paths, (*CONTROL_PATHS, "/api") if single else CONTROL_PATHS) + self.assertEqual(len(paths), 12 if single else 11) + service = next(d for d in docs if d["kind"] == "Service" and d["metadata"]["name"] == "relay-control") + config = json.loads(service["metadata"]["annotations"]["cloud.google.com/backend-config"])["default"] + self.assertEqual(next(d for d in docs if d["kind"] == "BackendConfig" and d["metadata"]["name"] == config)["spec"]["timeoutSec"], 3600) + + def test_eks_with_chief_and_flows(self): + for chief in (False, True): + for flows in (False, True): + with self.subTest(chief=chief, flows=flows): + # Fixtures must not inherit an operator's install settings. + clean_env = {k: v for k, v in os.environ.items() + if not k.startswith("EKS_ALB_") and k != "EKS_INGRESS_CLASS"} + env = {**clean_env, "EKS_ALB_DOMAIN": "relay.example.com", "EKS_ALB_CERT_ARN": "render-only", + "EKS_ALB_CHIEF_SERVICE": "relaychief-control" if chief else "", + "EKS_ALB_RELAYFILE_CONTROL": str(flows).lower()} + self.assert_routes(dashboard(documents(run("bash", "scripts/selfhost/eks-alb-ingress.sh", env=env))), chief=chief) + + def test_eks_chart_with_chief_and_flows(self): + for chief in (False, True): + for flows in (False, True): + with self.subTest(chief=chief, flows=flows): + docs = documents(run( + "helm", "template", "ci", "charts/agent-relay", "-n", "agent-relay", + "-f", "charts/agent-relay/values-eks.yaml", + "-f", "charts/agent-relay/values-eks-rds-native.yaml", + "--set", "eksIngress.enabled=true", + "--set", "eksIngress.domain=relay.example.com", + "--set", "eksIngress.certificateArn=arn:render-only", + "--set", "eksIngress.chief.serviceName=" + ("relaychief-control" if chief else ""), + "--set", "eksIngress.flows.enabled=" + str(flows).lower(), + "--show-only", "templates/eks-alb-ingress.yaml")) + self.assert_routes(dashboard(docs), chief=chief) + + def test_azure(self): + self.assert_routes(dashboard(documents((ROOT / "docs/azure-install/ingress.yaml").read_text()), "__HOST_ROOT__")) + + +if __name__ == "__main__": + unittest.main() diff --git a/docs/azure-install/ingress.yaml b/docs/azure-install/ingress.yaml index a6bd9af2..b35f9a64 100644 --- a/docs/azure-install/ingress.yaml +++ b/docs/azure-install/ingress.yaml @@ -3,8 +3,10 @@ # with EKS_ALB_INGEST=true) and GKE Ingress. # # __HOST_ROOT__ dashboard, with /cloud/api, /login and /relay-node routed to -# the control API (/relay-node/v1/* carries Desktop node -# enrolment and the node WebSocket; it has no /cloud alias) +# the control API, plus MCP and OAuth discovery/consent +# prefixes (keep in step with relay-webapp.controlPaths). +# /relay-node/v1/* carries Desktop node +# enrolment and the node WebSocket; it has no /cloud alias # __HOST_API__ control API # __HOST_CAST__ Relaycast # __HOST_HISTORY__ native History: ingest edge for uploads, read API for reads @@ -48,6 +50,13 @@ spec: - { path: /cloud/api, pathType: Prefix, backend: { service: { name: relay-control, port: { number: 80 } } } } - { path: /login, pathType: Prefix, backend: { service: { name: relay-control, port: { number: 80 } } } } - { path: /relay-node, pathType: Prefix, backend: { service: { name: relay-control, port: { number: 80 } } } } + - { path: /mcp, pathType: Prefix, backend: { service: { name: relay-control, port: { number: 80 } } } } + - { path: /cloud/mcp, pathType: Prefix, backend: { service: { name: relay-control, port: { number: 80 } } } } + - { path: /.well-known/oauth-protected-resource, pathType: Prefix, backend: { service: { name: relay-control, port: { number: 80 } } } } + - { path: /.well-known/oauth-authorization-server, pathType: Prefix, backend: { service: { name: relay-control, port: { number: 80 } } } } + - { path: /.well-known/openid-configuration, pathType: Prefix, backend: { service: { name: relay-control, port: { number: 80 } } } } + - { path: /cloud/.well-known, pathType: Prefix, backend: { service: { name: relay-control, port: { number: 80 } } } } + - { path: /cloud/oauth, pathType: Prefix, backend: { service: { name: relay-control, port: { number: 80 } } } } - { path: /, pathType: Prefix, backend: { service: { name: relay-webapp, port: { number: 8080 } } } } - host: __HOST_API__ http: diff --git a/docs/self-hosted-requirements.md b/docs/self-hosted-requirements.md index b02006de..0a55261d 100644 --- a/docs/self-hosted-requirements.md +++ b/docs/self-hosted-requirements.md @@ -170,7 +170,8 @@ Services image (sessions-pipeline-worker, alleyoop and the privileged SQL Jobs): | relayauth-0.1.2 | shipped | relayauth 0.1.2 | relayauth: `ghcr.io/agentworkforce/relayauth@sha256:c23c92d25fdf…` | | | License-annotation patch bump of 0.1.1. Superseded by 0.1.3. | | relayauth-0.1.1 | shipped | relayauth 0.1.1 | relayauth: `ghcr.io/agentworkforce/relayauth@sha256:c23c92d25fdf…` | | | relayauth 784582ef (machine-bound History assertion contract, relayauth #113). Superseded by 0.1.2. | | relayauth-0.1.0 | shipped | relayauth 0.1.0 | relayauth: `ghcr.io/agentworkforce/relayauth@sha256:eb71daa28e30…` | | | superseded by 0.1.1. | -| agent-relay-0.7.66 | unreleased | agent-relay 0.7.66
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.52, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.11, relaygate 0.1.10) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:e51749eb2b7c…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.63. Opt-in EKS ALB edge: eksIngress.enabled (default false) renders the internet-facing ALB Ingress that scripts/selfhost/eks-alb-ingress.sh prints, option for option, plus eksIngress.controlPaths (default /cloud/api, /login, /relay-node). Refuses eksIngress with gkeIngress. ci/agent-relay/test_eks_alb_ingress.py proves deep equality with the script over the option matrix. Default renders differ only in chart labels; images unchanged. Not applied to any cluster. | +| agent-relay-0.7.67 | unreleased | agent-relay 0.7.67
relay-control 0.4.22
relay-webapp 0.2.8
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.52, relay-control 0.4.22, relay-webapp 0.2.8, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.11, relaygate 0.1.10) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:e51749eb2b7c…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.66 and sessions-pipeline 0.8.52. relay-webapp 0.2.8 adds dashboard-origin MCP and OAuth discovery/consent prefixes to the leaf and shared GKE routes, EKS script, chart-rendered EKS controlPaths default and Azure example. Confirmed against Control 0.5.24 source edad6432; images unchanged. GKE reuses the api BackendConfig with 11 dashboard paths, or 12 in single-host mode. EKS equivalence tests cover the expanded default and explicitly pinned legacy lists. No live install or client sign-in proof. | +| agent-relay-0.7.66 | **planned** | agent-relay 0.7.66
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.52, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.11, relaygate 0.1.10) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:e51749eb2b7c…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.63. Opt-in EKS ALB edge: eksIngress.enabled (default false) renders the internet-facing ALB Ingress that scripts/selfhost/eks-alb-ingress.sh prints, option for option, plus eksIngress.controlPaths (default /cloud/api, /login, /relay-node). Refuses eksIngress with gkeIngress. ci/agent-relay/test_eks_alb_ingress.py proves deep equality with the script over the option matrix. Default renders differ only in chart labels; images unchanged. Not applied to any cluster. | | agent-relay-0.7.63 | **planned** | agent-relay 0.7.63
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.52, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.11, relaygate 0.1.10) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:e51749eb2b7c…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.62 and sessions-pipeline 0.8.52. The GCP, EKS and EKS RDS-native profiles move the services image to relayhistory-pipeline efdd4bb2 (ghcr.io/agentworkforce/sessions-pipeline@sha256:e51749eb, publish run 44489159041; issue 610 Phase 3, staged reconcile and streaming on by default; with streaming.enabled=false and stagedReconcile unset the staged path resolves off). It vendors relayscrubber 0.5.0-alpha.9 under Khaliqs recorded OVERRIDE of the relayscrubber-lead security block (customer-images.yaml); alpha.10 replaces it when it passes. Upgrade pre-steps for an existing database: the bulls96_legacy_export_privacy role (re-run the modes migration-roles bootstrap from the image) and the 058000 index prebuild or one allowBlockingIndexBuild. 28 migrations plus HoopDb 0005/0006 run in the migrate Job; the indexer restarts until 062110 (and 062140 with output facts) are applied. License FSL-1.1-ALv2. No upgrade rehearsal from a 7e9b2f0f database yet. | | agent-relay-0.7.62 | **planned** | agent-relay 0.7.62
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.51, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.11, relaygate 0.1.10) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:77022c5b6a1d…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.61 and sessions-pipeline 0.8.51. RDS migrate Jobs can select the name-agnostic separate-database preflight; fresh managed-database installs use the dedicated hoopdb_owner login and legacy upgrades can point migration/bootstrap Jobs at one short-lived Secret. | | agent-relay-0.7.61 | **planned** | agent-relay 0.7.61
relay-control 0.4.22
relay-webapp 0.2.7
(deps: relaycast 0.3.16, relayauth 0.1.5, sessions-pipeline 0.8.50, relay-control 0.4.22, relay-webapp 0.2.7, relayflows 0.2.5, durable-actors 0.14.6-awf.4, relayfile 0.2.2, telemetry-collector 0.1.7, relay-chief 0.1.0, slack-relay 0.3.11, relaygate 0.1.10) | relaycast: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
relaycast-postgres: `ghcr.io/agentworkforce/relaycast-self-host@sha256:ec062ef901af…`
sessions-pipeline-worker: `ghcr.io/agentworkforce/sessions-pipeline@sha256:77022c5b6a1d…`
relay-control: `ghcr.io/agentworkforce/relay-control@sha256:d1b6ca95fab2…`
relay-webapp: `ghcr.io/agentworkforce/relay-webapp@sha256:bd295ccb7d13…` | | | Carries 0.7.60 and sessions-pipeline 0.8.50 (searchIndexer.stagedReconcile.enabled, issue 610 Phase 3; no image pin changes). | @@ -3423,7 +3424,8 @@ allowAllEgress=false, the level is not off and the transport is https. global.singleHost.host (off when empty) puts the dashboard and the self-host control API on one host: / to the dashboard and /cloud/api, -/login and /api to relay-control (flows workers and the integrations +/login, /relay-node, MCP/OAuth discovery/consent and /api to relay-control +(flows workers and the integrations OAuth callback use /api/v1/...). relay-control.publicUrl and relay-webapp.runtime.publicUrl are derived as https://, and relay-webapp.ingress.host as the bare ; each must be left empty @@ -3451,9 +3453,12 @@ rather than Gateway API. **Dashboard ingress and same-origin API proxy** · shipped · chart `relay-webapp` · profiles relay-webapp -The dashboard ingress routes /cloud/api to relay-control and / to the -dashboard. The GKE proof disables this leaf ingress and supplies the same -routes through its single umbrella Ingress. +The dashboard ingress routes /cloud/api, /login, /relay-node, /mcp, +/cloud/mcp, /.well-known/oauth-protected-resource, +/.well-known/oauth-authorization-server, /.well-known/openid-configuration, +/cloud/.well-known and /cloud/oauth to relay-control and / to the dashboard. +Only the named root discovery prefixes are claimed, leaving ACME paths +available. GKE shares the leaf chart helper through its umbrella Ingress. - Default: `enabled` - Choices: `enabled`; `disabled` @@ -3462,7 +3467,7 @@ routes through its single umbrella Ingress. - Env: `DASHBOARD_PUBLIC_URL`, `DASHBOARD_APP_PATH`, `DASHBOARD_API_BASE_PATH`, `DASHBOARD_LOGIN_PATH`, `DASHBOARD_SESSION_READ_API_ENABLED` - Secret: ``. kubernetes.io/tls - Secret: ``. optional registry pull Secret -- Verify: render contains the configured dashboard runtime environment and routes /cloud/api to relay-control +- Verify: ci/agent-relay/test_ingress_routes.py checks every Control prefix, dashboard catch-all, GKE BackendConfig, EKS script/chart Chief variants and Azure parity - Sources: [`charts/relay-webapp/templates/ingress.yaml`](../charts/relay-webapp/templates/ingress.yaml), [`ci/agent-relay/render.sh`](../ci/agent-relay/render.sh) #### opt.relay-webapp.customer-profile diff --git a/scripts/ci/charts.sh b/scripts/ci/charts.sh index 9e8c8428..50dd1a5b 100755 --- a/scripts/ci/charts.sh +++ b/scripts/ci/charts.sh @@ -108,6 +108,9 @@ for chart in "${charts[@]}"; do fi add_repos "charts/$chart/Chart.yaml" helm dependency build "charts/$chart" >/dev/null || { err "$chart: helm dependency build failed"; continue; } + if [ "$mode" = static ] && [ "$chart" = agent-relay ]; then + python3 ci/agent-relay/test_ingress_routes.py || err "$chart: dashboard ingress route contract failed" + fi fi values=(charts/"$chart"/ci/*-values.yaml) [ -e "${values[0]}" ] || values=("") @@ -1175,7 +1178,7 @@ for chart in "${charts[@]}"; do # and opens GET /relay-node/v1/ws there; relay-control serves the # relay-node routes only at the root path, so the root host must send # /relay-node to relay-control, not the dashboard. - [ "$(routes gcp-proof.agentrelay.com)" = "/cloud/api Prefix relay-control;/login Prefix relay-control;/relay-node Prefix relay-control;/ Prefix relay-webapp;" ] \ + [ "$(routes gcp-proof.agentrelay.com)" = "/cloud/api Prefix relay-control;/login Prefix relay-control;/relay-node Prefix relay-control;/mcp Prefix relay-control;/cloud/mcp Prefix relay-control;/.well-known/oauth-protected-resource Prefix relay-control;/.well-known/oauth-authorization-server Prefix relay-control;/.well-known/openid-configuration Prefix relay-control;/cloud/.well-known Prefix relay-control;/cloud/oauth Prefix relay-control;/ Prefix relay-webapp;" ] \ || err "$chart: gate-only root routes must send /relay-node to relay-control: $(routes gcp-proof.agentrelay.com)" [ "$(yq "select(.kind == \"Service\" and .metadata.name == \"$gate\") | .spec.selector[\"app.kubernetes.io/name\"] + \" \" + .metadata.annotations[\"cloud.google.com/backend-config\"]" <<<"$out" | sed '/^---$/d;/^$/d')" = "relaygate {\"default\": \"$gate\"}" ] || err "$chart: gate edge Service must select relaygate with its BackendConfig" [ "$(yq "select(.kind == \"BackendConfig\" and .metadata.name == \"$gate\") | .spec.healthCheck.requestPath + \" \" + (.spec.timeoutSec | tostring)" <<<"$out" | sed '/^---$/d;/^$/d')" = "/healthz 3600" ] || err "$chart: gate edge BackendConfig must check /healthz with the cast timeout" diff --git a/scripts/selfhost/eks-alb-ingress.sh b/scripts/selfhost/eks-alb-ingress.sh index 63c46720..ff51a2ed 100755 --- a/scripts/selfhost/eks-alb-ingress.sh +++ b/scripts/selfhost/eks-alb-ingress.sh @@ -191,22 +191,29 @@ EOF host "$DOMAIN" flows_routes /cloud/api/v1 +# Keep in step with relay-webapp.controlPaths and the Azure dashboard rule. +control_paths=(/cloud/api /login /relay-node + /mcp /cloud/mcp + /.well-known/oauth-protected-resource + /.well-known/oauth-authorization-server + /.well-known/openid-configuration + /cloud/.well-known /cloud/oauth) if [[ -n "$CHIEF_SVC" ]]; then - route /cloud/api "$CONTROL_SVC" 80 Exact - route /login "$CONTROL_SVC" 80 Exact - route /relay-node "$CONTROL_SVC" 80 Exact + for path in "${control_paths[@]}"; do + route "$path" "$CONTROL_SVC" 80 Exact + done for prefix in /cloud/api/v1 /api/v1; do route "\"$prefix/workspaces/*/chiefs\"" "$CHIEF_SVC" "$CHIEF_PORT" ImplementationSpecific route "\"$prefix/workspaces/*/chiefs/*\"" "$CHIEF_SVC" "$CHIEF_PORT" ImplementationSpecific done - route '"/cloud/api/*"' "$CONTROL_SVC" 80 ImplementationSpecific - route '"/login/*"' "$CONTROL_SVC" 80 ImplementationSpecific - route '"/relay-node/*"' "$CONTROL_SVC" 80 ImplementationSpecific + for path in "${control_paths[@]}"; do + route "\"$path/*\"" "$CONTROL_SVC" 80 ImplementationSpecific + done route '"/*"' "$WEBAPP_SVC" 8080 ImplementationSpecific else - route /cloud/api "$CONTROL_SVC" 80 - route /login "$CONTROL_SVC" 80 - route /relay-node "$CONTROL_SVC" 80 + for path in "${control_paths[@]}"; do + route "$path" "$CONTROL_SVC" 80 + done route / "$WEBAPP_SVC" 8080 fi diff --git a/scripts/selfhost/tests/eks-alb-ingress-test.sh b/scripts/selfhost/tests/eks-alb-ingress-test.sh new file mode 100644 index 00000000..6c4eb258 --- /dev/null +++ b/scripts/selfhost/tests/eks-alb-ingress-test.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +# Render only: checks every MCP/OAuth route, Chief ordering and Azure parity. +set -euo pipefail +cd "$(dirname "$0")/../../.." +python3 ci/agent-relay/test_ingress_routes.py Routes.test_eks_with_chief_and_flows Routes.test_azure diff --git a/scripts/selfhost/tests/run-tests.sh b/scripts/selfhost/tests/run-tests.sh index dee07966..ac10ff25 100755 --- a/scripts/selfhost/tests/run-tests.sh +++ b/scripts/selfhost/tests/run-tests.sh @@ -13,6 +13,7 @@ TEST_BASH="${TEST_BASH:-bash}" python3 -m unittest discover -s "${TEST_DIR}" -p 'test_prepare_gcp_edge.py' -v # The Node helper uses injected API responses; it never contacts a cluster. node --test "${TEST_DIR}/operator-device-login.test.mjs" +bash "${TEST_DIR}/eks-alb-ingress-test.sh" tmp_root="$(mktemp -d)" trap 'rm -rf "${tmp_root}"' EXIT diff --git a/self-hosted/requirements.yaml b/self-hosted/requirements.yaml index 115fb8e9..f47ca328 100644 --- a/self-hosted/requirements.yaml +++ b/self-hosted/requirements.yaml @@ -2042,9 +2042,22 @@ compatibility: images: relayauth: { repository: ghcr.io/agentworkforce/relayauth, digest: sha256:eb71daa28e30eb7305f666d0bccc5a4002e53e8a574e3c4c32163d907a1b71df } notes: superseded by 0.1.1. - - id: agent-relay-0.7.66 + - id: agent-relay-0.7.67 status: unreleased current: true + charts: { agent-relay: 0.7.67, relay-control: 0.4.22, relay-webapp: 0.2.8 } + app_versions: { agent-relay: 0.1.0, relay-control: 0.1.0, relay-webapp: 0.1.0 } + depends: + agent-relay: { relaycast: 0.3.16, relayauth: 0.1.5, sessions-pipeline: 0.8.52, relay-control: 0.4.22, relay-webapp: 0.2.8, relayflows: 0.2.5, durable-actors: 0.14.6-awf.4, relayfile: 0.2.2, telemetry-collector: 0.1.7, relay-chief: 0.1.0, slack-relay: 0.3.11, relaygate: 0.1.10 } + images: + relaycast: { repository: ghcr.io/agentworkforce/relaycast-self-host, digest: sha256:ec062ef901af15cf575b53a71d7eb09f2e6ab6e7c0d5be2da35339a275a5c6cc } + relaycast-postgres: { repository: ghcr.io/agentworkforce/relaycast-self-host, digest: sha256:ec062ef901af15cf575b53a71d7eb09f2e6ab6e7c0d5be2da35339a275a5c6cc } + sessions-pipeline-worker: { repository: ghcr.io/agentworkforce/sessions-pipeline, digest: sha256:e51749eb2b7c91b790a1e05c126cc4a7b47243ab5d8d116c62732746e223c4a5 } + relay-control: { repository: ghcr.io/agentworkforce/relay-control, digest: sha256:d1b6ca95fab240a9d41208d83de3b1f4245408b0765038762f1c419ee60f43bc } + relay-webapp: { repository: ghcr.io/agentworkforce/relay-webapp, digest: sha256:bd295ccb7d1323965dce890f19d0b7f857d706c00d7756f719c713763fdb49f3 } + notes: 'Carries 0.7.66 and sessions-pipeline 0.8.52. relay-webapp 0.2.8 adds dashboard-origin MCP and OAuth discovery/consent prefixes to the leaf and shared GKE routes, EKS script, chart-rendered EKS controlPaths default and Azure example. Confirmed against Control 0.5.24 source edad6432; images unchanged. GKE reuses the api BackendConfig with 11 dashboard paths, or 12 in single-host mode. EKS equivalence tests cover the expanded default and explicitly pinned legacy lists. No live install or client sign-in proof.' + - id: agent-relay-0.7.66 + status: planned charts: { agent-relay: 0.7.66, relay-control: 0.4.22, relay-webapp: 0.2.7 } app_versions: { agent-relay: 0.1.0, relay-control: 0.1.0, relay-webapp: 0.1.0 } depends: @@ -5815,7 +5828,8 @@ entries: description: | global.singleHost.host (off when empty) puts the dashboard and the self-host control API on one host: / to the dashboard and /cloud/api, - /login and /api to relay-control (flows workers and the integrations + /login, /relay-node, MCP/OAuth discovery/consent and /api to relay-control + (flows workers and the integrations OAuth callback use /api/v1/...). relay-control.publicUrl and relay-webapp.runtime.publicUrl are derived as https://, and relay-webapp.ingress.host as the bare ; each must be left empty @@ -5857,9 +5871,12 @@ entries: kind: option title: Dashboard ingress and same-origin API proxy description: | - The dashboard ingress routes /cloud/api to relay-control and / to the - dashboard. The GKE proof disables this leaf ingress and supplies the same - routes through its single umbrella Ingress. + The dashboard ingress routes /cloud/api, /login, /relay-node, /mcp, + /cloud/mcp, /.well-known/oauth-protected-resource, + /.well-known/oauth-authorization-server, /.well-known/openid-configuration, + /cloud/.well-known and /cloud/oauth to relay-control and / to the dashboard. + Only the named root discovery prefixes are claimed, leaving ACME paths + available. GKE shares the leaf chart helper through its umbrella Ingress. chart: relay-webapp values: [runtime.publicUrl, runtime.appPath, runtime.apiBasePath, runtime.loginPath, ingress.tls, imagePullSecrets] env: [DASHBOARD_PUBLIC_URL, DASHBOARD_APP_PATH, DASHBOARD_API_BASE_PATH, DASHBOARD_LOGIN_PATH, DASHBOARD_SESSION_READ_API_ENABLED] @@ -5875,7 +5892,7 @@ entries: note: kubernetes.io/tls - name: "" note: optional registry pull Secret - verify: render contains the configured dashboard runtime environment and routes /cloud/api to relay-control + verify: ci/agent-relay/test_ingress_routes.py checks every Control prefix, dashboard catch-all, GKE BackendConfig, EKS script/chart Chief variants and Azure parity sources: - "charts/relay-webapp/templates/ingress.yaml" - "ci/agent-relay/render.sh"