Tor2web icon indicating copy to clipboard operation
Tor2web copied to clipboard

fix some stuff ...

Open milahu opened this issue 1 month ago • 0 comments

  • fix regex bytestrings: b"...\1..." to rb"...\1..."
  • fix rewriting of html content: remove condition if len(data) >= config.bufsize * 2
  • remove deprecated intToBytes
  • add debug prints
  • add bin/tor2web.sh - all of this init stuff should be done by tor2web/t2w.py on the first run. this should also work when tor2web is installed as a python package
  • add tor2web.conf.example

tor2web is still not working properly for me, it runs, but fails to handle any requests... it just hangs

dont know whats wrong, maybe related to content rewriting

$ ./bin/tor2web.sh
/nix/store/a3m02l8fwa776p3i28qh1nl3lmv8amxx-tor2web-3.2.0-unstable-2022-07-15/lib/python3.11/site-packages/tor2web/t2w.py:24: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  from cgi import parse_header
2024-05-24 13:48:43+0200 [-] Log opened.
2024-05-24 13:48:43+0200 [-] PBServerFactory starting on '/run/user/1000/tor2web-data/run/rpc.socket'
2024-05-24 13:48:43+0200 [-] Starting factory <twisted.spread.pb.PBServerFactory object at 0x7f57adcad210>
/nix/store/a3m02l8fwa776p3i28qh1nl3lmv8amxx-tor2web-3.2.0-unstable-2022-07-15/lib/python3.11/site-packages/tor2web/t2w.py:24: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  from cgi import parse_header
/nix/store/a3m02l8fwa776p3i28qh1nl3lmv8amxx-tor2web-3.2.0-unstable-2022-07-15/lib/python3.11/site-packages/tor2web/t2w.py:780: DeprecationWarning: twisted.web.http.Request.getClientIP was deprecated in Twisted 18.4.0; please use getClientAddress instead
  self.obj.client_ip = self.getClientIP()
Fri, 24 May 2024 11:48:47 GMT detected <onion_url>.tor2web Hostname: piratebayo3klnzokct3wt5yyxb2vpebbuyjl7m623iaxmqhsd52coid.onion
2024-05-24 13:48:48+0200 [-] Starting factory _HTTP11ClientFactory(<function HTTPConnectionPool._newConnection.<locals>.quiescentCallback at 0x7f57adc6f380>, <twisted.internet.endpoints._WrapperEndpoint object at 0x7f57ae5e5cd0>)
2024-05-24 13:48:48+0200 [-] Stopping factory _HTTP11ClientFactory(<function HTTPConnectionPool._newConnection.<locals>.quiescentCallback at 0x7f57adc6f380>, <twisted.internet.endpoints._WrapperEndpoint object at 0x7f57ae5e5cd0>)

milahu avatar May 24 '24 11:05 milahu