elm / package.elm-lang.org

website for browsing packages and exploring documentation
https://package.elm-lang.org/
BSD 3-Clause "New" or "Revised" License
293 stars 113 forks source link

Not responding to requests from Russia? #278

Closed norpadon closed 4 years ago

norpadon commented 5 years ago

I'm continually getting connection timeouts when trying to access package.elm-lang.org from my home network (188.123.252.148) or my company's VPN (2a02:6b8:0:3710::1:6) using elm init, safari, chrome or curl from different devices. But site opens when I use swiss VPN.

jenfan commented 5 years ago

no way to install any package or just make elm init even with VPN =( same country, same problem

jenfan commented 5 years ago

@norpadon I found a decision: make a hotspot from mobile and SET VPN ON MOBILE, not on the mac. and you can do elm init :)

AleXoundOS commented 5 years ago

Same for me (using onlime.ru provider).

Interesting that it responds to ping:

$ ping -c4 package.elm-lang.org
PING package.elm-lang.org (159.89.227.162) 56(84) bytes of data.
64 bytes from package.elm-lang.org (159.89.227.162): icmp_seq=1 ttl=48 time=125 ms
64 bytes from package.elm-lang.org (159.89.227.162): icmp_seq=2 ttl=48 time=126 ms
64 bytes from package.elm-lang.org (159.89.227.162): icmp_seq=3 ttl=48 time=126 ms
64 bytes from package.elm-lang.org (159.89.227.162): icmp_seq=4 ttl=48 time=126 ms

However no success with wget, it hangs for several minutes and finally times out:

$ wget package.elm-lang.org
--2018-10-27 02:35:41--  http://package.elm-lang.org/
Resolving package.elm-lang.org (package.elm-lang.org)... 159.89.227.162
Connecting to package.elm-lang.org (package.elm-lang.org)|159.89.227.162|:80... failed: Connection timed out.
Retrying.

Same for curl:

$ curl package.elm-lang.org
curl: (7) Failed to connect to package.elm-lang.org port 80: Connection timed out

Using Tor helps, curl with proxy over Tor:

$ curl --socks5-hostname 127.0.0.1:9050 package.elm-lang.org
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx/1.10.3 (Ubuntu)</center>
</body>
</html>

As I understand the elm binary supports only HTTP proxy and not SOCKS. So what's the right way of configuring environment for development in elm in this case?

AleXoundOS commented 5 years ago

Same https://github.com/elm/core/issues/994.

AleXoundOS commented 5 years ago

Managed to get it to work with polipo as an additional HTTP Proxy over Tor. Proxy environment variable set as export https_proxy=127.0.0.1:8118. So that elm is able to pick the https_proxy setting.

(For unknown reason torsocks doesn't help.)

AleXoundOS commented 5 years ago

Figured out why torsocks does not work. According to man page torsocks:

overloads the libc symbols use for Internet communication

The technique it uses is dynamic library injection using LD_PRELOAD. Since the elm-platform binary I use is fully statically linked (has no dependencies on .so files):

$ ldd /bin/elm
        not a dynamic executable

... overloading does nothing for it.

tdorzhi commented 5 years ago

Having same problem, but the response is rather different: Connection Refused, though IP is pingable. Anyone can point me if I can use

Proxy environment variable set as export https_proxy=127.0.0.1:8118. So that elm is able to pick the https_proxy setting.

but with SOCKS5 instead?

rlefevre commented 5 years ago

The elm binary does not support SOCKS proxies using the https_proxy environment variable, only HTTPS ones.

Using an HTTP proxy between elm and a SOCKS proxy (as provided by Tor for example) could help. This link provides a description using polipo as said earlier in the thread (https://github.com/elm/package.elm-lang.org/issues/278#issuecomment-433663639).

Also see https://github.com/elm/compiler/issues/1840#issuecomment-440436481 for more information about elm and the https_proxy environment variable.

tdorzhi commented 5 years ago

Thanks. So sad Russia banned the site for no particular reason...

and-semakin commented 5 years ago

Banned because it's hosted on DigitalOcean. So we have to use proxy now.

image (Screenshot from @rkn_block_check_bot Telegram bot).

AleXoundOS commented 5 years ago

It would be nice to have instructions on how to create a mirror.

AleXoundOS commented 5 years ago

Not a mirror, but one kind of a local solution: https://github.com/drathier/elm-offline. Based on elm-compiler code and a small python script. Currently not a polished project, taking full contents of the former elm-compiler repository. But we have to appreciate the author's work on this.

rlefevre commented 5 years ago

Until an official solution is found, maybe the proxies and instructions described in this gist could help:

Packages website reverse proxy: https://elm.dmy.fr

Proxy for elm binary:

$ https_proxy=elm.dmy.fr:9999 elm [...]

Note that this has nothing to do with the core Elm team, I'm just a community member.

AlexAkulov commented 5 years ago

Зачем вам elm когда есть водка?

AleXoundOS commented 5 years ago

Зачем вам elm когда есть водка?

Candidate for abuse report.

kaimu commented 5 years ago

An IPv6 address could be a nice temporary solution.

rlefevre commented 5 years ago

I have also added a reverse proxy to browse documentation for packages < 0.19: https://old.elm.dmy.fr/

To use 0.18 elm-make and elm-package, use:

$ http_proxy=elm.dmy.fr:9999 elm-make [...]
$ http_proxy=elm.dmy.fr:9999 elm-package ...

I have updated the gist with instructions.

volnyvolnyvolny commented 4 years ago

@rlefevre Thanks! It's brilliant!

norpadon commented 4 years ago

Валите из этой страны пока не поздно, ребята

evancz commented 4 years ago

The site has a new IP address. Is it working for people in Russia now?

randomer commented 4 years ago

Looks like it does! Thank you so much! 🙏

kaimu commented 4 years ago

It works. Thanks a lot!

evancz commented 4 years ago

Great, glad we figured out some sort of fix!