Skip to content

Conversation

@kamilogorek
Copy link
Contributor

@kamilogorek kamilogorek commented Jan 22, 2021

src/config.rs Outdated
fn get_proxy_url(&self) -> Option<&str> {
self.ini.get_from(Some("http"), "proxy_url")
pub fn get_proxy_url(&self) -> Option<String> {
if env::var_os("proxy_url").is_some() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That should be http_proxy IIRC, can you check?

Suggested change
if env::var_os("proxy_url").is_some() {
if env::var_os("http_proxy").is_some() {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks. Also removed the env binding override, as it's not used anymore.

@jan-auer
Copy link
Member

Were you able to test this with an actual proxy?

@kamilogorek
Copy link
Contributor Author

Didn't have enough time yet. Just verified that appropriate data is picked up and passed to the request handler.

@kamilogorek
Copy link
Contributor Author

@nodomain would you maybe find some time to use this build on your testing env?

@nodomain
Copy link

Works like a charm - it is picking up the proxy from the system.

[ec2-user@ip-10-142-254-222 debug]$ ./sentry-cli --log-level debug info
  INFO    2021-01-26 22:33:16.561666975 +00:00 Loaded config from /home/ec2-user/.sentryclirc
  DEBUG   2021-01-26 22:33:16.561829783 +00:00 sentry-cli version: 1.61.0, platform: "linux", architecture: "x86_64"
  INFO    2021-01-26 22:33:16.561905409 +00:00 sentry-cli was invoked with the following command line: "./sentry-cli" "--log-level" "debug" "info"
  DEBUG   2021-01-26 22:33:16.564542969 +00:00 request GET https://sentry.io/api/0/
  DEBUG   2021-01-26 22:33:16.564642899 +00:00 retry number 0, max retries: 0
  DEBUG   2021-01-26 22:33:16.620416568 +00:00 > CONNECT sentry.io:443 HTTP/1.1
  DEBUG   2021-01-26 22:33:16.629089575 +00:00 > Host: sentry.io:443
  DEBUG   2021-01-26 22:33:16.629228153 +00:00 > Proxy-Connection: Keep-Alive
  DEBUG   2021-01-26 22:33:16.629390589 +00:00 < HTTP/1.1 200 Connection Established
  DEBUG   2021-01-26 22:33:16.629493933 +00:00 < Proxy-Agent: Zscaler/6.0
  DEBUG   2021-01-26 22:33:17.037748417 +00:00 > GET /api/0/ HTTP/1.1
  DEBUG   2021-01-26 22:33:17.037910435 +00:00 > Host: sentry.io
  DEBUG   2021-01-26 22:33:17.037969661 +00:00 > Accept: */*
  DEBUG   2021-01-26 22:33:17.038024953 +00:00 > Connection: TE
  DEBUG   2021-01-26 22:33:17.038080664 +00:00 > TE: gzip
  DEBUG   2021-01-26 22:33:17.038137580 +00:00 > User-Agent: sentry-cli/1.61.0
  DEBUG   2021-01-26 22:33:17.169725038 +00:00 < HTTP/1.1 200 OK
  DEBUG   2021-01-26 22:33:17.169901487 +00:00 < Server: nginx
  DEBUG   2021-01-26 22:33:17.170026621 +00:00 < Date: Tue, 26 Jan 2021 22:33:17 GMT
  DEBUG   2021-01-26 22:33:17.170100634 +00:00 < Content-Type: application/json
  DEBUG   2021-01-26 22:33:17.170167704 +00:00 < Content-Length: 39
  DEBUG   2021-01-26 22:33:17.170229046 +00:00 < Connection: keep-alive
  DEBUG   2021-01-26 22:33:17.170305454 +00:00 < Allow: GET, HEAD, OPTIONS
  DEBUG   2021-01-26 22:33:17.170371291 +00:00 < Access-Control-Allow-Methods: GET, HEAD, OPTIONS
  DEBUG   2021-01-26 22:33:17.170823035 +00:00 < Access-Control-Allow-Headers: X-Sentry-Auth, X-Requested-With, Origin, Accept, Content-Type, Authentication, Authorization, Content-Encoding
  DEBUG   2021-01-26 22:33:17.170895482 +00:00 < Access-Control-Expose-Headers: X-Sentry-Error, Retry-After
  DEBUG   2021-01-26 22:33:17.170945629 +00:00 < Access-Control-Allow-Origin: *
  DEBUG   2021-01-26 22:33:17.171001632 +00:00 < Vary: Accept-Language, Cookie
  DEBUG   2021-01-26 22:33:17.171063936 +00:00 < Content-Language: en
  DEBUG   2021-01-26 22:33:17.171137809 +00:00 < X-Frame-Options: deny
  DEBUG   2021-01-26 22:33:17.171202251 +00:00 < X-Content-Type-Options: nosniff
  DEBUG   2021-01-26 22:33:17.171264887 +00:00 < X-XSS-Protection: 1; mode=block
  DEBUG   2021-01-26 22:33:17.171327551 +00:00 < X-Served-By: web-3d5bfb0f
  DEBUG   2021-01-26 22:33:17.171388606 +00:00 < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
  DEBUG   2021-01-26 22:33:17.171489464 +00:00 response status: 200
  DEBUG   2021-01-26 22:33:17.171541176 +00:00 body: {"version":"0","auth":null,"user":null}
Sentry Server: https://sentry.io
Default Organization: -
Default Project: -
  INFO    2021-01-26 22:33:17.172124902 +00:00 Running update nagger update check
  DEBUG   2021-01-26 22:33:17.172332203 +00:00 request GET https://release-registry.services.sentry.io/apps/sentry-cli/latest
  DEBUG   2021-01-26 22:33:17.172390493 +00:00 retry number 0, max retries: 0
  DEBUG   2021-01-26 22:33:17.190697662 +00:00 > CONNECT release-registry.services.sentry.io:443 HTTP/1.1
  DEBUG   2021-01-26 22:33:17.190842301 +00:00 > Host: release-registry.services.sentry.io:443
  DEBUG   2021-01-26 22:33:17.190893570 +00:00 > Proxy-Connection: Keep-Alive
  DEBUG   2021-01-26 22:33:17.218854297 +00:00 < HTTP/1.1 200 Connection Established
  DEBUG   2021-01-26 22:33:17.219055848 +00:00 < Proxy-Agent: Zscaler/6.0
  DEBUG   2021-01-26 22:33:17.252540076 +00:00 > GET /apps/sentry-cli/latest HTTP/1.1
  DEBUG   2021-01-26 22:33:17.252672218 +00:00 > Host: release-registry.services.sentry.io
  DEBUG   2021-01-26 22:33:17.252722203 +00:00 > Accept: */*
  DEBUG   2021-01-26 22:33:17.252763694 +00:00 > Connection: TE
  DEBUG   2021-01-26 22:33:17.252812501 +00:00 > TE: gzip
  DEBUG   2021-01-26 22:33:17.252853494 +00:00 > User-Agent: sentry-cli/1.61.0
  DEBUG   2021-01-26 22:33:17.484422362 +00:00 < HTTP/1.1 200 OK
  DEBUG   2021-01-26 22:33:17.484567095 +00:00 < content-type: application/json
  DEBUG   2021-01-26 22:33:17.484631855 +00:00 < content-length: 2406
  DEBUG   2021-01-26 22:33:17.484699456 +00:00 < access-control-allow-origin: *
  DEBUG   2021-01-26 22:33:17.484758412 +00:00 < x-from-cache: 1
  DEBUG   2021-01-26 22:33:17.484823839 +00:00 < x-envoy-upstream-service-time: 1
  DEBUG   2021-01-26 22:33:17.484931521 +00:00 < date: Tue, 26 Jan 2021 22:33:17 GMT
  DEBUG   2021-01-26 22:33:17.484994946 +00:00 < server: envoy
  DEBUG   2021-01-26 22:33:17.485055185 +00:00 < Via: 1.1 google
  DEBUG   2021-01-26 22:33:17.485121723 +00:00 < Alt-Svc: clear
  DEBUG   2021-01-26 22:33:17.485255890 +00:00 response status: 200
  INFO    2021-01-26 22:33:17.485412414 +00:00 Looking for file named: sentry-cli-Linux-x86_64
  DEBUG   2021-01-26 22:33:17.485450569 +00:00 body: {"canonical":"app:sentry-cli","file_urls":{"sentry-cli-Darwin-arm64":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Darwin-arm64","sentry-cli-Darwin-universal":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Darwin-universal","sentry-cli-Darwin-x86_64":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Darwin-x86_64","sentry-cli-Linux-i686":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Linux-i686","sentry-cli-Linux-x86_64":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Linux-x86_64","sentry-cli-Windows-i686.exe":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Windows-i686.exe","sentry-cli-Windows-x86_64.exe":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Windows-x86_64.exe"},"files":{"sentry-cli-Darwin-arm64":{"checksums":{"sha256-hex":"d19bec8291f06b98f0632e0e6c421ba99f21597c667eb27bbc1bdbcdf410a33d"},"url":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Darwin-arm64"},"sentry-cli-Darwin-universal":{"checksums":{"sha256-hex":"4ec67744e562f156ac6bfbdf308d247436599705b843f58732fb5ede23c5f630"},"url":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Darwin-universal"},"sentry-cli-Darwin-x86_64":{"checksums":{"sha256-hex":"ca3037b0174e36edbc72e9787804d2e801958d7a4af24576463bf3d60745a4a7"},"url":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Darwin-x86_64"},"sentry-cli-Linux-i686":{"checksums":{"sha256-hex":"4746c95c5ef52b9e4f1213821b07d01351a8c983c06f5b596386bc5d3c9c959e"},"url":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Linux-i686"},"sentry-cli-Linux-x86_64":{"checksums":{"sha256-hex":"fb829f963e43a80c02d4fcd3fa7534a746bcccaa171df149738dc4a203213fde"},"url":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Linux-x86_64"},"sentry-cli-Windows-i686.exe":{"checksums":{"sha256-hex":"5f74946fdecf8323e2cfe53477cd2f9bb56bb58bccfb975798426dfdca9b85f0"},"url":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Windows-i686.exe"},"sentry-cli-Windows-x86_64.exe":{"checksums":{"sha256-hex":"f8b8225e621dd549388f6c68815a23ca61742486905317caf44a0be559ab96b4"},"url":"https://downloads.sentry-cdn.com/sentry-cli/1.61.0/sentry-cli-Windows-x86_64.exe"}},"main_docs_url":"https://docs.sentry.io/learn/cli","name":"Sentry CLI","repo_url":"https://github.com/getsentry/sentry-cli","version":"1.61.0"}

  INFO    2021-01-26 22:33:17.486117779 +00:00 Found asset sentry-cli-Windows-x86_64.exe
  INFO    2021-01-26 22:33:17.486175362 +00:00 Found asset sentry-cli-Windows-i686.exe
  INFO    2021-01-26 22:33:17.486213398 +00:00 Found asset sentry-cli-Linux-x86_64

@kamilogorek kamilogorek merged commit 3a2fd29 into master Feb 1, 2021
@kamilogorek kamilogorek deleted the proxy-config branch February 1, 2021 10:04
@kamilogorek
Copy link
Contributor Author

Awesome, thanks @nodomain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Http configuration ignored in .sentryclirc

4 participants