Open JonTheNiceGuy opened 9 years ago
Hi,
I also have a problem with proxy, there is a way to add it to sandstorm for the moment ? to force the plate-forme going through it ?
Hi @A-Picogna ,
It's your lucky week! I'm testing this right now and one of my goals for the week is to make sure that this works.
I'm going to leave a few comments here about how I test this, so that I can test it again more easily in the future.
Goal: Run a Sandstorm process on my laptop with no access to the actual Internet, except via a HTTP proxy
Strategy:
sandstorm
grep SERVER_USER= /opt/sandstorm/sandstorm.conf
iptables -A OUTPUT -o wlp6s0 -m owner --uid-owner sandstorm -j DROP
sudo su - sandstorm -c 'cd /tmp ; wget http://www.google.com/' # make sure this fails
sudo apt install squid
sudo su - sandstorm -c 'cd /tmp ; https_proxy=http://localhost:3128/ http_proxy=http://localhost:3128/ wget https://www.google.com/' # this should succeed now
Great. Next up, adding it to Sandstorm.
(Note: wget requires lowercase http_proxy
and doesn't use http_proxy
for https://
URLs so requires both environment variables set.)
/etc/systemd/system/sandstorm.service
to say:[Unit]
Description=Sandstorm server
After=local-fs.target remote-fs.target network.target
Requires=local-fs.target remote-fs.target network.target
[Service]
Type=forking
ExecStart=/opt/sandstorm/sandstorm start
ExecStop=/opt/sandstorm/sandstorm stop
Environment=http_proxy=http://127.0.0.1:3128/
Environment=https_proxy=http://127.0.0.1:3128/
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload # to get the new sandstorm.service into systemd's mind
sudo service sandstorm restart
I'm working on this right now, so self-assigning.
Hi @paulproteus
I'll be very interested by your results ^^. I have a distant machine on an internal network which need to get through a proxy to acces internet.
the command : systemctl daemon-reload dosen't exist on ubuntu 14.04 apparently :)
Per #1438 I have app install working with a proxy now. Not everything is ready though, and this isn't in a released Sandstorm build yet.
Github auto-closed this because it saw the sentence "does not fully close #693" and only paid attention to the "close #693" part. But this is not actually done yet, so re-opening.
Thanks @kentonv for fixing the metadata fail!
Next up - test/fix the following:
Could we also allow HTTP POST requests? This would allow apps to do bot POST requests in the name of the user. For me Sandstorm is really about making personal apps and such apps often also want to automatize some tasks. Sending an outbound HTTP POST is pretty common.
@mitar This issue is not about grains doing HTTP requests, it's about making the Sandstorm shell's HTTP requests go through a proxy (as is required on e.g. many corp networks).
Oh, sorry. I misread. I read "To implement the httpGet() API method, which e.g. TinyTinyRSS uses to fetch RSS feeds." Is there a more appropriate ticket? Or should I open a new one?
@mitar Dunno if there is a ticket. Secretly you can do posts today using HackSessionContext::getUiViewForEndpoint() and passing a regular old URL (rather than a webkey) and then requesting a WebSession. However, all these APIs will be replaced soon with Powerbox APIs (which will definitely support POST). Feel free to open a ticket or don't, either way it'll get fixed just as fast.
Opened #1924.
I haven't done any work on this lately, so I'm de-assigning from myself for now so that no one thinks I am.
Further to the email discussion with @kentonv: