Description
It is better to let them expand when they run in the Coder CLI because one might use $CODER_URL
which will not yet be set if it is expanded before the proxy command is actually ran. We should pass the header command literally to the CLI so the expansion happens in that context (where CODER_URL
will be set) instead.
I think we can do this by simply wrapping the --header-command
value in single quotes, although I am not sure if Windows has a different story.
As far as bash-like shells go, wrapping in single quotes means we should also escape single quotes already in the header command which means using something like '"'"'
or '\''
, I believe.
Related: #335 (the header command contains $CODER_URL
which expands to nothing because it is not set in the context of the Java process making the SSH connection, causing the header command and consequently the proxy command and then the connection itself to fail).