coder / coder

Provision remote development environments via Terraform
https://coder.com
GNU Affero General Public License v3.0
8.32k stars 708 forks source link

workspace proxies: unique health check error if being treated as a subdomain app #11116

Closed bpmct closed 10 months ago

bpmct commented 11 months ago

Background

A customer may mistakenly put a proxy in the same DNS path as wildcard apps, where the wildcard app somehow takes priority.

e.g. *.demo.coder.com vs proxy.demo.coder.com

image image image

Proposal

Show a unique error in the health check to explain the conflict and resolution

bpmct commented 11 months ago

@deansheather mind taking this one?

Emyrk commented 10 months ago

This seems highly niche.

We also output the appropriate values when you do coder wsproxy create

CODER_PROXY_SESSION_TOKEN=<token> coder wsproxy server --primary-access-url https://<host>.com --http-address=0.0.0.0:3001 

I am having trouble even setting this up. When you create a new proxy, it requests the /buildinfo endpoint, which doesn't return a json payload, so you get:

$ go run main.go wsproxy server --primary-access-url=https://filebrowser--dev--coder--emyrk--apps.dev.coder.com/ ...
#...
Encountered an error running "coder workspace-proxy server"
create workspace proxy: failed to fetch build info from "https://filebrowser--dev--coder--emyrk--apps.dev.coder.com/": invalid character '<' looking for beginning of value

So you can't even start the workspace proxy here to set it up in the first place.

bpmct commented 10 months ago

Hey - I'm down to close this as not planned if this is a very unlikely setup. I don't know how to reproduce it.

Emyrk commented 10 months ago

@bpmct I have already spent some time on this path, and I found some little things I can improve. I'll put up a PR or two, but I don't think I have the setup for this specific situation.

Emyrk commented 10 months ago

Cli error improvements: https://github.com/coder/coder/pull/11584

Emyrk commented 10 months ago

Found the way to reproduce, had it backwards. Fixed