Skip to content

add: support setting proxy via custom env vars#80

Merged
mgoetzegb merged 3 commits into
main-gbfrom
custom-http-proxy
Jun 17, 2025
Merged

add: support setting proxy via custom env vars#80
mgoetzegb merged 3 commits into
main-gbfrom
custom-http-proxy

Conversation

@mgoetzegb

@mgoetzegb mgoetzegb commented Jun 12, 2025

Copy link
Copy Markdown
Member

What

Support setting proxy via custom env vars CSAF_DL_HTTP_PROXY and CSAF_DL_HTTPS_PROXY.

If set to a non empty string, they will take precedence over http_proxy and https_proxy and also their upper case versions.

Why

There are scenarios where we want to apply a proxy only for the CSAF Downloader. Setting http_proxy and https_proxy usually affects several other tools running in the same environment. So having the option to use the custom env vars allows us to avoid that.

References

VTI-619

Checklist

  • Tests

@mgoetzegb
mgoetzegb requested a review from a team as a code owner June 12, 2025 08:42
@github-actions

Copy link
Copy Markdown

Conventional Commits Report

Type Number
Added 1

🚀 Conventional commits found.

On second thought this feature is probably not expected by users.
Furthermore in a container orchestration scenario it is usually not trivial to set an environment variable only conditionally. This would make it also difficult to use this feature.
@mgoetzegb

mgoetzegb commented Jun 12, 2025

Copy link
Copy Markdown
Member Author

I removed the distinction

env var unset -> use http(s)_proxy env var if set
env var set to empty string -> disable proxy and ignore http(s)_proxy env var, even if it is set

Now it is in both cases: use http(s)_proxy env var if set

On second thought the distinction is probably a rather unexpected bahavior. And I don't see a strong need for such a feature to justify this. Especially in a kubernetes deployment etc. it is also not so easy to conditionally set an env var. Making it even less useful.

@mgoetzegb mgoetzegb added the minor release Set label to create a minor release label Jun 13, 2025
Comment thread cmd/csaf_downloader/downloader_test.go Outdated
Co-authored-by: llugin <leszek.lugin@greenbone.net>
@mgoetzegb
mgoetzegb merged commit b952049 into main-gb Jun 17, 2025
4 of 5 checks passed
@mgoetzegb
mgoetzegb deleted the custom-http-proxy branch June 17, 2025 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor release Set label to create a minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants