Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions charts/agent-relay/Chart.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
4 changes: 2 additions & 2 deletions charts/agent-relay/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
29 changes: 25 additions & 4 deletions charts/agent-relay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -441,7 +459,9 @@ name, a certificate that is not an ARN, and malformed `controlPaths`.
`controlPaths` is the list of dashboard-host (`<domain>`) paths sent to the
control API ahead of the dashboard catch-all, in order (Prefix paths; with Chief
on, each becomes Exact plus `<path>/*` 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.

Expand Down Expand Up @@ -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
`<publicUrl>/api/v1/...`; it is not routed in the default mode, where the
api host serves them.
Expand Down
11 changes: 11 additions & 0 deletions charts/agent-relay/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
6 changes: 5 additions & 1 deletion charts/agent-relay/templates/eks-alb-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<path>/*" 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 -}}
Expand Down
32 changes: 4 additions & 28 deletions charts/agent-relay/templates/gke-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <publicUrl>/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:
Expand Down
3 changes: 2 additions & 1 deletion charts/agent-relay/templates/local-kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 13 additions & 1 deletion charts/agent-relay/values-eks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions charts/agent-relay/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion charts/relay-webapp/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
16 changes: 15 additions & 1 deletion charts/relay-webapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (`<release>-relay-control`, or its `fullnameOverride`; for example
Expand Down
20 changes: 20 additions & 0 deletions charts/relay-webapp/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
34 changes: 4 additions & 30 deletions charts/relay-webapp/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <publicUrl>/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
Expand Down
4 changes: 3 additions & 1 deletion charts/relay-webapp/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 (<release>-relay-control unless
Expand Down
5 changes: 5 additions & 0 deletions ci/agent-relay/kind/test_stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Loading
Loading