From 954605559aed993d4c68389e21c529aad09c4a30 Mon Sep 17 00:00:00 2001 From: FoRTu Date: Sun, 29 Mar 2020 15:57:24 +0200 Subject: [PATCH 01/10] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 6985692..d09e136 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # opentracker-docker -[![Docker Pulls](https://img.shields.io/docker/pulls/lednerb/opentracker-docker.svg?maxAge=2592000&style=flat-square)](https://hub.docker.com/r/lednerb/opentracker-docker/) [![Docker Stars](https://img.shields.io/docker/stars/lednerb/opentracker-docker.svg?maxAge=2592000&style=flat-square)](https://hub.docker.com/r/lednerb/opentracker-docker/) [![license](https://img.shields.io/github/license/lednerb/opentracker-docker.svg?maxAge=2592000&style=flat-square)](https://github.com/Lednerb/opentracker-docker/blob/master/LICENSE) [![Open Source Love](https://badges.frapsoft.com/os/v2/open-source.svg?v=103)](https://github.com/ellerbrock/open-source-badge/) - -With this repo you can easily run your own instance of the opentracker for bitorrent. +Opentracker is a open and free bittorrent tracker. It aims for minimal resource usage and is intended to run at any GNU/Linux system. Currently it is deployed as an open and free tracker instance. ## How to run an _open_ opentracker If you want to run a complete open tracker, just pull the docker image and start up a container: From c6edfea70a0d3c636ec513f0404118aeab57f523 Mon Sep 17 00:00:00 2001 From: FoRTu Date: Sun, 29 Mar 2020 17:16:46 +0200 Subject: [PATCH 02/10] =?UTF-8?q?=F0=9F=91=A8=E2=80=8D=F0=9F=92=BB=20Custo?= =?UTF-8?q?mize=20for=20unRAID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Customization of dockerfile and edit the Readme.md --- Dockerfile | 9 +++----- README.md | 56 +++++++++++++++++++++--------------------------- opentracker.conf | 4 ++-- 3 files changed, 29 insertions(+), 40 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4e6e76b..66a8be2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ FROM alpine -MAINTAINER Lednerb +LABEL maintainer="FoRTu" \ +maintainer.website="https://github.com/FoRTu" WORKDIR /tmp @@ -25,11 +26,7 @@ RUN apk add --no-cache \ && mv /tmp/opentracker/opentracker /bin/ \ && apk del gcc g++ make git cvs zlib-dev \ - && rm -rf /var/cache/apk/* /tmp/* - -COPY ./opentracker.conf /etc/opentracker/opentracker.conf -COPY ./whitelist.txt /etc/opentracker/whitelist.txt -COPY ./blacklist.txt /etc/opentracker/blacklist.conf + && rm -rf /var/cache/apk/* /tmp/* EXPOSE 6969 diff --git a/README.md b/README.md index d09e136..ba5e53d 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,39 @@ -# opentracker-docker +# opentracker-docker Opentracker is a open and free bittorrent tracker. It aims for minimal resource usage and is intended to run at any GNU/Linux system. Currently it is deployed as an open and free tracker instance. -## How to run an _open_ opentracker -If you want to run a complete open tracker, just pull the docker image and start up a container: +## How to run Opentracker +First of all you have to set the configuration file *opentracker.conf*. You can use [this as a template](opentracker.conf) if you want, or create a new file. *Opentracker* can be run in open-mode or limit it with hashes blacklist or whitelist. -`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969 lednerb/opentracker-docker` +## Run it in *open-mode* +In this mode any hash request will be recorded. Just add the tracker url to any torrent and when the bittorrent client request for peers, it will record the hash and served on future requests. -This will bind the port `6969` to the docker container (UDP and TCP) and you're good to go. +Copy the [opentracker.conf file](opentracker.conf) as it is on a folder share the path with the container changing */PATH/CONFIG_FILE/* in the *docker run*: +`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969/tcp -v /PATH/CONFIG_FILE/:/etc/opentracker/ fortu/docker-opentracker` -## How to run a _customized_ opentracker instance +## How to whitelist your opentracker torrents +If you solely want to run the opentracker instance for specific torrents you have to whitelist them. -If you want to config your opentracker instance, just download or `git clone` the [github repository](https://github.com/Lednerb/opentracker-docker/) and edit the `opentracker.conf` file. +Follow these steps to whitelist your .torrent files: + 1. Create a `whitelist.txt` file. + 2. Copy and paste your torrent `info_hashes` into the file: -Now you have to build your own image as follows: - 1. Edit and save the `opentracker.conf` file - 2. Open a terminal and `cd` into the project folder - 3. Run `docker build -t yourfancyname/opentracker .` + Example *whitelist.txt*: + ``` + 0123456789abcdef0123456789abcdef01234567 + 890123456789abcdef0123456789abcdef012345 + ``` -After building the docker image successfully you can start up a container: + 3. Uncomment line 37 in the [opentracker.conf](opentracker.conf): -`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969 yourfancyname/opentracker` + ... *access.whitelist /etc/opentracker/whitelist.txt* + 4. Copy those files, *opentracker.conf* and *whitelist.txt*, to a folder. -## How to whitelist your opentracker torrents -If you solely want to run the opentracker instance for specific torrents you have to whitelist them. +Replace in the *docker run* command the path of the folder: -Follow these steps to whitelist your .torrent files: - 1. Download or `git clone` the [github repository](https://github.com/Lednerb/opentracker-docker/) - 2. Open the `whitelist.txt` file in your favorite editor - 3. Copy & Paste your torrent `info_hashes` into the file - 4. Uncomment line 37 in the `opentracker.conf` - 5. Open a terminal and `cd` into the project folder - 6. Run `docker build -t yourfancyname/opentracker .` - -Example whitelist.txt: -``` -0123456789abcdef0123456789abcdef01234567 -890123456789abcdef0123456789abcdef012345 -``` - -After the docker image was successfully built you can start a new container: - -`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969 yourfancyname/opentracker` +`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969/tcp -v /PATH/CONFIG_FILE/:/etc/opentracker/ fortu/docker-opentracker` ## How to blacklist some torrents Just follow the steps from obove but paste the `info_hashes` into the `blacklist.txt` file and uncomment line 41 in the `opentracker.conf` file. @@ -51,3 +41,5 @@ Just follow the steps from obove but paste the `info_hashes` into the `blacklist ## Thanks & Donations [Best wishes to the creators of opentracker!](http://erdgeist.org/arts/software/opentracker/) opentracker is _beerware_ so feel free to donate those guys a drink ;-) + +Thanks to [Sascha Brendel](https://github.com/Lednerb) for create the image I have forked. diff --git a/opentracker.conf b/opentracker.conf index 37ea93e..16eb651 100644 --- a/opentracker.conf +++ b/opentracker.conf @@ -14,9 +14,9 @@ # can re-set it for each listen statement. Normally you should keep it at # the top of the config file. # -# listen.udp.workers 4 +listen.udp.workers 4 # -# listen.tcp_udp 0.0.0.0 +listen.tcp_udp 0.0.0.0:6969 # listen.tcp_udp 192.168.0.1:80 # listen.tcp_udp 10.0.0.5:6969 # From 3a612240e6615b93f1a9f2c27dbfb17d92d37266 Mon Sep 17 00:00:00 2001 From: FoRTu Date: Sun, 29 Mar 2020 20:05:51 +0200 Subject: [PATCH 03/10] =?UTF-8?q?=F0=9F=91=A8=E2=80=8D=F0=9F=92=BB=20Docke?= =?UTF-8?q?rfile=20&=20Readme.md=20edit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I have edit the dockerfile to add a pre-configured 'Makeflie' before the compilation durin the image building. Also edit the readme.md with the new behavior of the image. --- Dockerfile | 10 ++++++---- README.md | 33 ++++++++++----------------------- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index 66a8be2..8d3f01f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,11 +19,13 @@ RUN apk add --no-cache \ && make \ && cd ../ \ - && git clone git://erdgeist.org/opentracker \ - && cd opentracker \ - && make \ + && git clone git://erdgeist.org/opentracker - && mv /tmp/opentracker/opentracker /bin/ \ +COPY ./Makefile /tmp/opentracker/ + + && make \ + + && cp /tmp/opentracker/opentracker.debug /bin/opentracker \ && apk del gcc g++ make git cvs zlib-dev \ && rm -rf /var/cache/apk/* /tmp/* diff --git a/README.md b/README.md index ba5e53d..b2de7e7 100644 --- a/README.md +++ b/README.md @@ -1,23 +1,13 @@ -# opentracker-docker +# OpenTracker Docker image Opentracker is a open and free bittorrent tracker. It aims for minimal resource usage and is intended to run at any GNU/Linux system. Currently it is deployed as an open and free tracker instance. -## How to run Opentracker -First of all you have to set the configuration file *opentracker.conf*. You can use [this as a template](opentracker.conf) if you want, or create a new file. *Opentracker* can be run in open-mode or limit it with hashes blacklist or whitelist. +## About this OpenTracker image +First of all, this tracker is compiled to use a *hash whitelist*, so only hashes stored on `whitelist.txt` are going to be served. -## Run it in *open-mode* -In this mode any hash request will be recorded. Just add the tracker url to any torrent and when the bittorrent client request for peers, it will record the hash and served on future requests. - -Copy the [opentracker.conf file](opentracker.conf) as it is on a folder share the path with the container changing */PATH/CONFIG_FILE/* in the *docker run*: - -`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969/tcp -v /PATH/CONFIG_FILE/:/etc/opentracker/ fortu/docker-opentracker` - -## How to whitelist your opentracker torrents -If you solely want to run the opentracker instance for specific torrents you have to whitelist them. - -Follow these steps to whitelist your .torrent files: - 1. Create a `whitelist.txt` file. - 2. Copy and paste your torrent `info_hashes` into the file: +## How to run it +Follow these steps to enable your torrent hashes: + 1. Open `whitelist.txt` file and paste your torrents `info_hashes` into. One `hash` per line. Example *whitelist.txt*: ``` @@ -25,18 +15,15 @@ Follow these steps to whitelist your .torrent files: 890123456789abcdef0123456789abcdef012345 ``` - 3. Uncomment line 37 in the [opentracker.conf](opentracker.conf): - - ... *access.whitelist /etc/opentracker/whitelist.txt* - - 4. Copy those files, *opentracker.conf* and *whitelist.txt*, to a folder. + 2. Copy those files, `opentracker.conf` and `whitelist.txt`, into a folder. Replace in the *docker run* command the path of the folder: `docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969/tcp -v /PATH/CONFIG_FILE/:/etc/opentracker/ fortu/docker-opentracker` -## How to blacklist some torrents -Just follow the steps from obove but paste the `info_hashes` into the `blacklist.txt` file and uncomment line 41 in the `opentracker.conf` file. +That's it! + +Now the bittorrent tracker is running and serving only the torrents that you want. If you want to add more torrents to your tracker, just stop the container, add the new `hash` to the `whitelist.txt` and start the container back. Also you can customize some configuration of the tracker by editing `opentracker.conf` file. ## Thanks & Donations [Best wishes to the creators of opentracker!](http://erdgeist.org/arts/software/opentracker/) From 9af3724eb19605d90837a34ef9a4e0b3165a3761 Mon Sep 17 00:00:00 2001 From: FoRTu Date: Sun, 29 Mar 2020 20:06:53 +0200 Subject: [PATCH 04/10] =?UTF-8?q?=F0=9F=91=A8=E2=80=8D=F0=9F=92=BB=20Add?= =?UTF-8?q?=20the=20pre-configured=20'Makefile'=20and=20edit=20'opentracke?= =?UTF-8?q?r.conf'.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..94f3c0d --- /dev/null +++ b/Makefile @@ -0,0 +1,87 @@ +# $Id$ + +CC?=gcc + +# Linux flavour +# PREFIX?=/opt/diet +# LIBOWFAT_HEADERS=$(PREFIX)/include +# LIBOWFAT_LIBRARY=$(PREFIX)/lib + +# BSD flavour +# PREFIX?=/usr/local +# LIBOWFAT_HEADERS=$(PREFIX)/include/libowfat +# LIBOWFAT_LIBRARY=$(PREFIX)/lib + +# Debug flavour +PREFIX?=.. +LIBOWFAT_HEADERS=$(PREFIX)/libowfat +LIBOWFAT_LIBRARY=$(PREFIX)/libowfat + +BINDIR?=$(PREFIX)/bin + +#FEATURES+=-DWANT_V6 + +#FEATURES+=-DWANT_ACCESSLIST_BLACK +FEATURES+=-DWANT_ACCESSLIST_WHITE + +#FEATURES+=-DWANT_SYNC_LIVE +#FEATURES+=-DWANT_IP_FROM_QUERY_STRING +FEATURES+=-DWANT_COMPRESSION_GZIP +FEATURES+=-DWANT_COMPRESSION_GZIP_ALWAYS +#FEATURES+=-DWANT_LOG_NETWORKS +#FEATURES+=-DWANT_RESTRICT_STATS +#FEATURES+=-DWANT_IP_FROM_PROXY +#FEATURES+=-DWANT_FULLLOG_NETWORKS +#FEATURES+=-DWANT_LOG_NUMWANT +#FEATURES+=-DWANT_MODEST_FULLSCRAPES +#FEATURES+=-DWANT_SPOT_WOODPECKER +#FEATURES+=-DWANT_SYSLOGS +#FEATURES+=-DWANT_DEV_RANDOM +FEATURES+=-DWANT_FULLSCRAPE + +#FEATURES+=-D_DEBUG_HTTPERROR + +OPTS_debug=-D_DEBUG -g -ggdb # -pg -fprofile-arcs -ftest-coverage +OPTS_production=-O3 + +CFLAGS+=-I$(LIBOWFAT_HEADERS) -Wall -pipe -Wextra #-ansi -pedantic +LDFLAGS+=-L$(LIBOWFAT_LIBRARY) -lowfat -pthread -lpthread -lz + +BINARY =opentracker +HEADERS=trackerlogic.h scan_urlencoded_query.h ot_mutex.h ot_stats.h ot_vector.h ot_clean.h ot_udp.h ot_iovec.h ot_fullscrape.h ot_accesslist.h ot_http.h ot_livesync.h ot_rijndael.h +SOURCES=opentracker.c trackerlogic.c scan_urlencoded_query.c ot_mutex.c ot_stats.c ot_vector.c ot_clean.c ot_udp.c ot_iovec.c ot_fullscrape.c ot_accesslist.c ot_http.c ot_livesync.c ot_rijndael.c +SOURCES_proxy=proxy.c ot_vector.c ot_mutex.c + +OBJECTS = $(SOURCES:%.c=%.o) +OBJECTS_debug = $(SOURCES:%.c=%.debug.o) +OBJECTS_proxy = $(SOURCES_proxy:%.c=%.o) +OBJECTS_proxy_debug = $(SOURCES_proxy:%.c=%.debug.o) + +.SUFFIXES: .debug.o .o .c + +all: $(BINARY) $(BINARY).debug + +CFLAGS_production = $(CFLAGS) $(OPTS_production) $(FEATURES) +CFLAGS_debug = $(CFLAGS) $(OPTS_debug) $(FEATURES) + +$(BINARY): $(OBJECTS) $(HEADERS) + $(CC) -o $@ $(OBJECTS) $(LDFLAGS) + strip $@ +$(BINARY).debug: $(OBJECTS_debug) $(HEADERS) + $(CC) -o $@ $(OBJECTS_debug) $(LDFLAGS) +proxy: $(OBJECTS_proxy) $(HEADERS) + $(CC) -o $@ $(OBJECTS_proxy) $(CFLAGS_production) $(LDFLAGS) +proxy.debug: $(OBJECTS_proxy_debug) $(HEADERS) + $(CC) -o $@ $(OBJECTS_proxy_debug) $(LDFLAGS) + +.c.debug.o : $(HEADERS) + $(CC) -c -o $@ $(CFLAGS_debug) $(<:.debug.o=.c) + +.c.o : $(HEADERS) + $(CC) -c -o $@ $(CFLAGS_production) $< + +clean: + rm -rf opentracker opentracker.debug *.o *~ + +install: + install -m 755 opentracker $(BINDIR) From b6d888e1f89a7ecfe8a808f1f460b4f41f3aee3e Mon Sep 17 00:00:00 2001 From: FoRTu Date: Sun, 29 Mar 2020 20:14:11 +0200 Subject: [PATCH 05/10] Delete blacklist.txt --- blacklist.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 blacklist.txt diff --git a/blacklist.txt b/blacklist.txt deleted file mode 100644 index e69de29..0000000 From 4f6504534b06ac5ecfc0747f1daf4e3df0ca2367 Mon Sep 17 00:00:00 2001 From: FoRTu Date: Sun, 29 Mar 2020 21:45:08 +0200 Subject: [PATCH 06/10] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Fix=20Dockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 42 +++++++++++++++++++----------------------- opentracker.conf | 6 +++--- whitelist.txt | 2 ++ 3 files changed, 24 insertions(+), 26 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8d3f01f..39bb970 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,30 +5,26 @@ maintainer.website="https://github.com/FoRTu" WORKDIR /tmp -# All-in-One RUN for a very small image size (< 5 MB) RUN apk add --no-cache \ - gcc \ - g++ \ - make \ - git \ - cvs \ - zlib-dev \ - - && cvs -d :pserver:cvs@cvs.fefe.de:/cvs -z9 co libowfat \ - && cd libowfat \ - && make \ - && cd ../ \ - - && git clone git://erdgeist.org/opentracker - -COPY ./Makefile /tmp/opentracker/ - - && make \ - - && cp /tmp/opentracker/opentracker.debug /bin/opentracker \ - - && apk del gcc g++ make git cvs zlib-dev \ - && rm -rf /var/cache/apk/* /tmp/* +gcc \ +g++ \ +make \ +git \ +cvs \ +zlib-dev \ +&& cvs -d :pserver:cvs@cvs.fefe.de:/cvs -z9 co libowfat \ +&& cd libowfat \ +&& make \ +&& cd ../ \ +&& git clone git://erdgeist.org/opentracker + +COPY Makefile /tmp/opentracker/Makefile + +RUN cd /tmp/opentracker \ +&& make \ +&& cp /tmp/opentracker/opentracker.debug /bin/opentracker \ +&& apk del gcc g++ make git cvs zlib-dev \ +&& rm -rf /var/cache/apk/* /tmp/* EXPOSE 6969 diff --git a/opentracker.conf b/opentracker.conf index 16eb651..f7f50cc 100644 --- a/opentracker.conf +++ b/opentracker.conf @@ -34,11 +34,11 @@ listen.tcp_udp 0.0.0.0:6969 # II) If opentracker runs in a non-open mode, point it to files containing # all torrent hashes that it will serve (shell option -w) # -# access.whitelist /etc/opentracker/whitelist.txt +access.whitelist /etc/opentracker/whitelist.txt # # or, if opentracker was compiled to allow blacklisting (shell option -b) # -# access.blacklist /etc/opentracker/blacklist.txt +#access.blacklist /etc/opentracker/blacklist.txt # # It is pointless and hence not possible to compile black AND white # listing, so choose one of those options at compile time. File format @@ -54,7 +54,7 @@ listen.tcp_udp 0.0.0.0:6969 # to them. Normally it is located at /stats but you can configure it to # appear anywhere on your tracker. # -# access.stats_path stats +#access.stats_path stats # III) Live sync uses udp multicast packets to keep a cluster of opentrackers # synchronized. This option tells opentracker which port to listen for diff --git a/whitelist.txt b/whitelist.txt index e69de29..09ef074 100644 --- a/whitelist.txt +++ b/whitelist.txt @@ -0,0 +1,2 @@ +c46e3b8daafde6e8b731d22e3135f27746bfa885 + From f43b6271d5fa76303e55e307ac5ec2df130c13c3 Mon Sep 17 00:00:00 2001 From: FoRTu Date: Sun, 29 Mar 2020 23:01:47 +0200 Subject: [PATCH 07/10] =?UTF-8?q?=E2=9C=8D=EF=B8=8F=20Update=20Readme.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b2de7e7..5540421 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Follow these steps to enable your torrent hashes: Replace in the *docker run* command the path of the folder: -`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969/tcp -v /PATH/CONFIG_FILE/:/etc/opentracker/ fortu/docker-opentracker` +`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969/tcp -v /PATH/CONFIG_FILE/:/etc/opentracker/ fortu/opentracker` That's it! From 672497caa8bcbd99cd680887a80347c8d7a8eb71 Mon Sep 17 00:00:00 2001 From: FoRTu Date: Mon, 13 Apr 2020 16:18:11 +0200 Subject: [PATCH 08/10] =?UTF-8?q?=F0=9F=91=A8=F0=9F=8F=BD=E2=80=8D?= =?UTF-8?q?=F0=9F=92=BB=20Remove=20CVS,=20Change=20Readme.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I had some problems with the CVS command to get the libowfat library. So I decided to get it by downloading the tar.xz of it. Change the Readme.md to explain the steps to create your own image. --- Dockerfile | 22 +++++----- README.md | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 129 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 39bb970..7e0c3b0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,23 @@ -FROM alpine +FROM alpine:latest LABEL maintainer="FoRTu" \ maintainer.website="https://github.com/FoRTu" -WORKDIR /tmp - RUN apk add --no-cache \ gcc \ g++ \ make \ git \ -cvs \ -zlib-dev \ -&& cvs -d :pserver:cvs@cvs.fefe.de:/cvs -z9 co libowfat \ -&& cd libowfat \ +zlib-dev + +WORKDIR /tmp + +RUN wget http://www.fefe.de/libowfat/libowfat-0.32.tar.xz \ +&& mkdir /tmp/libowfat \ +&& tar -xf libowfat-0.32.tar.xz -C /tmp/libowfat --strip-components=1 \ +&& cd /tmp/libowfat \ && make \ -&& cd ../ \ +&& cd /tmp \ && git clone git://erdgeist.org/opentracker COPY Makefile /tmp/opentracker/Makefile @@ -23,9 +25,7 @@ COPY Makefile /tmp/opentracker/Makefile RUN cd /tmp/opentracker \ && make \ && cp /tmp/opentracker/opentracker.debug /bin/opentracker \ -&& apk del gcc g++ make git cvs zlib-dev \ +&& apk del gcc g++ make git zlib-dev \ && rm -rf /var/cache/apk/* /tmp/* -EXPOSE 6969 - CMD opentracker -f /etc/opentracker/opentracker.conf diff --git a/README.md b/README.md index 5540421..d98245a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # OpenTracker Docker image +[![Docker Pulls count](https://img.shields.io/docker/pulls/fortu/opentracker.svg?label=Docker%20Pulls&color=brightgreen)](https://hub.docker.com/r/fortu/opentracker) Opentracker is a open and free bittorrent tracker. It aims for minimal resource usage and is intended to run at any GNU/Linux system. Currently it is deployed as an open and free tracker instance. @@ -17,13 +18,127 @@ Follow these steps to enable your torrent hashes: 2. Copy those files, `opentracker.conf` and `whitelist.txt`, into a folder. -Replace in the *docker run* command the path of the folder: +Replace in the *docker run* command below, the full path of the folder where you store the `opentracker.conf` and `whitelist.txt`: + +```bash +docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969/tcp -v /PATH/CONFIG_FILES/:/etc/opentracker/ fortu/opentracker +``` + +Now the bittorrent tracker is running and serving only the torrents that you want. If you want to add more torrents to your tracker, just stop the container, add the new `hash` to the `whitelist.txt` and start the container back. + +Your tracker URL will be something like this: + +`http://[YOUR PUBLIC IP OR DOMAIN]:6969/announce` +`udp://[YOUR PUBLIC IP ORDOMAIN]:6969/announce` + +By default in the `opentracker.conf` file the *TCP* and *UDP* protocols are enabled. So you can use any of two urls. be sure that you have youre firewall/NAT configured to recieve any request from the *6969* port in this case. + +Also you can customize some configuration of the tracker by editing `opentracker.conf` file. For example, change the port *6969* by another one, force only the *TCP* or *UDP* protocols, enable stats and how to access to them etc. + +## Customize the docker image +This docker image is build "as is", only to use with a *whitelist* of hashes as a personal bittorrent tracker. But you can build your own image if you want a totally open bittorrent tracker with a blacklist of hashes. This is usefull if you recieve a DMCA mail with a list of hashes that are infringing the copyright law. + +Follow this steps to build your own public and open bittorrent tracker: + +1. Clone the proyect: + + `git clone https://github.com/FoRTu/docker-opentracker.git` + +2. Open the `Makefile` file and comment out the line below: + + ```bash + #FEATURES+=-DWANT_ACCESSLIST_WHITE + ``` + +3. Now uncomment the following lines: + + ```bash + FEATURES+=-DWANT_ACCESSLIST_BLACK + FEATURES+=-DWANT_COMPRESSION_GZIP + FEATURES+=-DWANT_COMPRESSION_GZIP_ALWAYS + FEATURES+=-DWANT_FULLSCRAPE + ``` + +4. Save changes and close the file. + +5. Staying in the same folder of the *Dockerfile*, run the build command: + + ```bash + docker build --no-cache=true -t fortu/opentracker . + ``` + +6. Create a `blacklist.txt` file within a folder and copy there the `opentracker.conf` file too. This folder should be accessible by the container once we run it. + +7. Open the `opentracker.conf` file you just have copyed to change configuration. + +8. Comment out the *whitlist* configuration line: + + ```bash + #access.whitelist /etc/opentracker/whitelist.txt + ``` + +9. Uncomment the *blacklist* configuration line: + + ```bash + access.blacklist /etc/opentracker/blacklist.txt + ``` + +10. You can change the listen port and the protocol you want to use in the tracker. For example in this case I'm going to enable only *UDP* protocol, instead both *TCP* & *UDP*, and change the port to *2571* . This will requiered to comment out the next line: + + ```bash + #listen.tcp_udp 0.0.0.0:6969 + ``` + And add the next line below: + + ```bash + listen.udp 0.0.0.0:2571 + ``` + +11. Is possible to enable the *stats* and the way of access to its. First of all is to enable it by uncommenting the next line. To haide or obfuscte the stats you can change the *path* too. In this case *mytrackerstats*: + + ```bash + access.stats_path mytrackerstats + ``` + +13. If someone tries to access your tracker using it as a website, they can be redirected to an *url*. Just change the last line and type the website you want to redirect them to: + + ```bash + tracker.redirect_url http://www.TheWebSite.com/ + ``` + +14. Save changes and close the file. + +15. Now you can run the next *docker run* command taking account of the changes you have done previously. You have to change the port number and the protocol you have define and the full path of the folder where you placed the `blacklist.txt` and the `opentracker.conf`files, were you have changed the configuration. + + ```bash + docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969/tcp -v /PATH/CONFIG_FILES/:/etc/opentracker/ fortu/opentracker + ``` + +Now your bittorrent tracker is running and listening on the TCP/IP *port* and the protocol you have define. The only thing you have todo is to add the *URL* of your tracker to your torrent files or magnet links, and the tracker will start to serve it. + +If you choose only *UDP* protocol and the *2571* port, the *URL* of the tracker will be like this: + +`udp:\\[PUBLIC IP OR DOMAIN]:2571/announce` + +But if you choose only the *TCP* or the both options, *TCP* & *UDP*, the url will be like this one: + +`http:\\[PUBLIC IP OR DOMAIN]:2571/announce` + +Is very important to open the *port* you have define on the configuration file in your *firewall* or make the necessary changes if you are behind a *NAT*. if you don't do it the requests that arrives from the internet won't be able to forward to your tracker. + +If you enabled the *stats* you can access to them by any browser just tipyng the correct url. Be account to change port and the path you define in the configuration file: + +`http://[PUBLIC IP O DOMAIN]:[PORT]/[PATH]?mode=everything` + +For example: + +`http://192.168.58.63:2571/mytrackerstats?mode=everything` -`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969/tcp -v /PATH/CONFIG_FILE/:/etc/opentracker/ fortu/opentracker` That's it! -Now the bittorrent tracker is running and serving only the torrents that you want. If you want to add more torrents to your tracker, just stop the container, add the new `hash` to the `whitelist.txt` and start the container back. Also you can customize some configuration of the tracker by editing `opentracker.conf` file. +You can find more information on the opentracker project website: [https://erdgeist.org/arts/software/opentracker/](https://erdgeist.org/arts/software/opentracker/) + ## Thanks & Donations [Best wishes to the creators of opentracker!](http://erdgeist.org/arts/software/opentracker/) From d2e30e7e59bb323962435b8c67b6107812b2ef41 Mon Sep 17 00:00:00 2001 From: FoRTu Date: Mon, 13 Apr 2020 16:41:46 +0200 Subject: [PATCH 09/10] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20Fix=20stupid=20mi?= =?UTF-8?q?stakes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d98245a..a05c487 100644 --- a/README.md +++ b/README.md @@ -29,9 +29,10 @@ Now the bittorrent tracker is running and serving only the torrents that you wan Your tracker URL will be something like this: `http://[YOUR PUBLIC IP OR DOMAIN]:6969/announce` + `udp://[YOUR PUBLIC IP ORDOMAIN]:6969/announce` -By default in the `opentracker.conf` file the *TCP* and *UDP* protocols are enabled. So you can use any of two urls. be sure that you have youre firewall/NAT configured to recieve any request from the *6969* port in this case. +By default in the `opentracker.conf` file the *TCP* and *UDP* protocols are enabled. So you can use any of two urls. be sure that you have your firewall/NAT configured to recieve any request from the *6969* port in this case. Also you can customize some configuration of the tracker by editing `opentracker.conf` file. For example, change the port *6969* by another one, force only the *TCP* or *UDP* protocols, enable stats and how to access to them etc. @@ -94,7 +95,7 @@ Follow this steps to build your own public and open bittorrent tracker: listen.udp 0.0.0.0:2571 ``` -11. Is possible to enable the *stats* and the way of access to its. First of all is to enable it by uncommenting the next line. To haide or obfuscte the stats you can change the *path* too. In this case *mytrackerstats*: +11. Is possible to enable the *stats* and the way of access to its. First of all is to enable it by uncommenting the next line and if you want haide or obfuscte the stats, just change the *path* too. In this case *mytrackerstats*: ```bash access.stats_path mytrackerstats @@ -111,7 +112,7 @@ Follow this steps to build your own public and open bittorrent tracker: 15. Now you can run the next *docker run* command taking account of the changes you have done previously. You have to change the port number and the protocol you have define and the full path of the folder where you placed the `blacklist.txt` and the `opentracker.conf`files, were you have changed the configuration. ```bash - docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969/tcp -v /PATH/CONFIG_FILES/:/etc/opentracker/ fortu/opentracker + docker run -d --name opentracker -p 2571:2571/udp -v /PATH/CONFIG_FILES/:/etc/opentracker/ fortu/opentracker ``` Now your bittorrent tracker is running and listening on the TCP/IP *port* and the protocol you have define. The only thing you have todo is to add the *URL* of your tracker to your torrent files or magnet links, and the tracker will start to serve it. @@ -124,9 +125,9 @@ But if you choose only the *TCP* or the both options, *TCP* & *UDP*, the url wil `http:\\[PUBLIC IP OR DOMAIN]:2571/announce` -Is very important to open the *port* you have define on the configuration file in your *firewall* or make the necessary changes if you are behind a *NAT*. if you don't do it the requests that arrives from the internet won't be able to forward to your tracker. +Is very important to open the *port* you have define on the configuration file in your *firewall* or make the necessary changes if you are behind a *NAT*. If you don't do it the requests that arrives from the internet won't be able to forward to your tracker. -If you enabled the *stats* you can access to them by any browser just tipyng the correct url. Be account to change port and the path you define in the configuration file: +If you had enable the stats you can access to them by any browser just typing the correct url. Be account to change port and the path you define in the configuration file: `http://[PUBLIC IP O DOMAIN]:[PORT]/[PATH]?mode=everything` From ad288c3bd970f8bb0c0c3a2fbc15604d63ad7776 Mon Sep 17 00:00:00 2001 From: FoRTu Date: Mon, 13 Apr 2020 17:29:54 +0200 Subject: [PATCH 10/10] =?UTF-8?q?=F0=9F=9B=A0=EF=B8=8F=20mor=20errors=20fi?= =?UTF-8?q?xed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a05c487..a4f3f2d 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ Follow this steps to build your own public and open bittorrent tracker: 5. Staying in the same folder of the *Dockerfile*, run the build command: ```bash - docker build --no-cache=true -t fortu/opentracker . + docker build --no-cache=true -t myopentracker . ``` 6. Create a `blacklist.txt` file within a folder and copy there the `opentracker.conf` file too. This folder should be accessible by the container once we run it. @@ -112,7 +112,7 @@ Follow this steps to build your own public and open bittorrent tracker: 15. Now you can run the next *docker run* command taking account of the changes you have done previously. You have to change the port number and the protocol you have define and the full path of the folder where you placed the `blacklist.txt` and the `opentracker.conf`files, were you have changed the configuration. ```bash - docker run -d --name opentracker -p 2571:2571/udp -v /PATH/CONFIG_FILES/:/etc/opentracker/ fortu/opentracker + docker run -d --name opentracker -p 2571:2571/udp -v /PATH/CONFIG_FILES/:/etc/opentracker/ myopentracker ``` Now your bittorrent tracker is running and listening on the TCP/IP *port* and the protocol you have define. The only thing you have todo is to add the *URL* of your tracker to your torrent files or magnet links, and the tracker will start to serve it.