coder icon indicating copy to clipboard operation
coder copied to clipboard

`CODER_ACCESS_URL` shouldn't require protocol

Open ammario opened this issue 3 years ago • 3 comments

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.

ammario avatar Jul 09 '22 20:07 ammario

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.

sandros94 avatar Jul 28 '22 23:07 sandros94

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.

spikecurtis avatar Jul 29 '22 17:07 spikecurtis

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.

Yes, but I do think we should infer http for localhost or 127.0.0.1.

ammario avatar Jul 29 '22 17:07 ammario

An alternative is that we require a protocol and do validation on this instead of letting it fail silently.

ketang avatar Jul 31 '22 22:07 ketang