1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/opentracker_ynh.git synced 2024-09-03 19:46:34 +02:00
This commit is contained in:
Éric Gaspar 2024-05-16 09:56:52 +02:00
parent f04236fb9d
commit 4261884ae9
2 changed files with 157 additions and 3 deletions

106
conf/Makefile2 Normal file
View file

@ -0,0 +1,106 @@
# $Id$
# 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
STRIP?=strip
#FEATURES+=-DWANT_V4_ONLY
#FEATURES+=-DWANT_ACCESSLIST_BLACK
#FEATURES+=-DWANT_ACCESSLIST_WHITE
#FEATURES+=-DWANT_DYNAMIC_ACCESSLIST
#FEATURES+=-DWANT_SYNC_LIVE
#FEATURES+=-DWANT_IP_FROM_QUERY_STRING
# If you want gzip support to be compiled in, uncomment the next include.
# You can further modify the behaviour by setting DWANT_COMPRESSION_GZIP_ALWAYS
# in Makefile.gzip
include Makefile.gzip
# If you want zstd support to be compiled in, uncomment the next include.
# You can further modify the behaviour by setting DWANT_COMPRESSION_ZSTD_ALWAYS
# in Makefile.zstd
#include Makefile.zstd
#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
# You need libowfat version 0.34 to allow for automatic release of chunks during
# full scrape transfer, if you rely on an older versions, enable this flag
#FEATURES+=-DWANT_NO_AUTO_FREE
# Is enabled on BSD systems by default in trackerlogic.h
# on Linux systems the include Makefile adds -lbsd
#include Makefile.arc4random
#FEATURES+=-D_DEBUG_HTTPERROR
#FEATURES+=-D_DEBUG_RANDOMTORRENTS
GIT_VERSION=$(shell sh -c 'command -v git >/dev/null && test -d .git && git rev-parse HEAD || echo _git_or_commit_not_found_')
OPTS_debug=-D_DEBUG -g -ggdb # -pg -fprofile-arcs -ftest-coverage
OPTS_production=-O3
CFLAGS+=-I$(LIBOWFAT_HEADERS) -DGIT_VERSION=$(GIT_VERSION) -Wall -pipe -pthread -Wextra #-ansi -pedantic
LDFLAGS+=-L$(LIBOWFAT_LIBRARY) -lowfat -pthread
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 $(DESTDIR)$(BINDIR)

View file

@ -2,7 +2,7 @@
# #
# I) Address opentracker will listen on, using both, tcp AND udp family # I) Address opentracker will listen on, using both, tcp AND udp family
# (note, that port 6969 is implicite if ommitted). # (note, that port 6969 is implicit if omitted).
# #
# If no listen option is given (here or on the command line), opentracker # If no listen option is given (here or on the command line), opentracker
# listens on 0.0.0.0:6969 tcp and udp. # listens on 0.0.0.0:6969 tcp and udp.
@ -44,17 +44,65 @@
# listing, so choose one of those options at compile time. File format # listing, so choose one of those options at compile time. File format
# is straight forward: "<hex info hash>\n<hex info hash>\n..." # is straight forward: "<hex info hash>\n<hex info hash>\n..."
# #
# IIa) You can enable dynamic changesets to accesslists by enabling
# WANT_DYNAMIC_ACCESSLIST.
#
# The suggested way to work with dynamic changeset lists is to keep a
# main accesslist file that is loaded when opentracker (re)starts and
# reloaded infrequently (hourly or daily).
#
# All changes to the accesslist (e.g. from a web frontend) should be
# both appended to or removed from that file and sent to opentracker. By
# keeping dynamic changeset lists, you can avoid reloading huge
# accesslists whenever just a single entry is added or removed.
#
# Any info_hash (format see above) written to the fifo_add file will be
# kept on a dynamic add-changeset, removed from the dynamic
# delete-changeset and treated as if it was in the main accesslist file.
# The semantic of the respective dynamic changeset depends on whether
# WANT_ACCESSLIST_WHITE or WANT_ACCESSLIST_BLACK is enabled.
#
# access.fifo_add /var/run/opentracker/adder.fifo
#
# Any info_hash (format see above) written to the fifo_delete file will
# be kept on a dynamic delete-changeset, removed from the dynamic
# add-changeset and treated as if it was not in the main accesslist
# file.
#
# access.fifo_delete /var/run/opentracker/deleter.fifo
#
# If you reload the accesslist by sending SIGHUP to the tracker process,
# the dynamic lists are flushed, as opentracker assumes thoses lists are
# merged into the main accesslist.
#
# NOTE: While you can have multiple writers sending lines to the fifos,
# any writes larger than PIPE_BUF (see your limits.h, minimally 512
# bytes but usually 4096) may be interleaved with data sent by other
# writers. This can lead to unparsable lines of info_hashes.
#
# IIb)
# If you do not want to grant anyone access to your stats, enable the # 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 # WANT_RESTRICT_STATS option in Makefile and bless the ip addresses
# allowed to fetch stats here. # or network allowed to fetch stats here.
# #
# access.stats 192.168.0.23 # access.stats 192.168.0.23
# access.stats 10.1.1.23
# #
# There is another way of hiding your stats. You can obfuscate the path # 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 # to them. Normally it is located at /stats but you can configure it to
# appear anywhere on your tracker. # appear anywhere on your tracker.
# #
# access.stats_path stats # access.stats_path stats
#
# II
# If opentracker lives behind one or multiple reverse proxies,
# every http connection appears to come from these proxies. In order to
# take the X-Forwarded-For address instead, compile opentracker with the
# WANT_IP_FROM_PROXY option and set your proxy addresses or networkss here.
#
# access.proxy 10.0.1.23
# access.proxy 192.0.0.0/8
#
# III) Live sync uses udp multicast packets to keep a cluster of opentrackers # III) Live sync uses udp multicast packets to keep a cluster of opentrackers
# synchronized. This option tells opentracker which port to listen for # synchronized. This option tells opentracker which port to listen for
@ -103,4 +151,4 @@
# VI) opentracker can be told to answer to a "GET / HTTP"-request with a # VI) opentracker can be told to answer to a "GET / HTTP"-request with a
# redirect to another location (shell option -r). # redirect to another location (shell option -r).
# #
# tracker.redirect_url https://your.tracker.local/ # tracker.redirect_url https://your.tracker.local/