mirror of
https://github.com/anthonyraymond/joal.git
synced 2024-09-20 07:16:26 +08:00
Add documentation
This commit is contained in:
parent
82cb9004c3
commit
81127ea035
17
Dockerfile
17
Dockerfile
|
@ -1,17 +0,0 @@
|
|||
FROM openjdk:8-jre
|
||||
|
||||
WORKDIR /jack-of-all-trades/
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y ca-certificates curl \
|
||||
&& GITHUB_REPO="https://github.com/anthonyraymond/joal" \
|
||||
&& LATEST=$(curl -sSI $GITHUB_REPO"/releases/latest" | perl -n -e '/^Location: .*?tag\/(.*?)\r*$/ && print "$1\n"') \
|
||||
&& curl -f -L $GITHUB_REPO"/releases/download/"$LATEST"/"$LATEST".jar" > /jack-of-all-trades/jack-of-all-trades.jar \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /jack-of-all-trades
|
||||
|
||||
EXPOSE 49152-65534
|
||||
VOLUME /data
|
||||
|
||||
CMD ["java","-jar","/jack-of-all-trades/jack-of-all-trades.jar","/data"]
|
|
@ -1,18 +0,0 @@
|
|||
FROM hypriot/rpi-java:1.8.0
|
||||
|
||||
WORKDIR /jack-of-all-trades/
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y ca-certificates curl \
|
||||
&& GITHUB_REPO="https://github.com/anthonyraymond/joal" \
|
||||
&& LATEST=$(curl -sSI $GITHUB_REPO"/releases/latest" | perl -n -e '/^Location: .*?tag\/(.*?)\r*$/ && print "$1\n"') \
|
||||
&& curl -f -L $GITHUB_REPO"/releases/download/"$LATEST"/"$LATEST".jar" > /jack-of-all-trades/jack-of-all-trades.jar \
|
||||
&& apt-get remove --purge --auto-remove curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /jack-of-all-trades
|
||||
|
||||
EXPOSE 49152-65534
|
||||
VOLUME /data
|
||||
|
||||
CMD ["java","-jar","/jack-of-all-trades/jack-of-all-trades.jar","/data"]
|
|
@ -1,12 +0,0 @@
|
|||
FROM hypriot/rpi-java:1.8.0
|
||||
|
||||
WORKDIR /jack-of-all-trades/
|
||||
|
||||
# the compiled jack of all trades is required
|
||||
ADD jack-of-all-trades-2.0.0-SNAPSHOT.jar /jack-of-all-trades/jack-of-all-trades-2.0.0-SNAPSHOT.jar
|
||||
|
||||
WORKDIR /jack-of-all-trades
|
||||
|
||||
VOLUME /data
|
||||
|
||||
CMD ["java","-jar","/jack-of-all-trades/jack-of-all-trades-2.0.0-SNAPSHOT.jar","--joal-conf=/data"]
|
99
README.md
99
README.md
|
@ -1,6 +1,7 @@
|
|||
[![Build Status](https://travis-ci.org/anthonyraymond/joal.svg?branch=master)](https://travis-ci.org/anthonyraymond/joal)
|
||||
|
||||
# JOAL
|
||||
This is the server application (with an **optional** webui), if you are interested in the desktop app look at [here](https://github.com/anthonyraymond/joal-desktop).
|
||||
|
||||
### Which client can JOAL emulate?
|
||||
|
||||
|
@ -23,95 +24,55 @@ Ask for it in GitHub issues or mail <a href="mailto:joal.contact@gmail.com">joal
|
|||
[support-no]:readme-assets/cross-mark.png
|
||||
[support-yes]:readme-assets/check-mark.png
|
||||
|
||||
## Getting started
|
||||
Download the latest `tar.gz` release.
|
||||
Put `config.json`, `clients`, and `torrents` folder into the location of your choice (this will be your configuration folder). For the rest of this README, it will be named `joal-conf`.
|
||||
|
||||
# How to start
|
||||
## How to run
|
||||
|
||||
With UI :
|
||||
`java -Djava.net.preferIPv6Addresses=true -jar .\jack-of-all-trades-2.0.0.jar --joal-conf="PATH_TO_CONF" --spring.main.web-environment=true --server.port=YOUR_PORT --joal.ui.path.prefix="SECRET_OBFUSCATION_PATH" --joal.ui.secret-token="SECRET_TOKEN"`
|
||||
|
||||
Without UI:
|
||||
`java -Djava.net.preferIPv6Addresses=true -jar .\jack-of-all-trades-2.0.0.jar --joal-conf="PATH_TO_CONF" --spring.main.web-environment=false`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Prepare configuration folder
|
||||
You first need to get the configuration folder. Replace `<MY_CONFIG_FOLDER_PATH>` by whatever path you want.
|
||||
```
|
||||
git clone git@github.com:anthonyraymond/joal.git
|
||||
cd joal
|
||||
cp -R resources <MY_CONFIG_FOLDER_PATH>
|
||||
```
|
||||
Now add some of your private tracker's `.torrent` file to `<MY_CONFIG_FOLDER_PATH>/torrents/`. But **be aware** that only torrent with at least 1 leecher will actually be used by *joal*, to keep your account from being banned.
|
||||
|
||||
|
||||
# Install and run
|
||||
### With Docker
|
||||
|
||||
**For ARM distribution only (raspberry)**
|
||||
```
|
||||
docker build -f Dockerfile.arm -t araymond/joal .
|
||||
docker run -d -v <PATH_TO_CONFIG_DIR>:/data -p 49152-65534:49152 --name="joal" araymond/joal
|
||||
java -Djava.net.preferIPv6Addresses=true -jar .\jack-of-all-trades-X.X.X.jar --joal-conf="PATH_TO_CONF"
|
||||
```
|
||||
|
||||
**For any other distribution**
|
||||
```
|
||||
docker build -t araymond/joal .
|
||||
docker run -d -v <PATH_TO_CONFIG_DIR>:/data -p 49152-65534:49152 --name="joal" araymond/joal
|
||||
```
|
||||
- `-Djava.net.preferIPv6Addresses=true`: is for instruct the JVM to prefer ipv6, if you ISP does not support ipv6 don't prepend this parameter.
|
||||
- `--joal-conf` is a **required** argument: path to the joal-conf folder (ie: /home/anthony/joal-conf).
|
||||
|
||||
### Without Docker
|
||||
You need to have **Java 8** installed.
|
||||
<br />
|
||||
By default the web-ui is disabled, you can enable it with some more arguments:
|
||||
|
||||
We first need to download the latest version of the .jar. Once again replace `<MY_CONFIG_FOLDER_PATH>` by your chosen path and execute this script
|
||||
```
|
||||
cd <MY_CONFIG_FOLDER_PATH> \
|
||||
&& GITHUB_REPO="https://github.com/anthonyraymond/joal" \
|
||||
&& LATEST=$(curl -sSI $GITHUB_REPO"/releases/latest" | perl -n -e '/^Location: .*?tag\/(.*?)\r*$/ && print "$1\n"') \
|
||||
&& curl -f -L $GITHUB_REPO"/releases/download/"$LATEST"/"$LATEST".jar" > ./jack-of-all-trades.jar
|
||||
```
|
||||
- `--spring.main.web-environment=true`: to enable the web context.
|
||||
- `--server.port=YOUR_PORT`: the port used by the web-socket connection (not the HTTP port).
|
||||
- `--joal.ui.path.prefix="SECRET_OBFUSCATION_PATH"`: use your own complicated path here (this will be your first layer of security to keep joal secret). This is security though obscurity, but it is required in our case.
|
||||
- `--joal.ui.secret-token="SECRET_TOKEN"`: use your own secret token here (this is some kind of a password, choose a complicated one).
|
||||
|
||||
Then you can run the application with the following command *(replace X.X.X with your own version)*
|
||||
```
|
||||
java -jar jack-of-all-trades-X.X.X.jar <MY_CONFIG_FOLDER_PATH>
|
||||
```
|
||||
|
||||
# Understanding configuration (optional)
|
||||
### Torrent files
|
||||
- All torrent file in `<MY_CONFIG_FOLDER_PATH>/torrents/` will be available for sharing.
|
||||
- One random torrent file from `<MY_CONFIG_FOLDER_PATH>/torrents/` is chosen randomly for each seed session.
|
||||
- All torrent file added/removed/modified in `<MY_CONFIG_FOLDER_PATH>/torrents/` while the client is running will be automatically hot loaded, there is no need to restart.
|
||||
- **If the torrent currently seeding reach 0 peers, the file will be moved to `<MY_CONFIG_FOLDER_PATH>/torrents/archived` folder.**
|
||||
Once joal is started head to: `http://localhost:5081/SECRET_OBFUSCATION_PATH/ui/` (obviously, replace `SECRET_OBFUSCATION_PATH`) by the value you had chosen
|
||||
The `joal.ui.path.prefix` might seems useless but it's actually **crucial** to set it as complex as possible to prevent peoples to know that joal is running on your server.
|
||||
|
||||
|
||||
## Start seeding
|
||||
Just add some `.torrent` files to the `joal-conf/torrents` folder. There is no need to restart JOAL to add more torrents, add it to the folder and JOAL will be aware of after few seconds.
|
||||
|
||||
## Configuration file
|
||||
### Application configuration
|
||||
The application configuration belongs in `<MY_CONFIG_FOLDER_PATH>/config.json`.
|
||||
The application configuration belongs in `joal-conf/config.json`.
|
||||
|
||||
```
|
||||
{
|
||||
"minUploadRate": 180,
|
||||
"maxUploadRate": 190,
|
||||
"simultaneousSeed": 2,
|
||||
"client": "azureus-5.7.4.0.client"
|
||||
"minUploadRate" : 30,
|
||||
"maxUploadRate" : 160,
|
||||
"simultaneousSeed" : 20,
|
||||
"client" : "qbittorrent-3.3.16.client",
|
||||
"keepTorrentWithZeroLeechers" : true
|
||||
}
|
||||
```
|
||||
- `minUploadRate` : The minimum uploadRate you want to fake (in kB/s) (**required**)
|
||||
- `maxUploadRate` : The maximum uploadRate you want to fake (in kB/s) (**required**)
|
||||
- `simultaneousSeed` : How many torrents should be seeding at the same time (**required**)
|
||||
- `client` : The name of the .client file to use in `<MY_CONFIG_FOLDER_PATH>/clients/` (**required**)
|
||||
|
||||
### Create your own torrent clients
|
||||
To learn more about .client, head to the [project's wiki][project-wiki].
|
||||
|
||||
## ROADMAP to v2
|
||||
- https://github.com/anthonyraymond/joal/issues/4
|
||||
- `client` : The name of the .client file to use in `joal-conf/clients/` (**required**)
|
||||
- `keepTorrentWithZeroLeechers`: should JOAL keep torrent with no leechers or seeders. If yes, torrent with no peers will be seed at 0kB/s. If false torrents will be deleted on 0 peers reached.
|
||||
|
||||
# Thanks:
|
||||
This project use a modified version of the awesome [mpetazzoni/ttorrent] library. Thanks to **mpetazzoni** for this.
|
||||
|
||||
[project-wiki]: https://github.com/anthonyraymond/joal/wiki
|
||||
[mpetazzoni/ttorrent]: http://mpetazzoni.github.com/ttorrent/
|
||||
This project use a modified version of the awesome [mpetazzoni/ttorrent](http://mpetazzoni.github.com/ttorrent/) library. Thanks to **mpetazzoni** for this.
|
||||
Also this project has benefited from the help of several peoples, see [Thanks.md](THANKS.md)
|
||||
|
||||
[![Analytics](https://ga-beacon.appspot.com/UA-97530761-1/joal/readme?pixel)](https://github.com/igrigorik/ga-beacon)
|
||||
|
|
Loading…
Reference in a new issue