Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about installation with http_proxy #2725

Closed
lemrouch opened this issue Jan 22, 2024 · 1 comment · Fixed by #2734
Closed

Question about installation with http_proxy #2725

lemrouch opened this issue Jan 22, 2024 · 1 comment · Fixed by #2734

Comments

@lemrouch
Copy link
Contributor

Problem Statement

I'm trying to install Sentry behind firewall.
Code in https://github.com/getsentry/self-hosted/pull/1543/files is

RUN if [ -z "${http_proxy}" ]; then echo "Acquire::http::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf; fi
RUN if [ -z "${https_proxy}" ]; then echo "Acquire::https::proxy \"${https_proxy}\";" >> /etc/apt/apt.conf; fi

In my experience and documentation -z in test means if the string is empty therefore the config won't be set if there are actual values in http_proxy and/or https_proxy variables.

Solution Brainstorm

I guess the code was meant to be

RUN if [ ! -z "${http_proxy}" ]; then echo "Acquire::http::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf; fi
RUN if [ ! -z "${https_proxy}" ]; then echo "Acquire::https::proxy \"${https_proxy}\";" >> /etc/apt/apt.conf; fi

or

RUN if [ -n "${http_proxy}" ]; then echo "Acquire::http::proxy \"${http_proxy}\";" >> /etc/apt/apt.conf; fi
RUN if [ -n "${https_proxy}" ]; then echo "Acquire::https::proxy \"${https_proxy}\";" >> /etc/apt/apt.conf; fi

Am I right or too tired?

@azaslavsky
Copy link
Contributor

I think that's correct. Any interest in submitting a PR with the fix?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants