`CODER_ACCESS_URL` shouldn't require protocol
As a user, if the access URL is set to localhost:6080 instead of http://localhost:6080, workspaces will fail to build since "localhost" is assumed to be the protocol. We should either show an error that a protocol is required or add a protocol if none exists.
This made me waste at least 4 hours.
On a custom docker-compose (couple hours ago reading this issue) I made a correction in my env
CODER_ACCESS_URL = "https://example.domain.com"
so that
CODER_ADDRESS: "0.0.0.0:7080"
CODER_ACCESS_URL: "${CODER_DOMAIN}"
would have worked...
but forgetting I used the same env on the reverse proxy so it was trying to resolve https://https://example.domain.com
A fix as simple as:
CODER_ADDRESS: "0.0.0.0:7080"
CODER_ACCESS_URL: "https://${CODER_DOMAIN}"
was what I needed in the end.
If we end up inferring a scheme, that scheme better be https. If anyone (highly inadvisably) wants to do http, they should be explicit about it.
If we end up inferring a scheme, that scheme better be
https. If anyone (highly inadvisably) wants to dohttp, they should be explicit about it.
Yes, but I do think we should infer http for localhost or 127.0.0.1.
An alternative is that we require a protocol and do validation on this instead of letting it fail silently.