DanWin / hosting

This is a setup for a Tor based shared web hosting server
https://danwin1210.de/hosting/
GNU General Public License v3.0
341 stars 126 forks source link

Some sites display as 0xF0 error #136

Open phinwww opened 2 months ago

phinwww commented 2 months ago

Hi,

When already registered users try to make new onions, the following happens when you access the onionsite:

Onionsite Not Found

Details: 0xF0 — The requested onion service descriptor can't be found on the hashring and therefore the service is not reachable by the client.

The server which I'm running this on is running Debian 12

DanWin commented 2 months ago

Hello @phinwww ,

this would indicate that the tor instance this hidden service was added to is either not running, or hasn't published the hidden service. Check the logs of your tor instance for any error messages with journalctl -u tor@a.service (replace a with the name of the instance it is running on) It may also be that you've hit a limit of hidden services in one instance. Depending on your hardware there may be different limits, but in my experience around 250 hidden services per tor instance were the magic number where tor started failing. You may need to add additional instances if you are hitting this limit: https://github.com/DanWin/hosting/blob/master/var/www/common.php#L28

phinwww commented 2 months ago

How do I check the instance a certain site is running on?

phinwww commented 2 months ago

For some of the instances like tor@d.service I get this:

Apr 21 02:32:43 onions.tsutaja.com Tor-d[1153]: Tor has been idle for 3600 seconds; assuming established circuits no longer work. Apr 21 03:32:43 onions.tsutaja.com Tor-d[1153]: Tor has been idle for 3600 seconds; assuming established circuits no longer work. Apr 21 04:32:30 onions.tsutaja.com Tor-d[1153]: Heartbeat: Tor's uptime is 2 days 12:30 hours, with 0 circuits open. I've sent 123.58 MB and received 142.02 MB. I've received 0 connections on IPv4 and 0 on IPv6. I've made > Apr 21 04:32:30 onions.tsutaja.com Tor-d[1153]: While bootstrapping, fetched this many bytes: 213369 (microdescriptor fetch) Apr 21 04:32:30 onions.tsutaja.com Tor-d[1153]: While not bootstrapping, fetched this many bytes: 777294 (consensus network-status fetch); 14327 (microdescriptor fetch) Apr 21 05:32:43 onions.tsutaja.com Tor-d[1153]: Tor has been idle for 3600 seconds; assuming established circuits no longer work. Apr 21 06:32:43 onions.tsutaja.com Tor-d[1153]: Tor has been idle for 3600 seconds; assuming established circuits no longer work. Apr 21 07:32:43 onions.tsutaja.com Tor-d[1153]: Tor has been idle for 3600 seconds; assuming established circuits no longer work. Apr 21 08:32:43 onions.tsutaja.com Tor-d[1153]: Tor has been idle for 3600 seconds; assuming established circuits no longer work. Apr 21 09:32:44 onions.tsutaja.com Tor-d[1153]: Tor has been idle for 3601 seconds; assuming established circuits no longer work.

phinwww commented 2 months ago

Looks like some instances don't bootstrap...

Instance D:

Apr 21 09:38:42 onions.tsutaja.com systemd[1]: Starting tor@d.service - Anonymizing overlay network for TCP (instance d)... Apr 21 09:38:42 onions.tsutaja.com sed[928]: DataDirectory /var/lib/tor-instances/d Apr 21 09:38:42 onions.tsutaja.com sed[928]: PidFile /run/tor-instances/d/tor.pid Apr 21 09:38:42 onions.tsutaja.com sed[928]: RunAsDaemon 0 Apr 21 09:38:42 onions.tsutaja.com sed[928]: User _tor-d Apr 21 09:38:42 onions.tsutaja.com sed[928]: SyslogIdentityTag d Apr 21 09:38:42 onions.tsutaja.com sed[928]: ControlSocket /run/tor-instances/d/control GroupWritable RelaxDirModeCheck Apr 21 09:38:42 onions.tsutaja.com sed[928]: SocksPort unix:/run/tor-instances/d/socks WorldWritable Apr 21 09:38:42 onions.tsutaja.com sed[928]: CookieAuthentication 1 Apr 21 09:38:42 onions.tsutaja.com sed[928]: CookieAuthFileGroupReadable 1 Apr 21 09:38:42 onions.tsutaja.com sed[928]: CookieAuthFile /run/tor-instances/d/control.authcookie Apr 21 09:38:42 onions.tsutaja.com sed[928]: Log notice syslog Apr 21 09:38:42 onions.tsutaja.com tor[1061]: Apr 21 09:38:42.749 [notice] Tor 0.4.8.10 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.11, Zlib 1.2.13, Liblzma 5.4.1, Libzstd 1.5.4 and Glibc 2.36 as libc. Apr 21 09:38:42 onions.tsutaja.com tor[1061]: Apr 21 09:38:42.749 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/ Apr 21 09:38:42 onions.tsutaja.com tor[1061]: Apr 21 09:38:42.749 [notice] Read configuration file "/run/tor-instances/d.defaults". Apr 21 09:38:42 onions.tsutaja.com tor[1061]: Apr 21 09:38:42.749 [notice] Read configuration file "/etc/tor/instances/d/torrc". Apr 21 09:38:42 onions.tsutaja.com tor[1061]: Configuration was valid Apr 21 09:38:43 onions.tsutaja.com tor[1147]: Apr 21 09:38:43.639 [notice] Tor 0.4.8.10 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.11, Zlib 1.2.13, Liblzma 5.4.1, Libzstd 1.5.4 and Glibc 2.36 as libc. Apr 21 09:38:43 onions.tsutaja.com tor[1147]: Apr 21 09:38:43.639 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/ Apr 21 09:38:43 onions.tsutaja.com tor[1147]: Apr 21 09:38:43.639 [notice] Read configuration file "/run/tor-instances/d.defaults". Apr 21 09:38:43 onions.tsutaja.com tor[1147]: Apr 21 09:38:43.639 [notice] Read configuration file "/etc/tor/instances/d/torrc". Apr 21 09:38:43 onions.tsutaja.com Tor-d[1147]: We compiled with OpenSSL 300000b0: OpenSSL 3.0.11 19 Sep 2023 and we are running with OpenSSL 300000b0: 3.0.11. These two versions should be binary compatible. Apr 21 09:38:43 onions.tsutaja.com Tor-d[1147]: Tor 0.4.8.10 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.11, Zlib 1.2.13, Liblzma 5.4.1, Libzstd 1.5.4 and Glibc 2.36 as libc. Apr 21 09:38:43 onions.tsutaja.com Tor-d[1147]: Tor can't help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/ Apr 21 09:38:43 onions.tsutaja.com Tor-d[1147]: Read configuration file "/run/tor-instances/d.defaults". Apr 21 09:38:43 onions.tsutaja.com Tor-d[1147]: Read configuration file "/etc/tor/instances/d/torrc". Apr 21 09:38:43 onions.tsutaja.com Tor-d[1147]: Bootstrapped 0% (starting): Starting Apr 21 09:38:45 onions.tsutaja.com Tor-d[1147]: Starting with guard context "default" Apr 21 09:38:45 onions.tsutaja.com Tor-d[1147]: Signaled readiness to systemd Apr 21 09:38:45 onions.tsutaja.com systemd[1]: Started tor@d.service - Anonymizing overlay network for TCP (instance d).

Instance E:

Apr 21 09:38:42 onions.tsutaja.com systemd[1]: Starting tor@e.service - Anonymizing overlay network for TCP (instance e)... Apr 21 09:38:42 onions.tsutaja.com sed[1005]: DataDirectory /var/lib/tor-instances/e Apr 21 09:38:42 onions.tsutaja.com sed[1005]: PidFile /run/tor-instances/e/tor.pid Apr 21 09:38:42 onions.tsutaja.com sed[1005]: RunAsDaemon 0 Apr 21 09:38:42 onions.tsutaja.com sed[1005]: User _tor-e Apr 21 09:38:42 onions.tsutaja.com sed[1005]: SyslogIdentityTag e Apr 21 09:38:42 onions.tsutaja.com sed[1005]: ControlSocket /run/tor-instances/e/control GroupWritable RelaxDirModeCheck Apr 21 09:38:42 onions.tsutaja.com sed[1005]: SocksPort unix:/run/tor-instances/e/socks WorldWritable Apr 21 09:38:42 onions.tsutaja.com sed[1005]: CookieAuthentication 1 Apr 21 09:38:42 onions.tsutaja.com sed[1005]: CookieAuthFileGroupReadable 1 Apr 21 09:38:42 onions.tsutaja.com sed[1005]: CookieAuthFile /run/tor-instances/e/control.authcookie Apr 21 09:38:42 onions.tsutaja.com sed[1005]: Log notice syslog Apr 21 09:38:42 onions.tsutaja.com tor[1130]: Apr 21 09:38:42.809 [notice] Tor 0.4.8.10 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.11, Zlib 1.2.13, Liblzma 5.4.1, Libzstd 1.5.4 and Glibc 2.36 as libc. Apr 21 09:38:42 onions.tsutaja.com tor[1130]: Apr 21 09:38:42.809 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/ Apr 21 09:38:42 onions.tsutaja.com tor[1130]: Apr 21 09:38:42.810 [notice] Read configuration file "/run/tor-instances/e.defaults". Apr 21 09:38:42 onions.tsutaja.com tor[1130]: Apr 21 09:38:42.810 [notice] Read configuration file "/etc/tor/instances/e/torrc". Apr 21 09:38:42 onions.tsutaja.com tor[1130]: Configuration was valid Apr 21 09:38:43 onions.tsutaja.com tor[1150]: Apr 21 09:38:43.762 [notice] Tor 0.4.8.10 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.11, Zlib 1.2.13, Liblzma 5.4.1, Libzstd 1.5.4 and Glibc 2.36 as libc. Apr 21 09:38:43 onions.tsutaja.com tor[1150]: Apr 21 09:38:43.762 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/ Apr 21 09:38:43 onions.tsutaja.com tor[1150]: Apr 21 09:38:43.762 [notice] Read configuration file "/run/tor-instances/e.defaults". Apr 21 09:38:43 onions.tsutaja.com tor[1150]: Apr 21 09:38:43.762 [notice] Read configuration file "/etc/tor/instances/e/torrc". Apr 21 09:38:43 onions.tsutaja.com Tor-e[1150]: We compiled with OpenSSL 300000b0: OpenSSL 3.0.11 19 Sep 2023 and we are running with OpenSSL 300000b0: 3.0.11. These two versions should be binary compatible. Apr 21 09:38:43 onions.tsutaja.com Tor-e[1150]: Tor 0.4.8.10 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.11, Zlib 1.2.13, Liblzma 5.4.1, Libzstd 1.5.4 and Glibc 2.36 as libc. Apr 21 09:38:43 onions.tsutaja.com Tor-e[1150]: Tor can't help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/ Apr 21 09:38:43 onions.tsutaja.com Tor-e[1150]: Read configuration file "/run/tor-instances/e.defaults". Apr 21 09:38:43 onions.tsutaja.com Tor-e[1150]: Read configuration file "/etc/tor/instances/e/torrc". Apr 21 09:38:44 onions.tsutaja.com Tor-e[1150]: Bootstrapped 0% (starting): Starting Apr 21 09:38:46 onions.tsutaja.com Tor-e[1150]: The current consensus has no exit nodes. Tor can only build internal paths, such as paths to onion services. Apr 21 09:38:46 onions.tsutaja.com Tor-e[1150]: Starting with guard context "default" Apr 21 09:38:46 onions.tsutaja.com Tor-e[1150]: Signaled readiness to systemd Apr 21 09:38:46 onions.tsutaja.com systemd[1]: Started tor@e.service - Anonymizing overlay network for TCP (instance e). Apr 21 09:38:46 onions.tsutaja.com Tor-e[1150]: Bootstrapped 5% (conn): Connecting to a relay Apr 21 09:38:46 onions.tsutaja.com Tor-e[1150]: Bootstrapped 10% (conn_done): Connected to a relay Apr 21 09:38:46 onions.tsutaja.com Tor-e[1150]: Bootstrapped 14% (handshake): Handshaking with a relay Apr 21 09:38:46 onions.tsutaja.com Tor-e[1150]: Bootstrapped 15% (handshake_done): Handshake with a relay done Apr 21 09:38:46 onions.tsutaja.com Tor-e[1150]: Bootstrapped 45% (requesting_descriptors): Asking for relay descriptors Apr 21 09:38:47 onions.tsutaja.com Tor-e[1150]: Bootstrapped 50% (loading_descriptors): Loading relay descriptors Apr 21 09:38:47 onions.tsutaja.com Tor-e[1150]: Opening Control listener on /run/tor-instances/e/control Apr 21 09:38:47 onions.tsutaja.com Tor-e[1150]: Opened Control listener connection (ready) on /run/tor-instances/e/control Apr 21 09:38:48 onions.tsutaja.com Tor-e[1150]: The current consensus contains exit nodes. Tor can build exit and internal paths. Apr 21 09:38:49 onions.tsutaja.com Tor-e[1150]: Bootstrapped 55% (loading_descriptors): Loading relay descriptors Apr 21 09:38:49 onions.tsutaja.com Tor-e[1150]: Bootstrapped 62% (loading_descriptors): Loading relay descriptors Apr 21 09:38:50 onions.tsutaja.com Tor-e[1150]: Bootstrapped 70% (loading_descriptors): Loading relay descriptors Apr 21 09:38:51 onions.tsutaja.com Tor-e[1150]: Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits Apr 21 09:38:51 onions.tsutaja.com Tor-e[1150]: Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits Apr 21 09:38:51 onions.tsutaja.com Tor-e[1150]: Bootstrapped 95% (circuit_create): Establishing a Tor circuit Apr 21 09:38:52 onions.tsutaja.com Tor-e[1150]: Bootstrapped 100% (done): Done

DanWin commented 2 months ago

How do I check the instance a certain site is running on?

You can query this in the mysql database:

 USE hosting;
 SELECT instance FROM onions WHERE onion=?;

When bootstrap is stuck, I would recommend to shut down given instance and delete stale files. Usually this would resolve it.

systemctl stop tor@d.service && rm /var/lib/tor-instances/d/cached-* /var/lib/tor-instances/d/state && systemctl start tor@d.service

Looking at the bandwidth statistics of tor@d it looks like almost no traffic is on your service. This may be because this instance had some problem, or because you do not have so many sites hosted. If you have a small number of sites on your server, you may only need one or two instances.

phinwww commented 2 months ago

Thanks! That helps a lot

phinwww commented 2 months ago

Closing, this helped resolve the issue. Thanks!

phinwww commented 2 months ago

now i’m getting an error when creating new onions, logs say that the public key for the service isn’t found and then when i try to access it by link it’s a 0xF0 error