@zhongdao
2019-03-25T21:33:45.000000Z
字数 9067
阅读 5872
未分类
Opentracker is a free (licensed as beerware) BitTorrent peer tracker software (a special kind of HTTP or UDP server software) that is designed to be fast and to have a low consumption of system resources.
Opentracker是一款免费(许可为beerware)BitTorrent对等跟踪软件(一种特殊的HTTP或UDP服务器软件),设计速度快,系统资源消耗低。
Several instances of opentracker may be run in a cluster, with all of them synchronizing with each other. Besides the Hypertext Transfer Protocol (HTTP) opentracker may also be connected to via User Datagram Protocol (UDP), which creates less than half of the tracker traffic HTTP creates.[1] It supports IPv6, gzip compression of full scrapes, and blacklists of torrents. Because there have already been cases of people being accused of copyright violation by the fact that their IP address was listed on a BitTorrent tracker,[2] opentracker may mix in random IP address numbers[citation needed] for the purpose of plausible deniability.
opentracker的几个实例可以在集群中运行,所有这些实例都相互同步。除了超文本传输协议(HTTP)之外,opentracker还可以通过用户数据报协议(UDP)连接,这会产生不到一半的HTTP创建的跟踪器流量。[1] 它支持IPv6,完全的gzip压缩和种子黑名单。因为已经有人因为他们的IP地址被列在BitTorrent跟踪器上而被指控侵犯版权,[2] 为了合理的否认,opentracker可能会混入随机IP地址编号。
It runs completely in RAM, accounting for much of its speed advantage over other tracker software. It is written in C and based on the library libowfat that manages network connections. For some new functionality like the UDP support with IPv6[3] or the syncing of several instances of BitTorrent tracker software, new extensions to the BitTorrent protocol were made.
它完全在RAM中运行,与其他跟踪器软件相比,它具有很大的速度优势。它是用C语言编写的,基于管理网络连接的库 libowfat。对于一些新功能,如UDP支持IPv6 [3]或同步BitTorrent跟踪器软件的几个实例,新的BitTorrent协议扩展。
位于公网上:
无需做防火墙或者路由器上的映射,直接运行即可。若有防火墙,只开放对外服务的端口即可。
位于内网:
需要做NAT映射,将对外公布的外部ip和端口,作为各个接收端的tracker 地址
下载OpenTracker依赖库及源码,编译。
cvs -d :pserver:cvs@cvs.fefe.de:/cvs -z9 co libowfat
cd libowfat
make
cd ..
# LEGACY: cvs -d:pserver:anoncvs@cvs.erdgeist.org:/home/cvsroot co opentracker
git clone git://erdgeist.org/opentracker
cd opentracker
make
Usage: ./opentracker [-i ip] [-p port] [-P port] [-r redirect] [-d dir] [-u user] [-A ip] [-f config] [-s livesyncport]
-f config include and execute the config file
-i ip specify ip to bind to (default: *, you may specify more than one)
-p port specify tcp port to bind to (default: 6969, you may specify more than one)
-P port specify udp port to bind to (default: 6969, you may specify more than one)
-r redirecturlspecify url where / should be redirected to (default none)
-d dir specify directory to try to chroot to (default: ".")
-u user specify user under whose priviliges opentracker should run (default: "nobody")
-A ip bless an ip address as admin address (e.g. to allow syncs from this address)
Example: ./opentracker -i 127.0.0.1 -p 6969 -P 6969 -f ./opentracker.conf -i 10.1.1.23 -p 2710 -p 80
中文翻译:
Usage: ./opentracker [-i ip] [-p port] [-P port] [-r redirect] [-d dir] [-u user] [-A ip] [-f config] [-s livesyncport]
-f 配置文件
-i ip 绑定的IP (default: *, you may specify more than one)
-p port 绑定的TCP端口 (default: 6969, you may specify more than one)
-P port 绑定的UDP端口 (default: 6969, you may specify more than one)
-r 导向的URL (default none)
-d dir chroot 的目录 (default: ".")
-u user 指定以哪个用户权限来运行 (default: "nobody")
-A ip 管理的IP地址 (e.g. to 从这个地址同步)
Example: ./opentracker -i 127.0.0.1 -p 6969 -P 6969 -f ./opentracker.conf -i 10.1.1.23 -p 2710 -p 80
# 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 /path/to/whitelist
#
# 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 /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 https://your.tracker.local/
# opentracker 配置文件
#
# I) opentracker会在地址上用tcp和udp同时监听。
# (注意:如果省略,端口6969是隐含的).
# 如果没有给出listen选项(这里或命令行),opentracker侦听0.0.0.0:6969 tcp和udp。
#
# 下一个变量确定是否在事件中处理udp套接字事件loop(默认设置为0).或在阻塞读取中处理专用worker线程。
#你必须在之前设置值,listen.ctp_udp 或者 listen.udp的语句才会生效。但是你可以为每个listen语句重新设置,通常你应该保持它在配置文件的顶部。
#
# 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
#
# 为了只监听tcp或udp端口,按照如下方式列出
#
# listen.tcp 0.0.0.0
# listen.udp 192.168.0.1:6969
#
# 注意: 为upd监听使用0.0.0.0 会产生惊讶的结果。
# 在该套接字上发送的应答包不一定具有该请求客户端可能期望的源地址,可能是这个接口上的任何地址。
#
# II) 如果opentracker以非开放模式运行,则将其指向包含所有种子哈希的文件(脚本选项 -w)
# access.whitelist /path/to/whitelist
# 或者,如果opentracker编译为允许黑名单(脚本选项 -b)
# access.blacklist ./blacklist
#
# 同时编译黑白名单是没有意义的和不可能的。所以编译时选择一个选项。文件格式是简单直接的:
# "<hex info hash>\n<hex info hash>\n..."
#
# 如果你不想授予任何人权限来访问你的统计信息,在Makefile中设置 WANT_RESTRICT_STATS 选项,并将允许访问统计信息的IP放在这里
# access.stats 192.168.0.23
#
# 有另外一种方法来隐藏你的统计信息。你可以混淆路径。通常它位于/stats 但是你可以配置它到你的tracker的任何路径上。
# access.stats_path stats
#
# III) 实时同步使用udp多播数据包来保持一组opentrackers集群同步。此选项告诉opentracker要侦听的端口接收同步数据包。ip地址告诉opentracker,在哪个接口interface加入那些报文将到达的组播组。(shell选项-i 192.168.0.1 -s 9696),端口9696是默认值。
#
# livesync.cluster.listen 192.168.0.1:9696
#
# 注意将打开两个udp套接字。一个在IP地址0.0.0.0端口9696,会加入多播组 224.0.42.23来接收进入的udp数据包。 一个在192.168.0.1端口9696上输出所有的udp数据包。
# 截至目前,如果opentracker是使用WANT_SYNC_LIVE功能编译构建的,必须给出一个且只有一个ip地址。
#
# IV)在群集中运行的Tracker之间的同步仅限于来自可信的IP地址的数据包。虽然源IP验证很完美,opentracker的作者信任正确的应用程序隧道tunnels,过滤器和LAN设置的应用(shell选项-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
#
# 这是旧风格(基于http)的异步tracker同步的管理ip
#
# batchsync.cluster.admin_ip 10.1.1.1
#
# V) 管理丢弃行为的权限
# 放入opentracerk会chroot/chdir的目录。 所有的黑/白名单文件必须放在哪个目录(shell选项 -d)
#
# tracker.rootdir /usr/local/etc/opentracker
#
# 告诉opentracker对哪个用户setuid
#
# tracker.user nobody
#
# VI) opentracker可以被告知回应“GET / HTTP"请求使用重定向另一个位置(shell选项 -r)
#
# tracker.redirect_url https://your.tracker.local/
执行, 同时通过80,6969对外提供服务
./opentracker -i 172.16.252.249 -p 6969 -P 6969
或者不指定ip
./opentracker -p 6969 -P 6969
其中 172.16.252.249 是内网ip,
对外公开的tracker地址则替换为外网ip
如果对外的外网ip是 39.106.199.67那么announce地址为:
任选其一即可:
http://39.106.199.67:6969/announce
udp://39.106.199.67:6969/announce
有时为了让服务开机即运行。可以加入/etc/rc.local
也可以即时运行
nohup ./opentracker -p 6969 -P 6969
nohup ./opentracker -p 7070 -P 7070
nohup ./opentracker -p 7071 -P 7071
nohup ./opentracker -p 7072 -P 7072
编译时,修改Makfile
FEATURES+=-DWANT_SYNC_LIVE
配置好配置文件,然后
livesync.cluster.listen 192.168.0.1:9696
livesync.cluster.node_ip 192.168.0.4
livesync.cluster.node_ip 192.168.0.5
livesync.cluster.node_ip 192.168.0.6
默认是 6969端口的tcp和udp.
./opentracker -f opentracker.conf
Clone
git://erdgeist.org/opentracker
https://erdgeist.org/gitweb/opentracker
OpenTracker官网:
http://erdgeist.org/arts/software/opentracker/
OpenTracker Wiki:
https://en.wikipedia.org/wiki/Opentracker
An opentracker gitweb
http://erdgeist.org/gitweb/opentracker/
Comparison of BitTorrent tracker software
https://en.wikipedia.org/wiki/Comparison_of_BitTorrent_tracker_software