Added opentracker

This commit is contained in:
Ash Leece 2020-03-24 22:47:19 +00:00
parent a3111b8c16
commit 4007d16e77
7 changed files with 227 additions and 0 deletions

36
opentracker/Dockerfile Normal file
View File

@ -0,0 +1,36 @@
FROM alpine
MAINTAINER Lednerb <code@lednerb.de>
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 \
&& cd opentracker \
&& make \
&& 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
EXPOSE 6969
CMD opentracker -f /etc/opentracker/opentracker.conf

21
opentracker/LICENSE Normal file
View File

@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016 Sascha Brendel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

55
opentracker/README.md Normal file
View File

@ -0,0 +1,55 @@
# 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.
## 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:
`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969 lednerb/opentracker-docker`
This will bind the port `6969` to the docker container (UDP and TCP) and you're good to go.
## How to run a _customized_ opentracker instance
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.
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 .`
After building the docker image successfully you can start up a container:
`docker run -d --name opentracker -p 6969:6969/udp -p 6969:6969 yourfancyname/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. 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`
## 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.
## 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 ;-)

View File

View File

@ -0,0 +1,9 @@
version: "3"
services:
tracker:
build: .
ports:
- 8080:6969
volumes:
- ./:/etc/opentracker/
restart: unless-stopped

View File

@ -0,0 +1,106 @@
# opentracker config file
#
# I) Address opentracker will listen on, using both, tcp AND udp family
# (note, that port 6969 is implicite if ommitted).
#
# If no listen option is given (here or on the command line), opentracker
# listens on 0.0.0.0:6969 tcp and udp.
#
# The next variable determines if udp sockets are handled in the event
# loop (set it to 0, the default) or are handled in blocking reads in
# dedicated worker threads. You have to set this value before the
# listen.tcp_udp or listen.udp statements before it takes effect, but you
# 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.tcp_udp 0.0.0.0
# listen.tcp_udp 192.168.0.1:80
# listen.tcp_udp 10.0.0.5:6969
#
# To only listen on tcp or udp family ports, list them this way:
#
# listen.tcp 0.0.0.0
# listen.udp 192.168.0.1:6969
#
# Note, that using 0.0.0.0 for udp sockets may yield surprising results.
# An answer packet sent on that socket will not necessarily have the
# source address that the requesting client may expect, but any address
# on that interface.
#
# 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
#
# or, if opentracker was compiled to allow blacklisting (shell option -b)
#
# 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
# is straight forward: "<hex info hash>\n<hex info hash>\n..."
#
# If you do not want to grant anyone access to your stats, enable the
# WANT_RESTRICT_STATS option in Makefile and bless the ip addresses
# allowed to fetch stats here.
#
# access.stats 192.168.0.23
#
# There is another way of hiding your stats. You can obfuscate the path
# to them. Normally it is located at /stats but you can configure it to
# appear anywhere on your tracker.
#
# 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
# incoming live sync packets. The ip address tells opentracker, on which
# interface to join the multicast group, those packets will arrive.
# (shell option -i 192.168.0.1 -s 9696), port 9696 is default.
#
# livesync.cluster.listen 192.168.0.1:9696
#
# Note that two udp sockets will be opened. One on ip address 0.0.0.0
# port 9696, that will join the multicast group 224.0.42.23 for incoming
# udp packets and one on ip address 192.168.0.1 port 9696 for outgoing
# udp packets.
#
# As of now one and only one ip address must be given, if opentracker
# was built with the WANT_SYNC_LIVE feature.
#
# IV) Sync between trackers running in a cluster is restricted to packets
# coming from trusted ip addresses. While source ip verification is far
# from perfect, the authors of opentracker trust in the correct
# application of tunnels, filters and LAN setups (shell option -A).
#
# livesync.cluster.node_ip 192.168.0.4
# livesync.cluster.node_ip 192.168.0.5
# livesync.cluster.node_ip 192.168.0.6
#
# This is the admin ip address for old style (HTTP based) asynchronus
# tracker syncing.
#
# batchsync.cluster.admin_ip 10.1.1.1
#
# V) Control privilege drop behaviour.
# Put in the directory opentracker will chroot/chdir to. All black/white
# list files must be put in that directory (shell option -d).
#
#
# tracker.rootdir /usr/local/etc/opentracker
#
# Tell opentracker which user to setuid to.
#
# tracker.user nobody
#
# VI) opentracker can be told to answer to a "GET / HTTP"-request with a
# redirect to another location (shell option -r).
#
tracker.redirect_url http://erdgeist.org/arts/software/opentracker/

View File