Rocket.chat: Snap: Set outbound Proxy

Created on 28 Oct 2016  Â·  23Comments  Â·  Source: RocketChat/Rocket.Chat

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?

Planned snaps

All 23 comments

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

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

I20170112-15:56:56.633(-2) app.js:471 System âž” 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 }

this feature is very important for me

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

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

@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.

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

@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?

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.

Sounds good, thanks!

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

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.

Not sure if this gets closed by:
https://github.com/RocketChat/Rocket.Chat/pull/12351

@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?

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

Nothing happens when I do that.

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

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 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?

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.

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.

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

engelgabriel picture engelgabriel  Â·  3Comments

mattlin picture mattlin  Â·  3Comments

lunitic picture lunitic  Â·  3Comments

neha1deshmukh picture neha1deshmukh  Â·  3Comments

mddvul22 picture mddvul22  Â·  3Comments