anthonyraymond / joal

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

Add Ratio limit to Joal #191

Open ashaychangwani opened 1 year ago

ashaychangwani commented 1 year ago

Hi!

Joal is absolutely perfect for my use case, except that it has got me close to getting banned a couple of times, when I forget to take the torrent off and it keeps uploading. Even setting a speed of 1mbps over a span of 3 days can rack up over 200gb of upload, which is suspicious to say the least.

For that, I've added a ratio limit of 1.0. I'm aware that this has already been addressed in the past in #38, but since I needed a temporary fix, I decided to write something myself here: https://github.com/ashaychangwani/joal-ratio/tree/addRatioLimit

I haven't opened a PR yet, because I'm not sure the code is up to your standards, however I just want to use this as a starting point and iterate to make it more functional and cleaner, as well as improving the test coverage.

Could you tell me how I can compile the same code into a way that I can use it with my media-stack?

I'm currently using the following docker-compose script to run Joal:

joal:
    image: anthonyraymond/joal:2.1.33
    container_name: joal
    restart: unless-stopped
    volumes:
      - /storage/joal:/data
    ports:
      - 9092:9092
    command: ["--joal-conf=/data", "--spring.main.web-environment=true", "--server.port=*", "--joal.ui.path.prefix=*", "--joal.ui.secret-token=*"]
laur89 commented 1 year ago

I haven't opened a PR yet

Easier to discuss code under PR. They cost nothing, just fire away.

Could you tell me how I can compile the same code into a way that I can use it with my media-stack

In the project dir do docker build . -t custom-joal, then use that as you image in docker(-compose).

ashaychangwani commented 1 year ago

Noted, I've opened the PR!

How can I unminify the JS scripts so I can add an option to configure the ratio on the config screen?

anthonyraymond commented 1 year ago

The UI project is hosted at : https://github.com/anthonyraymond/joal-ui

ashaychangwani commented 1 year ago

@anthonyraymond Not sure if this belongs here, but how can I modify the code to the UI and then port the changes to the current repo? For example, if I make changes here, what are the commands to generate this file?

anthonyraymond commented 1 year ago

Hello @ashaychangwani thanks for contributing to the project šŸ‘. You'll find some advice below to help you sort that out. Before you dive in, note that the current version is going to be replaced with a fully rewritten one (won't happen in 2023 IMO, maybe in 2024). I'm trying to rethink the whole project from the ground up and i'm also switching to golang. It's far from being done, i'm doing that on my spare time and i don't have much these days šŸ˜† .

Anyway, here is what you need:

yarn build or npm run build will build those files. New files will have a different name. Delete existing and replace with the new ones).

Please follow the following while implementing :

Side note: if you want to try your code without having to build every time: