Skip to content

Refuse agent file URLs on a cluster service name, and say why - #30

Merged
joeldickson merged 3 commits into
mainfrom
fix/cluster-origin-warning
Oct 29, 2026
Merged

joeldickson merged 3 commits into
mainfrom
fix/cluster-origin-warning

Conversation

@joeldickson

Copy link
Copy Markdown
Contributor

Summary

Fixes #28.

Behind a gateway, with base_url blank, ShipLean published upload_url, download_url and open_url on the in-cluster service name and did not say why. When that host is still *.svc:

  • One warning per process names the cause (no X-Forwarded-Host, the peer is not in SHIPLEAN_TRUSTED_PROXIES, or the forwarded host is itself *.svc).
  • /health reports publicOrigin as unknown: set base_url, and the instance settings General tab says the same.
  • attach_file without base64, and a read_attachment download URL, fail instead of returning a URL a laptop cannot open. The upload error tells the agent to send base64.
  • open_url still uses that host until base_url is set. docs/mcp.md and docs/auth.md say how to set base_url, or to trust the gateway and send X-Forwarded-Host and X-Forwarded-Proto.

Test plan

  • RequestOriginTests and PublicOriginTests: untrusted peer, missing header, forwarded *.svc host, and one warning.
  • AttachUploadHostTests and AttachDownloadTests: dialed host *.svc refuses the file URL, mints no token, and /health shows publicOrigin.
  • HealthTests still pass. Instance settings component test shows the notice when publicOrigin is unknown.
  • On a cluster deploy with base_url blank, confirm the warning, the health flag, and that attach_file without base64 names base_url. Setting base_url clears the flag (agents reconnect).

The notice already uses that id, and the unit check requires the matching const.
A cached restore layer leaves the package mount empty on the next job, so publish --no-restore cannot find Agoda.Analyzers.
@joeldickson
joeldickson merged commit fedbf2e into main Oct 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Agent URLs (upload_url, download_url, open_url) fall back to the cluster service name behind a gateway, with no warning

2 participants