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

tor2web installation struggles on bionic #356

Closed
arunasank opened this issue Jun 24, 2019 · 23 comments
Closed

tor2web installation struggles on bionic #356

arunasank opened this issue Jun 24, 2019 · 23 comments

Comments

@arunasank
Copy link

$ 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
Copy link

ahmed-abdelazim commented Jun 24, 2019 via email

@arunasank
Copy link
Author

So, how do I install tor2web?

@ahmed-abdelazim
Copy link

ahmed-abdelazim commented Jun 24, 2019 via email

@arunasank
Copy link
Author

👍 oh ok! Is it available on another ubuntu distribution? Like xenial - do you know?

@ahmed-abdelazim
Copy link

ahmed-abdelazim commented Jun 24, 2019 via email

@arunasank
Copy link
Author

arunasank commented Jun 25, 2019

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!

@arunasank arunasank changed the title tor2web package not found tor2web installation struggles Jun 25, 2019
@evilaliv3
Copy link
Contributor

evilaliv3 commented Jun 25, 2019

@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
Copy link
Contributor

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

  • try to run it with apparmor disabled (APPARMOR_SANDBOXING=0 in /etc/tor2web.conf)
  • try to run it with apparmor enabled (APPARMOR_SANDBOXING=1 in /etc/tor2web.conf)

thank you!

@arunasank
Copy link
Author

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

@arunasank
Copy link
Author

@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
Copy link
Author

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

@arunasank
Copy link
Author

arunasank commented Jun 25, 2019

@evilaliv3 yep I re-ran the instructions from scratch on a machine reset to bionic and still see #356 (comment). 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
Copy link
Contributor

@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
Copy link
Contributor

vecna commented Jun 25, 2019

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 \(

@vecna vecna mentioned this issue Jun 25, 2019
@arunasank
Copy link
Author

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
Copy link
Contributor

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

You find out a package version 3.1.74!

@arunasank
Copy link
Author

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

@arunasank
Copy link
Author

arunasank commented Jun 28, 2019

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
Copy link
Contributor

evilaliv3 commented Jun 28, 2019

@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
Copy link
Author

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 arunasank changed the title tor2web installation struggles tor2web installation struggles on bionic Jun 28, 2019
@arunasank
Copy link
Author

Was the xenial package changed or updated recently? Because tor2web is broken on xenial again. 🙈

@evilaliv3
Copy link
Contributor

evilaliv3 commented Sep 28, 2019

@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 (#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
Copy link
Contributor

This should be solved @arunasank!

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants