Nixpkgs: Tor browser can not be download

Created on 28 May 2017  Â·  22Comments  Â·  Source: NixOS/nixpkgs

Hi,

Tor browser links are blocked in some countries (like Turkey). It can not be download by nix-env form command line. But there are other alternative official download links of tor browser which are working from Turkey. It is possible to make nix-env to use alternative links when gets timeout error?

Thank you

question

All 22 comments

You can nix-prefetch-url that-link-which-works. The result should get picked up automatically afterwards, if the hash matches.

Are you talking about the pre-built torbrowser bundle? If so, we could look into adding more urls to the expression. Perhaps I should revisit the decision to not build the bundle on hydra as well; I had not considered that those who need it the most might have the hardest time getting it.

Alternatively, I'd expect the from-source torbrowser package to work, if you can access the hydra cache.

@joachifm I am not advanced user. I can not exactly answer your questions.

On this command:

nix-env -i tor-browser-bundle-bin

I get this error:

installing ‘tor-browser-bundle-bin-6.5.2’
these derivations will be built:
/nix/store/3s2jssc491lrb1ha2q7rl3xbbbfdj331-torbrowser.desktop.drv
/nix/store/lqi229ll1zm8qhzf4fqbv7a64mgzv8b9-tor-browser-linux64-6.5.2_en-US.tar.xz.drv
/nix/store/wxgx2pn7p0xyjbc4vraaai4mc7m14jad-tor-browser-bundle-bin-6.5.2.drv
building path(s) ‘/nix/store/m8lyspl1y1qh4a7v18j216bhraz9qp1a-tor-browser-linux64-6.5.2_en-US.tar.xz’

trying https://dist.torproject.org/torbrowser/6.5.2/tor-browser-linux64-6.5.2_en-US.tar.xz
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to dist.torproject.org:443
error: cannot download tor-browser-linux64-6.5.2_en-US.tar.xz from any mirror
builder for ‘/nix/store/lqi229ll1zm8qhzf4fqbv7a64mgzv8b9-tor-browser-linux64-6.5.2_en-US.tar.xz.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/wxgx2pn7p0xyjbc4vraaai4mc7m14jad-tor-browser-bundle-bin-6.5.2.drv’: 1 dependencies couldn't be built
error: build of ‘/nix/store/wxgx2pn7p0xyjbc4vraaai4mc7m14jad-tor-browser-bundle-bin-6.5.2.drv’ failed

I know, this tor browser links are blocked on my location Turkey. But I remember many other official links available for tor browser.

@vcunat nix-prefetch-url is something ready-only? I am worrying to make something to block other installations..

@jarry9: it's perfectly safe to run nix-prefetch-url, even in parallel with other nix* operations. (But the new file can only get picked up after the download has finished.)

Btw., to get alternative download urls, see https://gettor.torproject.org/

If you are using a recent version of Nixpkgs, you can do nix-env -iA firefoxPackages.tor-browser to use the from-source package instead; it'll be downloaded from the nixos software cache, so should work even if the normal distribution sites are blocked.

@joachifm I am getting this error from your command which you gave me:

error: attribute ‘firefoxPackages’ in selection path ‘firefoxPackages.tor-browser’ not found

@jarry9: it depends on your setup. The typical one on NixOS requires nixos.firefoxPackages.tor-browser (but you may use different channel names).

@vcunat It downloaded.

But this package added to my path as "firefox". I am not able to start my old firefox stable from command line. Also the firefox which is started is not like tor browser. It uses the same profile folder of firefox normal stable.

@jarry9 they are not exactly equivalent; the from-source variant doesn't have the bundle parts, so you need to set up a profile for it manually.

I expect you need to configure tor &c yourself, too ..., so it's not such a great replacement out-of-the box after all :(

hmm.. I can not configure them. It is complicated for me. Thank you for you interest. We can close the issue.

If you can get a an alternate url for the tor-browser, the nix-prefetch-url solution is probably your best bet in the short term. I'll push a patch to ensure the bundle is available via our cache, but it'll be a while before it will be available.

I test it without vpn or anything from Turkey. These links works properly:
https://thetorproject.github.io/gettor/

So I will type below commands ?

nix-prefetch-url https://github.com/TheTorProject/gettorbrowser/releases/download/v6.5.2/tor-browser-linux64-6.5.2_en-US.tar.xz
&
ni-env -i tor-browser-bundle-bin

@jarry9 yes, the checksums match so it should work.

@joachifm It worked :) Thank you.

Not a problem but only for note: I see a first time a warning when I installed the tor:

installing ‘tor-browser-bundle-bin-6.5.2’
these derivations will be built:
/nix/store/3s2jssc491lrb1ha2q7rl3xbbbfdj331-torbrowser.desktop.drv
/nix/store/wxgx2pn7p0xyjbc4vraaai4mc7m14jad-tor-browser-bundle-bin-6.5.2.drv
building path(s) ‘/nix/store/gpqakzscxkq5zix5avw95vijlffgbw7b-torbrowser.desktop’
building path(s) ‘/nix/store/sbx5ha2iajd3lganxn5glnwailasb347-tor-browser-bundle-bin-6.5.2’
/nix/store/sbx5ha2iajd3lganxn5glnwailasb347-tor-browser-bundle-bin-6.5.2/share/tor-browser /tmp/nix-build-tor-browser-bundle-bin-6.5.2.drv-0
warning: working around a Linux kernel bug by creating a hole of 4096 bytes in ‘firefox’
warning: working around a Linux kernel bug by creating a hole of 2109440 bytes in ‘TorBrowser/Tor/tor’
Checking bundled Tor ...
Checking tor-browser wrapper ...
building path(s) ‘/nix/store/dcrq3di5mmnpmrcqm19z7018fyb6lipc-user-environment’
created 6942 symlinks in user environment

And what exactly "nix-prefetch-url" command does? It downloads the file and get hash. Aftre that time if I install a package with "nix-env -i" it uses my URL if the hash matches?

SO, nix-env auto update will not update my tor browser.. am I right?

Those warnings can be safely ignored.

nix-env should update torbrowser as normal; I'll add the urls you provided to those used to get the bundle, so it should work more smoothly in the future.

There's nothing special about nix-prefetch-url, it simply puts the file at the end of the url into your software store. It does not change the url used by nix-env. Certain build artefacts are content-addressed, so Nix won't do anything if it finds a file with the declared checksum already in the store. See "fixed-output derivations" in the Nix manual for details.

Thank you so much :)

Is there any new url's for tor url ? :/

abowe links are still blocked from turkey :)

And how can I check which version of tor is using now for nix? I will find a link for that version.

Thank you

@jackTaw88 unfortunately, https://github.com/TheTorProject/gettorbrowser/releases/ seems to be lagging behind official releases.

Quoting from https://thetorproject.github.io/gettor/:

Get links via Email: You can send an email to [email protected]. Send the word help in the body of the message to learn how to interact with it.
Get links via XMPP: You can send a message to [email protected] using your favorite XMPP client. Simply enter help in an XMPP message to learn how to interact with it.
Get links via Twitter: You can send a direct message to @get_tor account (you don't need to follow). Send the word help in a direct message to learn how to interact with it.

Once you get a link, you should be able to use nix-prefetch-url on it and proceed to install the bundle.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lverns picture lverns  Â·  3Comments

spacekitteh picture spacekitteh  Â·  3Comments

retrry picture retrry  Â·  3Comments

ghost picture ghost  Â·  3Comments

teto picture teto  Â·  3Comments