enable --envproxy by default
Context on --envproxy
In #14950 I added the --envproxy flag to LogCLI. This means HTTP_PROXY args are followed, allowing a transparent proxy.
Back in issue #11742 I mentioned that I think this should be default behaviour.
Well, I didn't continue that thread afterwards - because in practice when you set HTTP_PROXY, you may also be setting SSL_CERTS_FILE. And that had a bug in darwin/windows which meant TLS would ultimately not work.
My thinking was since you needed --tls-skip-verify, --envproxy be default would cause more problems than it was worth by default.
With Go 1.27.0, this issue is fixed!
Why change?
By we changed the default envproxy behaviour, proxied environments (or auth wrappers) will need no extra configuration to "just work".
It matches the behaviour of other popular CLI tools like curl, and those that rely on libcurl (although using SSL_CERTS on darwin curl goes through system SSL, but that's beside the point).
Could this break anything? Technically yes: if somebody is running some logcli scripts in a environment where they have this PROXY set, but don't intend for them to be used. I think in almost all cases this is a mistake, so a brief mention of that change in a CHANGELOG would be enough.
Given that most modern CLI tools have this behaviour, it feels as if logcli should too. It reduces the burden of users of the tool.
If folks agree, when the 1.27 upgrade is done, can we also change this flag? Maybe this would need to be included in a version bump, though. I am not clear on the loki standards for versioning.
Source: grafana/loki