anthonyraymond / joal

An open source command line RatioMaster with an optional WebUI.
Apache License 2.0
606 stars 65 forks source link

The port used by Joal is not seen as open by trackers #185

Open rursache opened 1 year ago

rursache commented 1 year ago

Hi @anthonyraymond,

Thanks for this great project. I observed that Joal will 'seed' on port 49152 however when I open that port in my router, no tracker can see it as open. I've also tried portchecker.co, canyouseeme.org and others.

Using Joal via Docker with the following docker run command:

docker run -d \
  --name joal \
  --network=host \
  --restart unless-stopped \
  -e TZ=Europe/Bucharest \
  -v /private/path/to/data:/data \
  anthonyraymond/joal:latest \
  --joal-conf="/data" \
  --spring.main.web-environment=true \
  --server.port="6688" \
  --joal.ui.path.prefix="prefix" \
  --joal.ui.secret-token="token"

Yes, I know how to open ports as the qBitTorrent (Wireguard + others) port is open and it's visible by the above websites and trackers.

Any help? Some trackers will block any seeding attempts if the port is closed as uploading torrents IRL can't be done on closed ports. Thank you

laur89 commented 1 year ago

@anthonyraymond is this because we're not really accepting any connections in ConnectionHandler?

Do you know what sort of I/O should happen between trackers and clients?

At any rate, started work on it here: https://github.com/anthonyraymond/joal/pull/187/files#diff-bc97f2cf481a4672f69346e371cb240ae51f309844399bda90a17072987b527dR79-R99

rursache commented 1 year ago

https://github.com/anthonyraymond/joal/pull/187 should fix this, thanks @laur89!

is there any way to setup beta builds for docker? i would love to test the changes

laur89 commented 1 year ago

Check out corresponding branch & build the image: docker build .

rursache commented 1 year ago

@laur89 is it a drop-in replacement or should i update my config file? thanks again!

laur89 commented 1 year ago

Should be drop-in. If not, it's a bug.

rursache commented 1 year ago

it's working as expected, a simple drop-in replacement. thanks for your work.

please close this issue when it gets merged.

laur89 commented 1 year ago

Could you elaborate how you verified it? I have extremely low confidence in the current implementation, as I have no idea what communication, if any, trackers perform with the clients.

rursache commented 1 year ago

the trackers now see joal as a connectable client and the port seems open by using the sites in the issue description. i think most trackers just test if that port is actually open, nothing more. however, this could change from tracker to tracker. on mine it seems all good for now.

happy to provide more details/logs if needed

anthonyraymond commented 1 year ago

Hello,

Indeed the ConnectionHandler is not fully implemented. Ideally you would listen for peers request and answer with "choke". That's the ultimate goal of this class.

But in any case you'll need to open the port on your router. To be able to seed you need to have an open port on your router, there is no way around. Unless there is some part of the BitTorrent protocol that allow another way (maybe the client can send random parts to randiom peers on his behalf), i don't know the protocol very much on this part, i've never took time to fully RTFM ^^. To have this port open, most BitTorrent client use UPnP to automatically create a port forwarding rule on your routers. This allow incomming traffic from the internet to reach your client.

rursache commented 1 year ago

@anthonyraymond Port forwarding is not an issue, as I said myself, it's needed for the bittorrent protocol. I did it on qBitTorrent and I did it for Joal.

After using @laur89's build, the trackers previously reporting Joal as "not connectable" are now "connectable" and they receive the "seeding effort" as previously, on the official Joal build, they did not.

I'm not knowledgeable enough to say if @laur89's implementation is perfect or ideal but it clearly improved the "handshake" with the trackers I had issues before.

EDIT: I'm open to sponsor both of you to get this project forward but neither have provided a way to do so 👀

anthonyraymond commented 1 year ago

@rursache i know, i've red through the entire post, but i've provided extra details to keep here for future possible improvements.

I've not enabled sponsorship for now. I'm in the midle of rewriting the whole project in another language. Adding some high requesting feature along the way. When the new version gets released / stable, i'll provide some retribution options. For now, even if JOAL works perfectly and the overall experience is totally safe for users, the code base has grown from an original poorly designed structure. I won't feel conformtable making money out of this.

datsoy commented 1 year ago

Hi, may I know what port joal uses from 49152-65534 range? Or is there a default one? Need to know what port to open. Thanks.

rursache commented 1 year ago

@datsoy its 49152 as i said in my initial post.

datsoy commented 1 year ago

@datsoy its 49152 as i said in my initial post.

Thank you, 49152 is for outgoing port right? Is there a incoming port should I open? And I see ports for protocol handler and tomcat, Do i need them?

rursache commented 1 year ago

@datsoy i have no idea what you're talking about. just open port 49152 and you're done.

laur89 commented 1 year ago

Hi, may I know what port joal uses from 49152-65534 range? Or is there a default one? Need to know what port to open. Thanks.

It uses the first port in that range it's able to bind to. Assuming no other program is using port 49152, it will be used. If it's already in use, then it'll try 49153 and so on until 65534.