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

Tor browser can not be download #26184

Closed
jarry9 opened this issue May 28, 2017 · 22 comments
Closed

Tor browser can not be download #26184

jarry9 opened this issue May 28, 2017 · 22 comments

Comments

@jarry9
Copy link

jarry9 commented May 28, 2017

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

@vcunat
Copy link
Member

vcunat commented May 28, 2017

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

@joachifm
Copy link
Contributor

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.

@jarry9
Copy link
Author

jarry9 commented May 28, 2017

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

@jarry9
Copy link
Author

jarry9 commented May 28, 2017

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

@vcunat
Copy link
Member

vcunat commented May 28, 2017

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

@joachifm
Copy link
Contributor

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

@joachifm
Copy link
Contributor

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.

@jarry9
Copy link
Author

jarry9 commented May 28, 2017

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

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

@vcunat
Copy link
Member

vcunat commented May 28, 2017

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

@jarry9
Copy link
Author

jarry9 commented May 28, 2017

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

@joachifm
Copy link
Contributor

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

@joachifm
Copy link
Contributor

joachifm commented May 28, 2017

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

@jarry9
Copy link
Author

jarry9 commented May 28, 2017

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

@joachifm
Copy link
Contributor

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.

@jarry9
Copy link
Author

jarry9 commented May 28, 2017

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

@joachifm
Copy link
Contributor

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

@jarry9
Copy link
Author

jarry9 commented May 28, 2017

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

@jarry9
Copy link
Author

jarry9 commented May 28, 2017

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

@joachifm
Copy link
Contributor

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.

@jarry9
Copy link
Author

jarry9 commented May 28, 2017

Thank you so much :)

@vcunat vcunat closed this as completed May 28, 2017
joachifm added a commit that referenced this issue May 28, 2017
To better support users that are unable to access the official Tor
distribution site, e.g., #26184
joachifm added a commit that referenced this issue May 29, 2017
To better support users that are unable to access the official Tor
distribution site, e.g., #26184

(cherry picked from commit 2262f89)
@jackTaw88
Copy link

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

@joachifm
Copy link
Contributor

@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 gettor@torproject.org. 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 gettor@torproject.org 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.

adrianpk added a commit to adrianpk/nixpkgs that referenced this issue May 31, 2024
To better support users that are unable to access the official Tor
distribution site, e.g., NixOS#26184

(cherry picked from commit 2262f89)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants