refs: #2310 create package

master
Nicolas Arenas 2025-06-25 07:30:58 +02:00
parent b20b0b8926
commit 8f32947383
31 changed files with 604 additions and 0 deletions

8
debian/NEWS vendored 100644
View File

@ -0,0 +1,8 @@
opentracker (0.0~git20210823.110868e-8) unstable; urgency=medium
This package now ships a different /etc/opentracker/opentracker-ipv6.conf
from the previously common /etc/opentracker/opentracker.conf. This is
because the IPv6 version breaks if an IPv4 listen IP is configured. See
bug #1053721.
-- Agathe Porte <gagath@debian.org> Sun, 10 Dec 2023 13:44:53 +0100

10
debian/README.debian vendored 100644
View File

@ -0,0 +1,10 @@
By default, the tracker is run in "private" mode using a whitelist access.
You need to explicitly list all of the torrent hashes that you want to announce
into the /etc/opentracker/whitelist.txt file.
If you want to switch to "public" mode, allowing to announce any torrent hash,
you must recompile the package. You need to comment the
FEATURES+=-DWANT_ACCESSLIST_WHITE option and uncomment the
FEATURES+=-DWANT_ACCESSLIST_BLACK option in the debian/rules file.
Switching to "public" mode is not recommended by the package maintainer.

6
debian/changelog vendored 100644
View File

@ -0,0 +1,6 @@
opengnsys-opentracker (1.0.0) unstable; urgency=medium
* Rename package to avoid conflicts with ubuntu packages
* Build without whitelist support
-- Nicolas Arenas <narenas@qindel.com> Tue, 24 Jun 2025 22:09:00 +0100

2
debian/clean vendored 100644
View File

@ -0,0 +1,2 @@
opengnsys-opentracker-ipv4/
opengnsys-opentracker-ipv6/

58
debian/control vendored 100644
View File

@ -0,0 +1,58 @@
Source: opengnsys-opentracker
Section: net
Priority: optional
Maintainer: Nicolas Arenas <narenas@qindel.com>
Build-Depends:
debhelper-compat (= 13),
libowfat-dev,
zlib1g-dev,
Standards-Version: 4.6.2
Homepage:
Vcs-Browser: https://ognproject.evlt.uma.es/gitea/narenas/opengnsys-opentracker.git
Vcs-Git: https://ognproject.evlt.uma.es/gitea/narenas/opengnsys-opentracker.git
Rules-Requires-Root: no
Package: opengnsys-opentracker-common
Architecture: all
Pre-Depends: ${misc:Pre-Depends}
Depends:
${misc:Depends},
Description: Open and free bittorrent tracker (common files)
opentracker is a open and free bittorrent tracker project. It aims for minimal
resource usage and is intended to run on your wlan router.
.
This package contains the common files for both IPv4 and IPv6 versions.
Breaks:
opentracker
Replaces:
opentracker
Package: opengnsys-opentracker
Architecture: any
Pre-Depends: ${misc:Pre-Depends}
Depends:
${misc:Depends},
${shlibs:Depends},
opengnsys-opentracker-common,
Description: Open and free bittorrent tracker (IPv4)
opentracker is a open and free bittorrent tracker project. It aims for minimal
resource usage and is intended to run on your wlan router.
.
This package contains the IPv4 version.
Breaks:
opentracker-common ,
Replaces:
opentracker-common ,
Package: opengnsys-opentracker-ipv6
Architecture: any
Pre-Depends: ${misc:Pre-Depends}
Depends:
${misc:Depends},
${shlibs:Depends},
opengnsys-opentracker-common,
Description: Open and free bittorrent tracker (IPv6)
opentracker is a open and free bittorrent tracker project. It aims for minimal
resource usage and is intended to run on your wlan router.
.
This package contains the IPv6 version.

33
debian/copyright vendored 100644
View File

@ -0,0 +1,33 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: opentracker
Upstream-Contact: Dirk Engling <erdgeist@erdgeist.org>
Source: https://erdgeist.org/arts/software/opentracker/
Files: *
Copyright: Dirk Engling <erdgeist@erdgeist.org>
License: Beerware
THE BEER-WARE LICENSE" (Revision 42):
As long as you retain this notice you can do whatever you want with this
stuff. If we meet some day, and you think this stuff is worth it, you can buy
me a beer in return.
Files: debian/*
Copyright:
2015 Kaliko Jack <kaliko@azylum.org>
2022-2024 Agathe Porte <gagath@debian.org>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

3
debian/dirs vendored 100644
View File

@ -0,0 +1,3 @@
etc/opentracker
usr/bin
var/lib/opentracker

3
debian/gbp.conf vendored 100644
View File

@ -0,0 +1,3 @@
[DEFAULT]
upstream-branch=upstream/latest
debian-branch=debian/latest

View File

@ -0,0 +1,2 @@
README
README_v6

View File

@ -0,0 +1 @@
debian/whitelist.txt etc/opentracker/

View File

@ -0,0 +1 @@
usr/share/man/man8/opentracker.8 usr/share/man/man8/opentracker-ipv6.8

View File

@ -0,0 +1 @@
debian/opentracker.1

View File

@ -0,0 +1,2 @@
opengnsys-opentracker-ipv6/opentracker-ipv6 usr/bin
debian/opentracker-ipv6.conf etc/opentracker

View File

@ -0,0 +1,2 @@
opengnsys-opentracker-ipv4/opentracker usr/bin
debian/opentracker.conf etc/opentracker/

106
debian/opentracker-ipv6.conf vendored 100644
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 ./blacklist
#
# 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 /etc/opentracker
#
# Tell opentracker which user to setuid to.
#
tracker.user _opentracker
#
# VI) opentracker can be told to answer to a "GET / HTTP"-request with a
# redirect to another location (shell option -r).
#
# tracker.redirect_url https://your.tracker.local/

14
debian/opentracker-ipv6.service vendored 100644
View File

@ -0,0 +1,14 @@
[Unit]
Description=OpenTracker Daemon (IPv6)
After=network.target
Documentation=man:opentracker
[Service]
User=_opentracker
PrivateTmp=yes
ExecStart=/usr/bin/opentracker-ipv6 -f /etc/opentracker/opentracker-ipv6.conf
ExecStop=/bin/kill -INT $MAINPID
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

73
debian/opentracker.1 vendored 100644
View File

@ -0,0 +1,73 @@
.TH OPENTRACKER "8" "July 2021" "opentracker" "User Commands"
.SH NAME
opentracker \- Open bittorrent tracker
.SH SYNOPSIS
.PP
\fBopentracker\fR
[ -\fBi\fR \fIip\fR ]
[ -\fBp\fR \fIport\fR ]
[ -\fBP\fR \fIport\fR ]
[ -\fBr\fR \fIredirect\fR ]
[ -\fBd\fR \fIdir\fR ]
[ -\fBu\fR \fIuser\fR ]
[ -\fBA\fR \fIip\fR ]
[ -\fBf\fR \fIconfig\fR ]
[ -\fBs\fR \fIlivesyncport\fR ]
[ -\fBw\fR \fIwhitelistfile\fR ]
.SH DESCRIPTION
.PP
This tracker is open in a sense that everyone announcing a torrent is welcome
to do so and will be informed about anyone else announcing the same torrent.
Only source IPs are accepted. The tracker implements a minimal
set of essential features only but was able respond to far more than 10000
requests per second on a Sun Fire 2200 M2 (that's where we found no more clients
able to fire more of our testsuite.sh script).
.SH OPTIONS
.TP
-\fBf\fR \fIconfig\fR
include and execute the config file
.TP
-\fBi\fR \fIip\fR
specify ip to bind to (default: *, you may specify more than one)
.TP
-\fBp\fR \fIport\fR
specify tcp port to bind to (default: 6969, you may specify more than one)
.TP
-\fBP\fR \fIport\fR
specify udp port to bind to (default: 6969, you may specify more than one)
.TP
-\fBr\fR \fIredirecturlspecify\fR
url where / should be redirected to (default none)
.TP
-\fBd\fR \fIdir\fR
specify directory to try to chroot to (default: ".")
.TP
-\fBu\fR \fIuser\fR
specify user under whose privileges opentracker should run (default: "nobody")
.TP
-\fBA\fR \fIip\fR
bless an ip address as admin address (e.g. to allow syncs from this address)
.TP
-\fBw\fR \fIfile\fR
specify whitelist file
\fB\-h, \-?, \-\-help\fP
show a help message and exit
.TP
\fB\-ht, \-\-host\fI HOST\fP
host (default: localhost)
.TP
\fB\-p, \-\-port\fI PORT\fP
port (default: 8080)
.TP
\fB\-mp, \-\-multiprocessor\fI PROCESS_COUNT\fP
define how many processes for the grammar checker
.TP
\fB\-t, \-\-test_page\fP
page to test the server on /
.TP
\fB\-on, \-\-opt-on\fR [\fIOPT\fR]...\fP
activate options
.TP
\fB\-off, \-\-opt-off\fR [\fIOPT\fR]...\fP
deactivate options

106
debian/opentracker.conf vendored 100644
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 ./blacklist
#
# 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 /etc/opentracker
#
# Tell opentracker which user to setuid to.
#
tracker.user _opentracker
#
# VI) opentracker can be told to answer to a "GET / HTTP"-request with a
# redirect to another location (shell option -r).
#
# tracker.redirect_url https://your.tracker.local/

14
debian/opentracker.service vendored 100644
View File

@ -0,0 +1,14 @@
[Unit]
Description=OpenTracker Daemon (IPv4)
After=network.target
Documentation=man:opentracker
[Service]
User=_opentracker
PrivateTmp=yes
ExecStart=/usr/bin/opentracker -f /etc/opentracker/opentracker.conf
ExecStop=/bin/kill -INT $MAINPID
ExecReload=/bin/kill -HUP $MAINPID
[Install]
WantedBy=multi-user.target

View File

@ -0,0 +1,25 @@
From: Agathe Porte <gagath@debian.org>
Date: Tue, 24 May 2022 14:36:47 +0200
Subject: testsuite: send 4 requests instead of infinity
For Debian autopkgtest needs, we want to run send a definite amount of
requests instead of an infinite amount. 4 requests should be enough, as
response time can be quite long.
Forwarded: not-needed
---
tests/testsuite.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/testsuite.sh b/tests/testsuite.sh
index dace2c6..fe480f5 100644
--- a/tests/testsuite.sh
+++ b/tests/testsuite.sh
@@ -1,6 +1,6 @@
#!/bin/sh
-while true; do
+for _ in $(seq 4); do
request_string="GET /announce?info_hash=0123456789012345678\
%$(printf %02X $(( $RANDOM & 0xf )) )\
&ip=$(( $RANDOM & 0xf )).$(( $RANDOM & 0xf )).13.16&port=$(( $RANDOM & 0xff )) HTTP/1.0\n"

1
debian/patches/series vendored 100644
View File

@ -0,0 +1 @@
0001-testsuite-send-4-requests-instead-of-infinity.patch

34
debian/postinst vendored 100644
View File

@ -0,0 +1,34 @@
#!/bin/sh
set -e
HOMEDIR=/var/lib/opentracker
case "$1" in
configure)
if ! getent passwd _opentracker > /dev/null 2>&1
then
useradd --system --user-group \
--home-dir "$HOMEDIR" \
--no-create-home \
--shel /bin/false \
--comment "Opentracker bittorrent tracker daemon" \
_opentracker
fi
if ! dpkg-statoverride --list "$HOMEDIR" >/dev/null 2>&1; then
dpkg-statoverride --update --add _opentracker _opentracker 0750 "$HOMEDIR"
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`${1}'" >&2
exit 1
;;
esac
#DEBHELPER#

65
debian/rules vendored 100755
View File

@ -0,0 +1,65 @@
#!/usr/bin/make -f
# See debhelper(7) (uncomment to enable)
# output every command that modifies files on the build system.
#DH_VERBOSE = 1
export DEB_BUILD_MAINT_OPTIONS += hardening=+all
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS)
# see ENVIRONMENT in dpkg-buildflags(1)
# package maintainers to append CFLAGS
export DEB_CFLAGS_MAINT_APPEND += -Wall -pedantic
#FEATURES+=-DWANT_ACCESSLIST_BLACK
#FEATURES+=-DWANT_ACCESSLIST_WHITE
#FEATURES+=-DWANT_IP_FROM_QUERY_STRING
FEATURES+=-DWANT_COMPRESSION_GZIP
#FEATURES+=-DWANT_IP_FROM_PROXY
#FEATURES+=-DWANT_LOG_NUMWANT -DWANT_MODEST_FULLSCRAPES
#FEATURES+=-DWANT_SPOT_WOODPECKER
FEATURES+=-DWANT_SYSLOGS
#FEATURES+=-DWANT_DEV_RANDOM
FEATURES+=-DWANT_RESTRICT_STATS
FEATURES+=-DWANT_NO_AUTO_FREE
export FEATURES
export LIBOWFAT_LIBRARY=/usr/lib
export PREFIX=/usr
# main packaging script based on dh7 syntax
%:
dh $@
LINKEDFILES = ../*.h ../*.c ../Makefile ../Makefile.*
# create a shadow directory for setting different build options.
# inspired from the vim source package
opengnsys-opentracker-%:
mkdir -p "$@"
cd "$@" && ln -s $(LINKEDFILES) .
override_dh_auto_clean:
dh_auto_clean
rm -rf opengnsys-opentracker-ipv4 opengnsys-opentracker-ipv6
override_dh_auto_build: opengnsys-opentracker-ipv4 opengnsys-opentracker-ipv6
STRIP=true FEATURES="$(FEATURES)" dh_auto_build --sourcedirectory=opengnsys-opentracker-ipv4 -- LIBOWFAT_HEADERS=/usr/include/libowfat
STRIP=true FEATURES="$(FEATURES) -DWANT_V6" dh_auto_build --sourcedirectory=opengnsys-opentracker-ipv6 -- LIBOWFAT_HEADERS=/usr/include/libowfat
mv opengnsys-opentracker-ipv6/opentracker opengnsys-opentracker-ipv6/opentracker-ipv6
dpkg-parsechangelog -l debian/NEWS
override_dh_auto_install:
# do not call the install target of the upstream makefile, because
# executables are renamed
dh_auto_install -S none --sourcedirectory=opengnsys-opentracker-ipv4
dh_auto_install -S none --sourcedirectory=opengnsys-opentracker-ipv6
rm -rf debian/opengnsys-opentracker-common/usr/bin

4
debian/salsa-ci.yml vendored 100644
View File

@ -0,0 +1,4 @@
include:
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
- https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml

1
debian/source/format vendored 100644
View File

@ -0,0 +1 @@
3.0 (quilt)

View File

@ -0,0 +1,2 @@
# upstream has no known bug tracker
upstream-metadata-missing-bug-tracking

4
debian/tests/control vendored 100644
View File

@ -0,0 +1,4 @@
Tests: testsuite
Depends:
@,
netcat-openbsd,

8
debian/tests/testsuite vendored 100755
View File

@ -0,0 +1,8 @@
#!/bin/bash
set -euo pipefail
cp -a tests $AUTOPKGTEST_TMP
cd $AUTOPKGTEST_TMP
bash ./tests/testsuite.sh

2
debian/upstream/metadata vendored 100644
View File

@ -0,0 +1,2 @@
Repository: https://erdgeist.org/gitweb/opentracker
Repository-Browse: https://erdgeist.org/gitweb/opentracker/

5
debian/watch vendored 100644
View File

@ -0,0 +1,5 @@
version=4
opts="mode=git, gitmode=full, pgpmode=none, pretty=0.0~git%cd.%h, repack, compression=xz" \
https://erdgeist.org/gitweb/opentracker \
HEAD

8
debian/whitelist.txt vendored 100644
View File

@ -0,0 +1,8 @@
# By default the tracker is run in "private" mode, using this whitelist.
#
# Add one hash per torrent you want to allow your tracker to announce.
# Example:
# 285862f84278e5e08f3a4f6606d2e768e594d5c3
#
# To switch to "public" mode, allowing to announce any torrent hash, comment
# the "access.whitelist" option in /etc/opentracker/opentracker.conf