LINUX.ORG.RU

не стартует tor2web

 


0

1

OS DEBIAN9

/etc/tor2web.conf

# Tor2web configuration file
[main]

# Unique nodename identifier
# nodename = [UNIQUE_IDENTIFIER]

# Path to Tor2web data directory
datadir = /home/tor2web

# Debug and logging
logreqs = True
debugmode = True
debugtostdout = True

# Processes (suggested number of cores + 1)
processes = 4
requests_per_process = 100000

# Ip addresses and ports
transport = BOTH
listen_ipv4 = [LISTENING_IPV4_ADDRESS]
listen_ipv6 = [LISTENING_IPV6_ADDRESS]
listen_port_http = 80
listen_port_https = 443

# This is the base hostname for the current tor2web node
# basehost = AUTO

# This is the SOCKS host and port on which Tor is listening
sockshost = 127.0.0.1
socksport = 9050
# socksoptimisticdata = True
# sockmaxpersistentperhost = 5
# sockcachedconnectiontimeout = 240
# sockretryautomatically = True

# SSL configuration
ssl_key = /home/tor2web/certs/tor2web-key.pem
ssl_cert = /home/tor2web/certs/tor2web-cert.pem

# BE SURE TO CONFIGURE THE INTERMEDIATE CA OR YOUR WEB BROWSER WILL RESPOND
# WITH VERY LOUD WARNINGS AND ERRORS
# ssl_intermediate = /home/tor2web/certs/tor2web-intermediate.pem
# TO GENERATE DH Parameters:
#    $ cd /home/tor2web/certs/
#    $ openssl dhparam -out tor2web-dh.pem 2048

ssl_dh = /home/tor2web/certs/tor2web-dh.pem
cipher_list = ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:DHE-DSS-AES256-SHA:DHE-RSA-AES128-SHA
ssl_tofu_cache_size = 100

# Access Blocking
mode = TRANSLATION
onion = my_address.onion
# blockhotlinking = True
# blockhotlinking_exts = [jpg, png, gif]


# Add special HTTP headers
# This option makes it possible to add headers to responses sent to clients.
# Do NOT use this unless you are positive you need it.
# extra_HTTP_headers_to_response = [ 'Cache-Control: max-age=600', 'Surrogate-Control: max-age=86400' ]

# Disable the automagical redirect of Tor user on Tor HSs
# disable_tor_redirection = False

# If set to True will disable the tor2web disclaimer
# disable_disclaimer = False

# If set to True will disable the tor2web banner
# disable_banner = False

# If set to True will avoid rewriting visible data (experimental; will result
# in less functional proxy) Could be useful in relation to DMCA for US law only
# avoid_rewriting_visible_content = True

# Mail configuration for automatic exception and user abuse notifications
# smtpuser = [USERNAME]
# smtppass = [PASSWORD]
# smtpmail = [EMAIL]
# smtpmailto_exceptions = [EMAIL_FOR_ABUSES_EXCEPTIONS]
# smtpmailto_notifications = [EMAIL_FOR_ABUSES_NOTIFICATION]
# smtpdomain = [DOMAIN]
# smtpport = [PORT]

# Exit nodes list refresh period (in seconds)
exit_node_list_refresh = 600

# Enables the automatic fetching of the hashed blocklist
# automatic_blocklist_updates_source = https://ahmia.fi/bannedMD5.txt
# automatic_blocklist_updates_refresh = 600
# automatic_blocklist_updates_mode = MERGE

# This publishes blocklist which will be available at::/antanistaticmap/lists/blocklist
# publish_blocklist = False

# List of mirrors shown in Tor2web disclaimer and banner
# An updated list of know mirrors can be found at: https://github.com/globaleaks/tor2web/wiki
# mirror = [tor2web.org, mirror2.tld, mirror3.tld, ...]

# This allows Tor2web to make use of a simple TCP proxies
# dummyproxy = https://127.0.0.1:8080

systemctl status tor2web.service

● tor2web.service - LSB: Start the Tor2web proxy.
   Loaded: loaded (/etc/init.d/tor2web; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-01-10 11:10:36 MSK; 6min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 16783 ExecStart=/etc/init.d/tor2web start (code=exited, status=1/FAILURE)
sudo journalctl -xe
Unit tor2web.service has begun starting up.
Jan 10 11:22:41 server.domain.com tor2web[16966]: WARNING: Missing Apparmor Sandboxing support
Jan 10 11:22:41 server.domain.com tor2web[16966]: Starting Tor2web tor2web...Starting tor (via
Jan 10 11:22:41 server.domain.com tor2web[16966]: Traceback (most recent call last):
Jan 10 11:22:41 server.domain.com tor2web[16966]:   File "/usr/lib/python3/dist-packages/tor2w
Jan 10 11:22:41 server.domain.com tor2web[16966]:     from tor2web.utils.mail import sendmail,
Jan 10 11:22:41 server.domain.com tor2web[16966]:   File "/usr/lib/python3/dist-packages/tor2w
Jan 10 11:22:41 server.domain.com tor2web[16966]:     from twisted.mail.smtp import ESMTPSende
Jan 10 11:22:41 server.domain.com tor2web[16966]: ImportError: No module named 'twisted.mail.s
Jan 10 11:22:42 server.domain.com tor2web[16966]: Traceback (most recent call last):
Jan 10 11:22:42 server.domain.com tor2web[16966]:   File "/usr/lib/python3/dist-packages/tor2w
Jan 10 11:22:42 server.domain.com tor2web[16966]:     from tor2web.utils.mail import sendmail,
Jan 10 11:22:42 server.domain.com tor2web[16966]:   File "/usr/lib/python3/dist-packages/tor2w
Jan 10 11:22:42 server.domain.com tor2web[16966]:     from twisted.mail.smtp import ESMTPSende
Jan 10 11:22:42 server.domain.com tor2web[16966]: ImportError: No module named 'twisted.mail.s
Jan 10 11:22:42 server.domain.com tor2web[16966]:  failed!
Jan 10 11:22:42 server.domain.com systemd[1]: tor2web.service: Control process exited, code=ex
Jan 10 11:22:42 server.domain.com systemd[1]: Failed to start LSB: Start the Tor2web proxy..
-- Subject: Unit tor2web.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit tor2web.service has failed.
--
-- The result is failed.
Jan 10 11:22:42 server.domain.com polkitd(authority=local)[14971]: Unregistered Authentication
Jan 10 11:22:42 server.domain.com systemd[1]: tor2web.service: Unit entered failed state.
Jan 10 11:22:42 server.domain.com systemd[1]: tor2web.service: Failed with result 'exit-code'.
Jan 10 11:22:55 server.domain.com sshd[17032]: Did not receive identification string from 222.
Jan 10 11:22:55 server.domain.com sudo[17033]:  tor2web : TTY=pts/0 ; PWD=/home/tor2web ; USER
Jan 10 11:22:55 server.domain.com sudo[17033]: pam_unix(sudo:session): session opened for user
lines 1685-1716/1716 (END)

https://pypi.org/simple/twisted-mail-smtp/ - 404

Ответ на: комментарий от mky

Поставил python-twisted-mail, это не помогло.

sudo systemctl status tor2web.service
● tor2web.service - LSB: Start the Tor2web proxy.
   Loaded: loaded (/etc/init.d/tor2web; generated; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sun 2020-01-12 17:48:45 MSK; 17s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 15307 ExecStart=/etc/init.d/tor2web start (code=exited, status=1/FAILURE)

Jan 12 17:48:45 server.domain.com tor2web[15307]:   File "/usr/lib/python3/dist-packages/tor2web/t2w.py", line 63, in <module>
Jan 12 17:48:45 server.domain.com tor2web[15307]:     from tor2web.utils.mail import sendmail, MailExceptionHooker
Jan 12 17:48:45 server.domain.com tor2web[15307]:   File "/usr/lib/python3/dist-packages/tor2web/utils/mail.py", line 24, in <module>
Jan 12 17:48:45 server.domain.com tor2web[15307]:     from twisted.mail.smtp import ESMTPSenderFactory
Jan 12 17:48:45 server.domain.com tor2web[15307]: ImportError: No module named 'twisted.mail.smtp'
Jan 12 17:48:45 server.domain.com tor2web[15307]:  failed!
Jan 12 17:48:45 server.domain.com systemd[1]: tor2web.service: Control process exited, code=exited status=1
Jan 12 17:48:45 server.domain.com systemd[1]: Failed to start LSB: Start the Tor2web proxy..
Jan 12 17:48:45 server.domain.com systemd[1]: tor2web.service: Unit entered failed state.
Jan 12 17:48:45 server.domain.com systemd[1]: tor2web.service: Failed with result 'exit-code'.
sudo journalctl -xe
-- Unit user@1001.service has finished starting up.
--
-- The start-up result is done.
Jan 12 17:47:23 server.domain.com sshd[14807]: Failed password for root from 218.92.0.178 port 20892 ssh2
Jan 12 17:47:53 server.domain.com sudo[14882]:  tor2web : TTY=pts/0 ; PWD=/home/tor2web ; USER=root ; COMMAND=/usr/bin/apt install python-twisted-mail
Jan 12 17:47:53 server.domain.com sudo[14882]: pam_unix(sudo:session): session opened for user root by tor2web(uid=0)
Jan 12 17:48:00 server.domain.com sudo[14882]: pam_unix(sudo:session): session closed for user root
Jan 12 17:48:32 server.domain.com polkitd(authority=local)[5112]: Registered Authentication Agent for unix-process:15298:7344720 (system bus name :1.41 [/usr/bi
Jan 12 17:48:44 server.domain.com polkitd(authority=local)[5112]: Operator of unix-process:15298:7344720 successfully authenticated as unix-user:tor2web to gain
Jan 12 17:48:44 server.domain.com systemd[1]: Starting LSB: Start the Tor2web proxy....
-- Subject: Unit tor2web.service has begun start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit tor2web.service has begun starting up.
Jan 12 17:48:44 server.domain.com tor2web[15307]: WARNING: Missing Apparmor Sandboxing support
Jan 12 17:48:44 server.domain.com tor2web[15307]: Starting Tor2web tor2web...Starting tor (via systemctl): tor.service.
Jan 12 17:48:45 server.domain.com tor2web[15307]: Traceback (most recent call last):
Jan 12 17:48:45 server.domain.com tor2web[15307]:   File "/usr/lib/python3/dist-packages/tor2web/t2w.py", line 63, in <module>
Jan 12 17:48:45 server.domain.com tor2web[15307]:     from tor2web.utils.mail import sendmail, MailExceptionHooker
Jan 12 17:48:45 server.domain.com tor2web[15307]:   File "/usr/lib/python3/dist-packages/tor2web/utils/mail.py", line 24, in <module>
Jan 12 17:48:45 server.domain.com tor2web[15307]:     from twisted.mail.smtp import ESMTPSenderFactory
Jan 12 17:48:45 server.domain.com tor2web[15307]: ImportError: No module named 'twisted.mail.smtp'
Jan 12 17:48:45 server.domain.com tor2web[15307]: Traceback (most recent call last):
Jan 12 17:48:45 server.domain.com tor2web[15307]:   File "/usr/lib/python3/dist-packages/tor2web/t2w.py", line 63, in <module>
Jan 12 17:48:45 server.domain.com tor2web[15307]:     from tor2web.utils.mail import sendmail, MailExceptionHooker
Jan 12 17:48:45 server.domain.com tor2web[15307]:   File "/usr/lib/python3/dist-packages/tor2web/utils/mail.py", line 24, in <module>
Jan 12 17:48:45 server.domain.com tor2web[15307]:     from twisted.mail.smtp import ESMTPSenderFactory
Jan 12 17:48:45 server.domain.com tor2web[15307]: ImportError: No module named 'twisted.mail.smtp'
Jan 12 17:48:45 server.domain.com tor2web[15307]:  failed!
Jan 12 17:48:45 server.domain.com systemd[1]: tor2web.service: Control process exited, code=exited status=1
Jan 12 17:48:45 server.domain.com systemd[1]: Failed to start LSB: Start the Tor2web proxy..
-- Subject: Unit tor2web.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit tor2web.service has failed.
--
-- The result is failed.
Jan 12 17:48:45 server.domain.com systemd[1]: tor2web.service: Unit entered failed state.
Jan 12 17:48:45 server.domain.com systemd[1]: tor2web.service: Failed with result 'exit-code'.
Jan 12 17:48:45 server.domain.com polkitd(authority=local)[5112]: Unregistered Authentication Agent for unix-process:15298:7344720 (system bus name :1.41, objec
Jan 12 17:49:03 server.domain.com sudo[15348]:  tor2web : TTY=pts/0 ; PWD=/home/tor2web ; USER=root ; COMMAND=/bin/systemctl status tor2web.service
Jan 12 17:49:03 server.domain.com sudo[15348]: pam_unix(sudo:session): session opened for user root by tor2web(uid=0)
Jan 12 17:49:03 server.domain.com sudo[15348]: pam_unix(sudo:session): session closed for user root
Jan 12 17:49:28 server.domain.com sudo[15351]:  tor2web : TTY=pts/0 ; PWD=/home/tor2web ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 12 17:49:28 server.domain.com sudo[15351]: pam_unix(sudo:session): session opened for user root by tor2web(uid=0)
lines 1077-1123/1123 (END)

Есть идеи? Не знаю что такое LSB, и почему не стартует.

yoholo ()
Ответ на: комментарий от yoholo

Ну попробуйте https://packages.debian.org/ru/stretch-backports/python-twisted-mail

tor2web откуда брали? Они вроде только ubuntu bionic и debian buster поддерживают (судя по этому: https://github.com/globaleaks/Tor2web/tree/master/requirements ).

Не знаю что такое LSB

Linux Standard Base. В числе прочего описывает заголовок init-скрипта. В данном случае означает, что юнит systemd был сгенерирован автоматически из init-скрипта.

mky ★★★★★ ()
Ответ на: комментарий от mky

Поменял на ubuntu 10. Лучше не стало.
sudo journalctl -xe

sudo: unable to resolve host server.domain
Jan 13 19:19:16 server.domain sudo[2230]:  tor2web : unable to resolve host server.domain
Jan 13 19:19:16 server.domain sudo[2230]:  tor2web : problem with defaults entries ; TTY=pts/0 ; PWD=/home/tor2web ; USER=root ;
Jan 13 19:19:20 server.domain sshd[2251]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=59.4.107.29  user=root
Jan 13 19:19:23 server.domain sshd[2251]: Failed password for root from 59.4.107.29 port 59366 ssh2
Jan 13 19:19:23 server.domain sshd[2251]: Received disconnect from 59.4.107.29 port 59366:11: Bye Bye [preauth]
Jan 13 19:19:23 server.domain sshd[2251]: Disconnected from authenticating user root 59.4.107.29 port 59366 [preauth]
Jan 13 19:19:28 server.domain sudo[2230]:  tor2web : TTY=pts/0 ; PWD=/home/tor2web ; USER=root ; COMMAND=/etc/init.d/tor2web start
Jan 13 19:19:28 server.domain sudo[2230]: pam_unix(sudo:session): session opened for user root by tor2web(uid=0)
Jan 13 19:19:28 server.domain systemd[1]: Starting LSB: Start the Tor2web proxy....
-- Subject: Unit tor2web.service has begun start-up
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit tor2web.service has begun starting up.
Jan 13 19:19:28 server.domain tor2web[2274]:  * Starting Tor2web tor2web...
Jan 13 19:19:28 server.domain tor2web[2274]: Starting tor (via systemctl): tor.service.
Jan 13 19:19:28 server.domain audit[2311]: AVC apparmor="DENIED" operation="open" profile="usr.bin.tor2web" name="/etc/ssl/openssl.cnf" pid=2311 comm="python3"
Jan 13 19:19:28 server.domain kernel: kauditd_printk_skb: 7 callbacks suppressed
Jan 13 19:19:28 server.domain kernel: audit: type=1400 audit(1578932368.868:18): apparmor="DENIED" operation="open" profile="usr.bin.tor2web" name="/etc/ssl/ope
Jan 13 19:19:29 server.domain audit[2326]: AVC apparmor="DENIED" operation="open" profile="usr.bin.tor2web" name="/etc/ssl/openssl.cnf" pid=2326 comm="python3"
Jan 13 19:19:29 server.domain kernel: audit: type=1400 audit(1578932369.432:19): apparmor="DENIED" operation="open" profile="usr.bin.tor2web" name="/etc/ssl/ope
Jan 13 19:19:29 server.domain audit[2326]: AVC apparmor="DENIED" operation="open" profile="usr.bin.tor2web" name="/usr/share/tor2web/data/lists/crawlers.txt" pi
Jan 13 19:19:29 server.domain kernel: audit: type=1400 audit(1578932369.740:20): apparmor="DENIED" operation="open" profile="usr.bin.tor2web" name="/usr/share/t
Jan 13 19:19:29 server.domain tor2web[2274]: Tor2web Startup Failure: error while binding on :: 80 ([Errno 98] Address already in use)
Jan 13 19:19:29 server.domain tor2web[2274]:    ...fail!
Jan 13 19:19:29 server.domain systemd[1]: tor2web.service: Control process exited, code=exited status=1
Jan 13 19:19:29 server.domain systemd[1]: tor2web.service: Failed with result 'exit-code'.
Jan 13 19:19:29 server.domain systemd[1]: Failed to start LSB: Start the Tor2web proxy..
-- Subject: Unit tor2web.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- Unit tor2web.service has failed.
--
-- The result is RESULT.
Jan 13 19:19:29 server.domain sudo[2230]: pam_unix(sudo:session): session closed for user root
Jan 13 19:19:34 server.domain kernel: random: crng init done
Jan 13 19:19:38 server.domain sshd[2363]: Invalid user guest from 138.197.98.251 port 54042
Jan 13 19:19:38 server.domain sshd[2363]: pam_unix(sshd:auth): check pass; user unknown
Jan 13 19:19:38 server.domain sshd[2363]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=138.197.98.251
Jan 13 19:19:40 server.domain sshd[2363]: Failed password for invalid user guest from 138.197.98.251 port 54042 ssh2
Jan 13 19:19:40 server.domain sshd[2363]: Received disconnect from 138.197.98.251 port 54042:11: Bye Bye [preauth]
Jan 13 19:19:40 server.domain sshd[2363]: Disconnected from invalid user guest 138.197.98.251 port 54042 [preauth]
Jan 13 19:19:42 server.domain sudo[2365]:  tor2web : unable to resolve host server.domain
Jan 13 19:19:42 server.domain sudo[2365]:  tor2web : problem with defaults entries ; TTY=pts/0 ; PWD=/home/tor2web ; USER=root ;
Jan 13 19:19:42 server.domain sudo[2365]:  tor2web : TTY=pts/0 ; PWD=/home/tor2web ; USER=root ; COMMAND=/bin/journalctl -xe
Jan 13 19:19:42 server.domain sudo[2365]: pam_unix(sudo:session): session opened for user root by tor2web(uid=0)

Все еще

Failed to start LSB: Start the Tor2web proxy..

Зачем оно пытается резолвить server.domain теряюсь в догадках.

Jan 13 19:19:16 server.domain sudo[2230]:  tor2web : unable to resolve host server.domain
Jan 13 19:19:16 server.domain sudo[2230]:  tor2web : problem with defaults entries ; TTY=pts/0 ; PWD=/home/tor2web ; USER=root ;
yoholo ()
Ответ на: комментарий от yoholo

Tor2web Startup Failure: error while binding on :: 80 ([Errno 98] Address already in use)

у тебя на 80 порту висит какой-то другой сервис. Кури конфиг tor2web или определись с задачей, которую пытаешься решить.

leave ★★★★★ ()
Ответ на: комментарий от yoholo

Не надо менять порты, попробуй для начала

systemctl stop apparmor

Потом перезапусти tor2web. Если взлетит, то дальше настраивать apparmor по аналогии с https://support.plesk.com/hc/en-us/articles/360004185293-Unable-to-start-MySQL-on-Ubuntu-AVC-apparmor-DENIED-operation-open- или почитать оф. доку по apparmor.

phoen ★★ ()