tor2web / Tor2web

Tor2web is an HTTP proxy software that enables access to Tor Hidden Services by mean of common web browsers
https://www.tor2web.org
GNU Affero General Public License v3.0
705 stars 176 forks source link

tor2web installation struggles on bionic #356

Closed arunasank closed 5 years ago

arunasank commented 5 years ago
$ wget https://deb.globaleaks.org/install-tor2web.sh
$ chmod +x install-tor2web.sh
$ ./install-tor2web.sh

Checking preliminary Tor2web requirements
 + apt-key requirement meet
 + apt-get requirement meet
Detected OS: Ubuntu - bionic
grep: Unmatched ( or \(
Adding GlobaLeaks PGP key to trusted APT keys
Running: "apt-key add /globaleaks_key"... SUCCESS
Running: "rm -f /globaleaks_key"... SUCCESS
Running: "apt-get update -y"... SUCCESS
Installing software-properties-common
Running: "apt-get install software-properties-common -y"... SUCCESS
Running: "apt-get update -y"... SUCCESS
Running: "apt-get install tor2web -y"... FAIL
Ouch! The installation failed.
COMBINED STDOUT/STDERR OUTPUT OF FAILED COMMAND:
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package tor2web

Contents of /etc/apt/sources.list:

deb http://deb.torproject.org/torproject.org bionic main
deb-src http://deb.torproject.org/torproject.org bionic main

What am I doing wrong?

ahmed-abdelazim commented 5 years ago

Nothing you do wrong. just package doesn't exsit

On Tue, Jun 25, 2019 at 12:33 AM S Aruna notifications@github.com wrote:

$ wget https://deb.globaleaks.org/install-tor2web.sh $ chmod +x install-tor2web.sh $ ./install-tor2web.sh

Checking preliminary Tor2web requirements

  • apt-key requirement meet
  • apt-get requirement meet Detected OS: Ubuntu - bionic grep: Unmatched ( or ( Adding GlobaLeaks PGP key to trusted APT keys Running: "apt-key add /globaleaks_key"... SUCCESS Running: "rm -f /globaleaks_key"... SUCCESS Running: "apt-get update -y"... SUCCESS Installing software-properties-common Running: "apt-get install software-properties-common -y"... SUCCESS Running: "apt-get update -y"... SUCCESS Running: "apt-get install tor2web -y"... FAIL Ouch! The installation failed. COMBINED STDOUT/STDERR OUTPUT OF FAILED COMMAND: Reading package lists... Building dependency tree... Reading state information... E: Unable to locate package tor2web

Contents of /etc/apt/sources.list:

deb http://deb.torproject.org/torproject.org bionic main deb-src http://deb.torproject.org/torproject.org bionic main

What am I doing wrong?

β€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/globaleaks/Tor2web/issues/356?email_source=notifications&email_token=AIFGDRMXFRKHQ3FOZYPG6STP4FDTRA5CNFSM4H3C3GE2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4G3M6USA, or mute the thread https://github.com/notifications/unsubscribe-auth/AIFGDRPJ3EBJVIXWRJCUZZLP4FDTRANCNFSM4H3C3GEQ .

arunasank commented 5 years ago

So, how do I install tor2web?

ahmed-abdelazim commented 5 years ago

wait till they fix the repository problem. that happened before and they fixed it.

On Tue, Jun 25, 2019 at 12:36 AM S Aruna notifications@github.com wrote:

So, how do I install tor2web?

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/globaleaks/Tor2web/issues/356?email_source=notifications&email_token=AIFGDRP6U7QF7FWI253PFPTP4FD7LA5CNFSM4H3C3GE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYONS4I#issuecomment-505207153, or mute the thread https://github.com/notifications/unsubscribe-auth/AIFGDROZECJDWJO3ZWFAOXTP4FD7LANCNFSM4H3C3GEQ .

arunasank commented 5 years ago

πŸ‘ oh ok! Is it available on another ubuntu distribution? Like xenial - do you know?

ahmed-abdelazim commented 5 years ago

No, just wait for fix. you can also build .deb from source

On Tue, Jun 25, 2019 at 12:39 AM S Aruna notifications@github.com wrote:

πŸ‘ oh ok! Is it available on another ubuntu distribution? Like xenial - do you know?

β€” You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/globaleaks/Tor2web/issues/356?email_source=notifications&email_token=AIFGDRITJ57NX5ITJDJHY6DP4FEJ3A5CNFSM4H3C3GE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYONXZQ#issuecomment-505207782, or mute the thread https://github.com/notifications/unsubscribe-auth/AIFGDRNGJXG6PWINR5ATZL3P4FEJ3ANCNFSM4H3C3GEQ .

arunasank commented 5 years ago

Okay, I struggled through this installation on bionic, but the packages are severely broken. I have a broken version of tor2web installed from source using https://github.com/globaleaks/Tor2web/blob/master/scripts/build.sh, which does not contain the python3-twisted-core dependency, because I can't find this dependency anywhere online or on a PPA anywhere. πŸ™ˆ

The broken version of tor2web that I managed to install (ignoring the python3-twisted-core dependency) after some struggle does not start when I run /etc/init.d/tor2web start after installing certificates and configuring them. After correcting 3 octal errors in the python code, I now have:

  Process: 17396 ExecStart=/etc/init.d/tor2web start (code=exited, status=1/FAILURE)

Jun 25 10:38:58 ip-172-31-45-199 tor2web[17396]:     from tor2web.utils.daemon import set_pdeathsig, set_proctitle
Jun 25 10:38:58 ip-172-31-45-199 tor2web[17396]:   File "/usr/lib/python3.6/dist-packages/tor2web/utils/daemon.py", line 25, in <module>
Jun 25 10:38:58 ip-172-31-45-199 tor2web[17396]:     import ctypes
Jun 25 10:38:58 ip-172-31-45-199 tor2web[17396]:   File "/usr/lib/python3.6/ctypes/__init__.py", line 7, in <module>
Jun 25 10:38:58 ip-172-31-45-199 tor2web[17396]:     from _ctypes import Union, Structure, Array
Jun 25 10:38:58 ip-172-31-45-199 tor2web[17396]: ImportError: /usr/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so: failed to map segment from shared object
Jun 25 10:38:58 ip-172-31-45-199 tor2web[17396]:    ...fail!

I have tried installing on xenial as well as bionic and they both fail.

https://github.com/globaleaks/Tor2web/wiki/Installation-Guide#install-and-configure-tor2web seems to be quite outdated.

I want to help fix these issues, but I don't know how. Is there an Ubuntu version for which https://github.com/globaleaks/Tor2web/wiki/Installation-Guide#install-and-configure-tor2web just works out of the box? I would love to help clean up the wiki, and get this to a state where the resource on this repository are reliable. Please help me out here!

evilaliv3 commented 5 years ago

@arunasank: thank you for notifying this.

The repository is currently under maintainance, and the package will be re-released soon.

I'm currently away but will be back later.

If you can in the meantime could you make a summary of ally your findings?

evilaliv3 commented 5 years ago

@arunasank: would you please retry the install on ubuntu Bionic?

I just packaged it, it should work except for Apparmor that probably would need minor fixes.

If you could try:

thank you!

arunasank commented 5 years ago

Thank you so much @evilaliv3 β™₯️ Trying right away. I really appreciate the fast response time.

arunasank commented 5 years ago

@evilaliv3 Question - what issue does your package fix? When I try to install tor2web using the install-tor2web.sh script, I still get

Checking preliminary Tor2web requirements
 + apt-key requirement meet
 + apt-get requirement meet
Detected OS: Ubuntu - bionic
grep: Unmatched ( or \(
Adding GlobaLeaks PGP key to trusted APT keys
Running: "apt-key add /globaleaks_key"... SUCCESS
Running: "rm -f /globaleaks_key"... SUCCESS
Running: "apt-get update -y"... SUCCESS
Installing software-properties-common
Running: "apt-get install software-properties-common -y"... SUCCESS
Running: "apt-get update -y"... SUCCESS
Running: "apt-get install tor2web -y"... FAIL
Ouch! The installation failed.
COMBINED STDOUT/STDERR OUTPUT OF FAILED COMMAND:
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 tor2web : Depends: python3-twisted-core but it is not installable
E: Unable to correct problems, you have held broken packages.
arunasank commented 5 years ago

Are you able to help on IRC? I am on the #tor2web channel on OFTC.

arunasank commented 5 years ago

@evilaliv3 yep I re-ran the instructions from scratch on a machine reset to bionic and still see https://github.com/globaleaks/Tor2web/issues/356#issuecomment-505457470. Thanks for trying. If you have some time in the next few days, would love to get an hour or so of your's on IRC to help debug this. I will rewrite the wiki (or better, move it to a docs folder in the repository, so that it can be modified and PR-ed to) in return for your help. Thank you for helping maintain this awesome project!

evilaliv3 commented 5 years ago

@arunasank: Currently i've limited time i'm so sorry @arunasank; I will let you know as soon that i can.

I will immediately issue a package where to use python3-twisted instead of python3-twisted-code that do not exists.

will write here as soon that it is available.

vecna commented 5 years ago

also, FYI, the line https://github.com/globaleaks/Tor2web/blob/master/scripts/install.sh#L150 fails it you test with:

(venv) 20059 ۞  ~/Dev/tor2web  ༚1༚ echo "Codename:    bionic" | grep -vqE "^bionic"
(venv) 20060 ۞  ~/Dev/tor2web  ༚1༚ 

and the following grep also triggers an error (from the install script):

Detected OS: Ubuntu - bionic
grep: Unmatched ( or \(
arunasank commented 5 years ago

Update: I managed to set it up on a xenial machine. πŸŽ‰ πŸ’ƒ

I will write up the instructions for the same, since I had to do a great deal of gymnastics to install some python dependencies of the project. It still fails on bionic though. Thanks for everyone that replied here - even just an offer of help can make a difference to the motivations of a struggling dev. πŸ˜… @evilaliv3 let's do bionic install fixes whenever you manage to find the time - would love to improve the resources here.

evilaliv3 commented 5 years ago

@arunasank: with @vecna we should have now solved the package install with bionic.

You find out a package version 3.1.74!

arunasank commented 5 years ago

I can test this some time today and report back on whether it really works. Thanks good folks!

arunasank commented 5 years ago

Works on xenial. Still fails on bionic.

Good progress on bionic though, since the python dependencies and the packages themselves install fine. The tor2web systame process does not start though. There were still 3 octal errors I had to fix, and subsequently, I see this:

$ /home/tor2web/certs# /etc/init.d/tor2web restart
[....] Restarting tor2web (via systemctl): tor2web.serviceJob for tor2web.service failed because the control process exited with error code.
See "systemctl status tor2web.service" and "journalctl -xe" for details.
 failed!
root@ip-172-31-47-71:/home/tor2web/certs# systemctl status tor2web.service
● tor2web.service - LSB: Start the Tor2web proxy.
   Loaded: loaded (/etc/init.d/tor2web; generated)
   Active: failed (Result: exit-code) since Fri 2019-06-28 19:27:25 UTC; 2s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 32005 ExecStart=/etc/init.d/tor2web start (code=exited, status=1/FAILURE)

Jun 28 19:27:25 <ip> systemd[1]: Starting LSB: Start the Tor2web proxy....
Jun 28 19:27:25 <ip> tor2web[32005]:  * Starting Tor2web tor2web...
Jun 28 19:27:25 <ip> tor2web[32005]: Starting tor (via systemctl): tor.service.
Jun 28 19:27:25 <ip> tor2web[32005]:    ...fail!
Jun 28 19:27:25 <ip> systemd[1]: tor2web.service: Control process exited, code=exited status=1
Jun 28 19:27:25 <ip> systemd[1]: tor2web.service: Failed with result 'exit-code'.
Jun 28 19:27:25 <ip> systemd[1]: Failed to start LSB: Start the Tor2web proxy..

About the wiki - okay to move it into a folder containing markdown files within the repo?

evilaliv3 commented 5 years ago

@arunasank As for the current bionic package if you disable appartmor it will work like a charm. You have just to set: APPARMOR_SANDBOXING=0 in /etc/tor2web.conf Then if you want it would be grat if you could debug what is necessary to fix it with apparmor.

As for the wiki it is perfect to move it inside git; eventually we can think even to make it on docs.tor2web.org using readthedocs if you want to manage this change but this is probably a big one and we can just start of muving it to the repo and improve it by pull requests. what do you think?

arunasank commented 5 years ago

As for the current bionic package if you disable appartmor it will work like a charm. You have just to set: APPARMOR_SANDBOXING=0 in /etc/tor2web.conf Then if you want it would be grat if you could debug what is necessary to fix it with apparmor.

@evilaliv3 The error pasted above is after disabling APPARMOR actually.

As for the wiki it is perfect to move it inside git; eventually we can think even to make it on docs.tor2web.org using readthedocs if you want to manage this change but this is probably a big one and we can just start of muving it to the repo and improve it by pull requests. what do you think?

Sounds good! : ) I can help fix this. I want more people to use the project!

arunasank commented 5 years ago

Was the xenial package changed or updated recently? Because tor2web is broken on xenial again. πŸ™ˆ

evilaliv3 commented 5 years ago

@arunasank: do you have any progress? do you have any patch to share in relation to make it work on ubuntu bionic?

with @jbash we are considering as well to bump Tor2web to use Onion Services V3 (https://github.com/globaleaks/Tor2web/issues/353); have you considered them in your work? Do you have by the chance already a patch for this that you would like to share?

evilaliv3 commented 5 years ago

This should be solved @arunasank!

p.s.: check https://twitter.com/evilaliv3z/status/1179030986702643205 !