fix: accept legacy redirect HTTP environment variables #10748
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Oh man, what a mess. It looks like
CODER_TLS_REDIRECT_HTTP
appears in our config docs. Maybe that was the initial name for the environment variable?At some point, both the flag and the environment variable were
--tls-redirect-http-to-https
andCODER_TLS_REDIRECT_HTTP_TO_HTTPS
.CODER_TLS_REDIRECT_HTTP
did nothing.However, then we introduced
CODER_REDIRECT_TO_ACCESS_URL
, we put in some deprecation code that was maybe fat-fingered such that we accept the environment variableCODER_TLS_REDIRECT_HTTP
but the flag--tls-redirect-http-to-https
. Our docs still refer toCODER_TLS_REDIRECT_HTTP
at https://coder.com/docs/v2/latest/admin/configure#addressSo, I think what we gotta do is still accept
CODER_TLS_REDIRECT_HTTP
since it was working and in an example doc, but also fix the deprecation code to acceptCODER_TLS_REDIRECT_HTTP_TO_HTTPS
environment variable.