abique / hefur Goto Github PK
View Code? Open in Web Editor NEWStandalone C++ BitTorrent tracker
License: MIT License
Standalone C++ BitTorrent tracker
License: MIT License
Steps to reproduce error:
$ git clone https://github.com/abique/hefur.git && cd hefur && docker build .
Got this error:
4.492 CMake Error at mimosa/CMakeLists.txt:10 (find_package):
4.492 Could not find a package configuration file provided by "Protobuf" with any
4.492 of the following names:
4.492
4.492 ProtobufConfig.cmake
4.492 protobuf-config.cmake
4.492
4.492 Add the installation prefix of "Protobuf" to CMAKE_PREFIX_PATH or set
4.492 "Protobuf_DIR" to a directory containing one of the above files. If
4.492 "Protobuf" provides a separate development package or SDK, be sure it has
4.492 been installed.
4.492
4.492
4.492 -- Found LibArchive: /usr/lib/x86_64-linux-gnu/libarchive.so (found version "3.4.3")
4.492 -- Configuring incomplete, errors occurred!
Cannot download torrent file from tracker using :6969/file/file.torrent?info_hash=XXXXXX.
Neat little simple tracker you have made, please keep developing it.
I get this error for all my torrents, created using transmission-create, contents is ~500M tar.gz file.
hefurd[24042]: 2015-12-14 00:50:17.0659 hefur: error: /var/lib/hefurd/5_0_1011_v1_1_2015_Sep_20.torrent: parse error
Thanks for your work Alexander. I got this error when running cmake:
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:91 (MESSAGE):
Could NOT find GnuTLS (missing: GNUTLS_LIBRARY GNUTLS_INCLUDE_DIR)
I can only use MIT licensed software (which Hefur is) and GnuTLS is distributed under GPL3, LGPL2.1 licenses. Is there any way I can use Hefur without GnuTLS?
While recursively iterating the torrent directory, symbolic links to directories are skipped.
I guess we would have to handle S_ISLNK
in mimosa/fs/find.cc.
The parsing of HTTP headers is broken for certain value of Accept-Encoding
when Hefur is behind a reverse proxy.
Apache config:
<VirtualHost *:443>
ServerName tracker.domain.com
(...)
<Location />
ProxyPass http://localhost:6969/
ProxyPassReverse http://localhost:6969/
ProxyPreserveHost On
</Location>
</VirtualHost>
Hefur is launched like this:
$ hefurd -torrent-dir /srv/tracker -bind-addr 127.0.0.1 -reverse-proxy-from 127.0.0.1 -reverse-proxy-header X-Forwarded-For
The problem arise here:
Lines 24 to 25 in 5136250
With qBittorrent, Apache sends the following request to Hefur:
Host: tracker.domain.com
User-Agent: qBittorrent/4.3.9
Accept-Encoding: gzip
X-Forwarded-For: 42.42.42.42
(...)
request.unparsedHeaders()
returns all headers and X-Forwarded-For
is found.
With Transmission, Apache sends the following request to Hefur:
Host: tracker.domain.com
User-Agent: Transmission/3.00
Accept: */*
Accept-Encoding: deflate, gzip, br, zstd
X-Forwarded-For: 42.42.42.42
(...)
request.unparsedHeaders()
returns only Accept: */*
If I remove Accept-Encoding
from the request sent by Apache (with RequestHeader unset Accept-Encoding
in <Location />
), then the request is parsed correctly and the real IP is found, but Hefur crash soon after with:
hefurd[28911]: hefurd: hefur/address.cc:133: hefur::Address& hefur::Address::operator=(const sockaddr*): Assertion 'false' failed.
So an announce request from Transmission seems totally broken: the real IP is not found, the response is bad (wrong values of seeders/leechers) and Transmission try to announce again every 8 seconds in a loop.
Everything is working fine with qBittorrent.
OS: Arch Linux
Hefur: 1.0
Apache: 2.4.51
qBittorrent: 4.3.9
Transmission: 3.00
It has been listed in manual/.gitignore file
Clang could finish building file without this file
BitTorrent v2 (which switches from SHA-1 to SHA-256) is gaining steam and is now supported by libtorrent and BiglyBT (Vuze/Azureus) continuation.
It would be great to have support for BitTorrent v2 in Hefur, since Debian uses Hefur and we are likely to want to use BitTorrent v2 as soon as possible.
When adding a torrent hefurctl should internally copy the torrent from to the folder.
Been running hefurd 1.0 for about two weeks on 5.15.28-1-MANJARO-ARM-RPI, and noticed that when I remove a .torrent file from /var/lib/hefurd, that the v1 is removed, but v2 entries are not.
The /file/
request handler only accepts SHA1 hashes, resulting in errors when requesting v2 torrents from the /stat
page.
Line 26 in f8b0fe6
More a question than an issue.
If i want hefur to serve IPv4 as well as IPv6 peers do i have to rum two instances of hefur on the server.
One with ipv6 flag and one without?
Change service user to non-default 'hefur' user and group, set user/group on /var/run/hefur, start hefurd service. Control file is created. Reboot /var/run/hefur is now back to hefur user/group.
By adding '' to the head section of 'page.html' you can have the page automatically refresh every 5 seconds to show latest stats. More elaboration should be done, such as making it togglable and adjusting the refresh time, but here is the basic way.
Option not found: -log-level=info. Try -help.
Usage: hefurctl [option]...
-add-torrent [] (the path to the torrent)
-quit (quit hefurd)
-release-logs (release logs)
-remove-torrent [] (the path to a torrent)
-remove-torrent-hash [*] (the info hash of the torrent in base16)
-socket [=/var/run/hefur/control] (the path to the control socket)
[log]
-log-color (enables colors in log)
-log-compression [=xz] (selection the compression method: identity, gzip, xz)
-log-file [=] (the path to the log file, it will be passed to strftime(3), ie: my-app-%Y-%m-%d.%H:%M:%S.log)
-log-level [=warning] (set the minimum log level, possible values are debug, info, warning, error, critical and fatal)
-log-rotation-interval [=0] (enables log file rotation based on interval in seconds)
Hi,
as the INSTALL files mention I am trying to build hefur on Debian 6, unfortunately it does not work. Here is the output below:
~/hefur/build$ CC=gcc CXX=g++ cmake -DCMAKE_INSTALL_PREFIX=/usr ..
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/home/user/hefur/build/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:/home/user/hefur/build/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
Do you know what I am doing wrong? or am I missing a package maybe?
Thx!
It would be useful to be able to remove registered torrents from hefur and any administration task.
Hello, I was unable to compile this using Ubuntu 14.04. I received the following errors:
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
from /root/hefur/mimosa/mimosa/http/handler.hh:7,
from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh: In member function ‘virtual bool hefur::AnnounceHandler::handle(mimosa::http::RequestReade
r&, mimosa::http::ResponseWriter&) const’:
/root/hefur/mimosa/mimosa/http/response.hh:93:21: error: ‘mimosa::http::Coding mimosa::http::Response::content_encoding_’ is protected
Coding content_encoding_;
^
/root/hefur/hefur/announce-handler.cc:18:14: error: within this context
response.content_encoding_ = mh::kCodingIdentity;
^
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
from /root/hefur/mimosa/mimosa/http/handler.hh:7,
from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh:92:21: error: ‘bool mimosa::http::Response::keep_alive_’ is protected
bool keep_alive_;
^
/root/hefur/hefur/announce-handler.cc:70:14: error: within this context
response.keep_alive_ = false;
^
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
from /root/hefur/mimosa/mimosa/http/handler.hh:7,
from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh:96:21: error: ‘std::string mimosa::http::Response::content_type_’ is protected
std::string content_type_;
^
/root/hefur/hefur/announce-handler.cc:71:14: error: within this context
response.content_type_ = "text/plain";
^
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
from /root/hefur/mimosa/mimosa/http/handler.hh:7,
from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh:91:21: error: ‘int mimosa::http::Response::status_’ is protected
int status_;
^
/root/hefur/hefur/announce-handler.cc:81:16: error: within this context
response.status_ = mh::kStatusServiceUnavailable;
^
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
from /root/hefur/mimosa/mimosa/http/handler.hh:7,
from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh:95:21: error: ‘int64_t mimosa::http::Response::content_length_’ is protected
int64_t content_length_; ///< -1: auto
^
/root/hefur/hefur/announce-handler.cc:97:16: error: within this context
response.content_length_ = buf->str().size();
^
In file included from /root/hefur/mimosa/mimosa/http/response-writer.hh:7:0,
from /root/hefur/mimosa/mimosa/http/handler.hh:7,
from /root/hefur/mimosa/mimosa/http/server-channel.hh:9,
from /root/hefur/hefur/announce-handler.cc:4:
/root/hefur/mimosa/mimosa/http/response.hh:95:21: error: ‘int64_t mimosa::http::Response::content_length_’ is protected
int64_t content_length_; ///< -1: auto
^
/root/hefur/hefur/announce-handler.cc:143:14: error: within this context
response.content_length_ = buf->str().size();
^
make[2]: *** [hefur/CMakeFiles/hefurd.dir/announce-handler.cc.o] Error 1
make[1]: *** [hefur/CMakeFiles/hefurd.dir/all] Error 2
make: *** [all] Error 2
Any idea what would cause this? I'm using the latest protobuf and g++ 4.8. I was able to make sense of the earlier errors which were mainly relted to missing libraries, but this one has me stumped.
Alternately is there a better OS to choose for compiling?
Thanks
If hefurd is restarted, all torrents have to be manually re-added rather than all torrents in configured directory /var/lib/hefurd/ getting automatically reloaded.
Web page is giving torrent contents file name (in my case a tar.gz file) as the torrent "name", this continues into web URL "http://:6969/file/5_0_1011_v1_1_2015_Sep_20.tar.gz.torrent?info_hash=aa82b3414a7dbb889ffdf15a7b28b75659231927". The torrent file is "5_0_1011_v1_1_2015_Sep_20.torrent", if you have already worked on putting file download in and it's not working this could be why, looking for a file that does not exist.
Installed via pacman.
Version 1.0-1
$hefurctl
[Date/Timestamp] error: /var/run/hefur/control: No such file or directory
Replace the program options by a configuration file.
Compute length for multifile torrent.
Some cache related headers might also be worth considering.
For what it's worth, the correct location on debian is /usr/share/xml/docbook/stylesheet/docbook-xsl/html/docbook.xsl
Either way, manual is not created automagically and breaks install, install of FILES manual/manual.html to DESTINATION share/doc/hefur/ should probably be optional or something
i'm not sure if is issue of mimosa, but
[ 3%] Building CXX object hefur/CMakeFiles/hefur-proto.dir/hefur.pb.cc.o
In file included from /tmp/makepkg/hefur-git/src/hefur/mimosa/mimosa/rpc/channel.hh:8:0,
from /tmp/makepkg/hefur-git/src/hefur/hefur/hefur.pb.h:37,
from /tmp/makepkg/hefur-git/src/hefur/hefur/hefur.pb.cc:5:
/tmp/makepkg/hefur-git/src/hefur/mimosa/mimosa/rpc/../channel.hh: In member function 'void mimosa::Channel<T, QueueType>::maxSize() const':
/tmp/makepkg/hefur-git/src/hefur/mimosa/mimosa/rpc/../channel.hh:46:14: error: return-statement with a value, in function returning 'void' [-fpermissive]
return max_size_;
^~~~~~~~~
make[2]: *** [hefur/CMakeFiles/hefur-proto.dir/build.make:71: hefur/CMakeFiles/hefur-proto.dir/hefur.pb.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:2348: hefur/CMakeFiles/hefur-proto.dir/all] Error 2
make: *** [Makefile:139: all] Error 2
greetings
This looks like an issue in Mimosa, but the test case is here.
The W3 Validator sends the following headers:
$ nc -l -p 8888
GET /stat HTTP/1.1
TE: deflate,gzip;q=0.3
Connection: TE, close
Cache-Control: max-age=0
Accept-Encoding: gzip, x-gzip, deflate, x-bzip2
Host: home.toofishes.net:8888
User-Agent: W3C_Validator/1.3
Hefur/Mimosa don't like this so much due to the "Connection: TE, close" bit which it cannot parse.
request parse error: syntax error, unexpected $end, expecting VALUE_CONNECTION
Go to https://github.com/abique/hefur/downloads and download the last version.
returns 404 Not found
1st make ~~> http://pastebin.com/vnKmRWKz
2nd make (error)
In file included from /root/hefur/mimosa/mimosa/http/request-writer.cc:3:0:
/root/hefur/mimosa/mimosa/http/message-writer.hxx: In instantiation of 'mimosa::http::MessageWriter<Channel, Message>::~MessageWriter() [with Channel = mimosa::http::ClientChannel; Message = mimosa::http::Request]':
/root/hefur/mimosa/mimosa/http/request-writer.hh:18:57: required from here
/root/hefur/mimosa/mimosa/http/message-writer.hxx:28:9: error: ambiguous default type conversion from 'mimosa::RefCountedPtrmimosa::stream::Buffer'
/root/hefur/mimosa/mimosa/http/message-writer.hxx:28:9: error: candidate conversions include 'template mimosa::RefCountedPtr::operator mimosa::RefCountedPtr() const [with U = U; T = mimosa::stream::Buffer]'
/root/hefur/mimosa/mimosa/http/message-writer.hxx:28:9: error: type 'class mimosa::RefCountedPtrmimosa::stream::Buffer' argument given to 'delete', expected pointer
make[2]: *** [mimosa/mimosa/http/CMakeFiles/mimosa-http.dir/request-writer.cc.o] Error 1
make[1]: *** [mimosa/mimosa/http/CMakeFiles/mimosa-http.dir/all] Error 2
make: *** [all] Error 2
There are some errors (warnings) in 1st make, but they didn't stop the process.
PS: I fixed the errors "nettle/sha1.h" 2 and 3 downloading the files and putting them into the nettle's folder.
In the "Run the Server" block, -scan-interval is noted as being measured in seconds:
-scan-interval [=60] (the duration in seconds between two torrent-dir scans)
However, in the "White List" subheading, it reads:
-scan-interval (interval is in minutes)
There is en error while starting hefur with both http and https ports provided:
fatal: failed to listen on the port 2052: Address already in use
and no other messages even if debug
log-level set.
Any other process not using provided ports (http and https), checked with netstat -lptun
heufr's process starting, but listening only http server, not https.
Tried both tagged 1.0 and git upstream code.
OS: Ubuntu 20.04.1 x64
Compilers, build tools: gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
, g++ (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0
, cmake version 3.16.3
, GNU Make 4.2.1
Build options: -DHEFUR_CONTROL_INTERFACE=OFF -DCMAKE_INSTALL_PREFIX=/usr
Start options: -torrent-dir /var/lib/hefur/torrents -http-port 2052 -https-port 2053 -http-cert /etc/ssl/certs/example.pem -http-key /etc/ssl/private/example.pem -udp-port 0 -max-torrent-name 255 -disable-file-page -disable-peers-page -max-torrent-size 102400 -reverse-proxy-header "CF-Connecting-IP" -log-level debug -log-file /var/log/hefur.log
When running hefurd on a new host with -ipv6 I get the error message: "hefur: fatal: failed to listen on the port 6969: Cannot assign requested address". Other processes don't have any problems listening to the port, for example nc -6 -l -p 6969 (when hefurd isn't running).
OS: Ubuntu 20.04, amd64. Hefur as from git today.
I would like to know if it's possible to use this as a completely open tracker?
So, no whitelist. I want it to just index anything a client asks.
Hefur currently has no systemd service in it's repo. I'd happily contribute one if this would be accepted.
Design and implement private tracker support.
timestamp ip port downloaded uploaded key
All of this can be done with a plugin interface, or with IPCs. But as we can build a plugin which forwards requests by IPCs to an other process, then the plugin interface solves both solutions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.