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

Snap: Set outbound Proxy #4780

Closed
irvingwa opened this issue Oct 28, 2016 · 23 comments
Closed

Snap: Set outbound Proxy #4780

irvingwa opened this issue Oct 28, 2016 · 23 comments
Labels

Comments

@irvingwa
Copy link

Hey all running the latest rocket.chat with a snap install. What is the best way to set both proxy and no proxy lists with the snap install?

@geekgonecrazy
Copy link
Contributor

@irvingwa just so I understand. You want the ability to set an outbound proxy for Rocket.Chat?

@geekgonecrazy geekgonecrazy added Feature: Request Requested Feature and removed type: support labels Jan 4, 2017
@geekgonecrazy geekgonecrazy changed the title Proxy/No Proxy Issues Snap: Set outbound Proxy Jan 4, 2017
@antoniogermano
Copy link

I don't know what he wants, but my Rocket Chat server uses the internet via a corporate proxy. I need RocketChat to use the same proxy as the system, or to setup proxy inside RocketChat so that it can connect to the internet. My server does wget and yum install fine through proxy but RocketChat gets

�[34mI20170112-15:56:56.633(-2) app.js:471 �[31mSystem ➔ error Error sending push to gateway (6 try) -> { [Error: connect ECONNREFUSED 45.55.199.111:443] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect', address: '45.55.199.111', port: 443 }

@zbyte
Copy link

zbyte commented Mar 15, 2017

this feature is very important for me

@holgerdell
Copy link

holgerdell commented Dec 3, 2017

How do I make a rocket.chat snap instance aware of the HTTP_PROXY and HTTPS_PROXY environment variables?

Using systemctl edit snap.rocketchat-server.rocketchat-server.service, I can edit the environment variables to be used inside the snap container as follows:

[Service]
Environment=HTTP_PROXY=http://my.proxy-server.example.com:3128
Environment=HTTPS_PROXY=https://my.proxy-server.example.com:3128

However, rocket.chat 0.59.3 appears to ignore this setting in my situation. Any ideas what I can do to debug this properly?

Possible duplicates: #5090, #5896

@geekgonecrazy
Copy link
Contributor

if you edit it will be replaced any time the snap is updated. the systemd unit file is created by snapd automatically

@holgerdell
Copy link

@geekgonecrazy

  1. I just checked, and the edit did not get replaced in the last automatic updates.
  2. More importantly, the setting appears to have no effect. Can you help me solve/analyze the problem? I have no experience with snaps.

@geekgonecrazy
Copy link
Contributor

I'm not sure if it honors the proxy even when not using snap.. I've seen very mixed reports

@holgerdell
Copy link

@geekgonecrazy
According to this, meteor is supposed to honor the HTTP_PROXY and HTTPS_PROXY environment variables. Is there a way I can issue the meteor update command inside a snap?

@geekgonecrazy
Copy link
Contributor

Meteor actually does not run inside the snap.

Meteor is a node.js framework. When we cut a release we do a meteor build which produces a standalone meteor application.

We will be adding a way to easily set these environment variables in the near future.

@holgerdell
Copy link

Sounds good, thanks!

If possible, the snap should ideally just honor the host system's proxy variables in /etc/environment

@geekgonecrazy
Copy link
Contributor

I'm not sure if that is possible just by the very nature of snaps. Isolation / privacy / security are all kind of the name of the game for snaps. One of the reasons we chose to use it.

@sampaiodiego sampaiodiego added Feature: Planned Planned Feature and removed Feature: Request Requested Feature labels Aug 30, 2018
@sampaiodiego sampaiodiego added this to the 0.70.0 milestone Aug 30, 2018
@reetp
Copy link

reetp commented Oct 29, 2018

Not sure if this gets closed by:
#12351

@holgerdell
Copy link

@reetp How can I test this? Can you tell me an operation that causes the rocket.chat server to request a file from the web?

@reetp
Copy link

reetp commented Nov 4, 2018

Paste a link to a file online or a web page is probably easiest

@holgerdell
Copy link

Nothing happens when I do that.

@geekgonecrazy
Copy link
Contributor

This should technically get closed by #12351 it will allow setting environment variables

@geekgonecrazy
Copy link
Contributor

#12351 will allow setting of environment variables so any that will be possible with non-snap will now also be possible to set there. Will be released with 0.73.0

@geekgonecrazy geekgonecrazy modified the milestones: 0.70.0, 0.73.0 Dec 6, 2018
@Antairez
Copy link

@geekgonecrazy Thanks for the info, are you saying that setting proxy the way just like @holgerdell did (by running sudo systemctl edit snap.rocketchat-server.rocketchat-server.service)will be possible after the release of 0.73.0 for snap users?

[Service]
Environment=HTTP_PROXY=http://proxy.example.com:8080/
Environment=HTTPS_PROXY=http://proxy.example.com:8080/
Environment=NO_PROXY='something.example.com,*.intranet.example.com'

Or is there a recommended way to set it properly and make sure it persists across snap refreshes?

@geekgonecrazy
Copy link
Contributor

After the snap is released for 0.73.0 you will be able to set any environment variable for the snap by dropping a .env file in the common folder. I believe the docs will be updated soon. It will be a few days as usual before the snap release is available.

@Antairez
Copy link

After the snap is released for 0.73.0 you will be able to set any environment variable for the snap by dropping a .env file in the common folder. I believe the docs will be updated soon. It will be a few days as usual before the snap release is available.

@geekgonecrazy Now that 0.73 is out, would you mind pointing me to some instructions on how to set-up proxy using the new way? Thank you.

@reetp
Copy link

reetp commented Jan 18, 2019

@geekgonecrazy
Copy link
Contributor

To clarify it was merged today as well as 0.73 released to stable channel today :) . But yes can now set environment variables as described in that document

@Antairez
Copy link

Antairez commented Mar 7, 2019

@reetp Thanks my friend, how do I find a list of environment variables for changing proxy servers?

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

No branches or pull requests

9 participants