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

fix some stuff ... #391

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

fix some stuff ... #391

wants to merge 1 commit into from

Conversation

milahu
Copy link

@milahu milahu commented May 24, 2024

  • 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>)

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

Successfully merging this pull request may close these issues.

1 participant