SynoCommunity / spksrc

Cross compilation framework to create native packages for the Synology's NAS
https://synocommunity.com
Other
3.04k stars 1.24k forks source link

rutorrent SPK #75

Closed davida72 closed 9 years ago

davida72 commented 12 years ago

I use rutorrent as a bittorrent client. It's a front end to rtorrent. I've been running it for a year or so and it's rock solid but a pain to set up.

http://code.google.com/p/rutorrent/

Diaoul commented 12 years ago

What are pro/cons vs transmission?

davida72 commented 12 years ago

I don't know Transmission inside out, but Broadcatching (RSS) and tracker searching (including private sites) were two features that I felt were missing but available in rutorrent. Additionally, I found rutorrent's interface more intuitive probably due to it's similarity with uTorrent.

Other features that are in rutorrent that may or may not be available in Transmission:

Diaoul commented 12 years ago

Interesting indeed

Amelandbor commented 12 years ago

This would be great.

Diaoul commented 12 years ago

So the SPK would include rTorrent binary + a web interface, ruTorrent. I can see that there are plenty web interfaces for rTorrent : http://en.wikipedia.org/wiki/RTorrent Why that one? I think because it is similar to µTorrent?

Amelandbor commented 12 years ago

It is similar to µTorrent and it has a lot of plugins.

davida72 commented 12 years ago

In order to get rutorrent on my Synology, I have to install the rtorrent binary, then lighttpd as a web server and rutorrent as the interface. I followed the instructions here: http://forum.synology.com/wiki/index.php/RTorrent_ruTorrent_HowTo

I don't know how that process could be built into an SPK because I don't know enough about how they work. I assume an SPK is a package file with an installation script, a bit like the Nullsoft installer. Is that right?

As to whether it's best to use rutorrent or another web interface, I don't know. rutorrent development continues, both the main project and the plugins. I've also been using it without issues on my Synology for some time so it seems pretty robust.

Would love to see this.

Diaoul commented 12 years ago

That will be like the nzbget SPK: binary + PHP interface.

davida72 commented 12 years ago

Okay. What does the PHP interface sit on top of. The binaries? Or does it sit on a web server? Just curious.

Diaoul commented 12 years ago

The native web server of DSM. Files are dropped under the "web" share and the user web server is required to be launched.

davida72 commented 12 years ago

Okay, so maybe rutorrent could sit on top of the same. It would be more work but more elegant than running two web servers.

oursours commented 12 years ago

That would be really nice to do this spk. RuTorrent is really more powerfull than Transmission, just a few exemples :

-RSS torrent automations -auto-dl irssi plug in (monitor irc anonce chans for torrents ) -streaming plug in -ect ect

filoune commented 11 years ago

that would be nice !

Rutorrent / Rtorrent has a lot a powerfull plugins like :

loginmgr http://code.google.com/p/rutorrent/wiki/PluginLoginMgr?wl=en cookies http://code.google.com/p/rutorrent/wiki/PluginCookies?wl=en ext search http://code.google.com/p/rutorrent/wiki/PluginExtsearch?wl=en sheduler http://code.google.com/p/rutorrent/wiki/PluginScheduler?wl=en

and much more at http://code.google.com/p/rutorrent/wiki/Plugins?wl=en

We love Rutorrent / Rtorrent

nickiman commented 11 years ago

Interesting... I will start to watch this issue

brinskoj commented 11 years ago

Has any progress been made with this?

moneytoo commented 11 years ago

I gave it a shot. I'm not sure if we can compile it with GCC 4.21 without a patch...

libsub_root.a(thread_base.o): In function `thread_queue_hack::lock()':
/home/mdop/spksrc/cross/rtorrent/work-88f6281/rtorrent-0.9.2/src/thread_base.cc:69: undefined reference to `__sync_bool_compare_and_swap_4'
libsub_root.a(thread_base.o): In function `thread_queue_hack::unlock()':
/home/mdop/spksrc/cross/rtorrent/work-88f6281/rtorrent-0.9.2/src/thread_base.cc:70: undefined reference to `__sync_bool_compare_and_swap_4'
libsub_root.a(thread_base.o): In function `thread_queue_hack::push_back(void (*)(ThreadBase*))':
/home/mdop/spksrc/cross/rtorrent/work-88f6281/rtorrent-0.9.2/src/thread_base.cc:85: undefined reference to `__sync_bool_compare_and_swap_4'
libsub_root.a(thread_worker.o): In function `ThreadWorker::set_scgi(rpc::SCgi*)':
/home/mdop/spksrc/cross/rtorrent/work-88f6281/rtorrent-0.9.2/src/thread_worker.cc:70: undefined reference to `__sync_bool_compare_and_swap_4'
libsub_root.a(thread_worker.o): In function `torrent::thread_base::acquire_global_lock()':
/home/mdop/spksrc/cross/rtorrent/work-88f6281/install//usr/local/include/torrent/utils/thread_base.h:151: undefined reference to `__sync_add_and_fetch_4'
/home/mdop/spksrc/cross/rtorrent/work-88f6281/install//usr/local/include/torrent/utils/thread_base.h:153: undefined reference to `__sync_sub_and_fetch_4'
ui/libsub_ui.a(element_log_complete.o): In function `torrent::signal_bitfield::signal(unsigned int)':
/home/mdop/spksrc/cross/rtorrent/work-88f6281/install//usr/local/include/torrent/utils/signal_bitfield.h:55: undefined reference to `__sync_or_and_fetch_4'
/home/mdop/spksrc/cross/rtorrent/work-88f6281/install//usr/local/lib/libtorrent.so: undefined reference to `__sync_fetch_and_or_4'
/home/mdop/spksrc/cross/rtorrent/work-88f6281/install//usr/local/lib/libtorrent.so: undefined reference to `__sync_fetch_and_and_4'
/home/mdop/spksrc/cross/rtorrent/work-88f6281/install//usr/local/lib/libtorrent.so: undefined reference to `__sync_lock_test_and_set_4'
collect2: ld returned 1 exit status
make[5]: *** [rtorrent] Error 1
make[5]: Leaving directory `/home/mdop/spksrc/cross/rtorrent/work-88f6281/rtorrent-0.9.2/src'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/mdop/spksrc/cross/rtorrent/work-88f6281/rtorrent-0.9.2/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/mdop/spksrc/cross/rtorrent/work-88f6281/rtorrent-0.9.2'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/mdop/spksrc/cross/rtorrent/work-88f6281/rtorrent-0.9.2'
make[1]: *** [compile_target] Error 2
make[1]: Leaving directory `/home/mdop/spksrc/cross/rtorrent'
make: [arch-88f6281] Error 2 (ignored)

Checking optware it offers rtorrent only because they have old version (0.8.6) without atomic functions.

EDIT: As advised on several places, I used linux-atomic.c from latest gcc source and I was able to compile and run it on my NAS (88f6281). Other archs don't seem to compile straight away so I'm going to check that.

EDIT2: Neither xmlrpc-c isn't cross compile friendly. It took a while but I finally managed to compile&run it including the rutorrent interface. Now spk is getting closer.

moneytoo commented 11 years ago

SPK is finished bdf05a0cd5f4212ab6b55dd42cf2a7b4a071ed18, available for archs 88f6281 armada370 bromolow cedarview qoriq x86 (which are archs with gcc >= 4) in beta repo. Other archs might be available in the future (possibly using boost? I don't know much about it right now).

ruTorrent includes all plugins and all optional dependencies such as mediainfo or pgrep which seems needed for creating new torrents. I'm not really torrent user but I find ruTorrent working really well (using 88f6281). Downloading, seeding, serving downloaded files, creating screenshots, watch dirrectory, that all works. Feedback is welcomed. Please note that the cpuload plugin doesn't really tells cpu load since its formula is just wrong.

davida72 commented 11 years ago

Awesome! Thank you! Three things:

1) The default favicon is an eyesore. Could you use this one instead? [1] 2) I'd love to test this. Will it work on my DS411+? It's Atom D510 Dualcore + 1GB. 3) I'm not sure where to get the SPK.

[1] http://dl.dropboxusercontent.com/u/5454/junk/favicon.ico

moneytoo commented 11 years ago

1) It's the official icon in bigger resolution. I wondered myself whatever the shadow in bottom right corner was intentional or not. Maybe we should ask the creator :) 2) Your architecture is supported. Hopefully it will run. 3) http://packages.synocommunity.com/?beta=1

davida72 commented 11 years ago

Just installed it. Seems to be working great. Unfortunately I have to head out now but I'll look more closely later. I'll make a better icon too :P

A few warnings after installation: http://i.imgur.com/yYBVZvv.png

brinskoj commented 11 years ago

davida72, do you have those programs installed, stat and curl? Also, chmod +x /volume1/Synology/Torrents/.rtorrent/

moneytoo, thank you for working this. I don't know where to test this out. http://packages.synocommunity.com/?beta=1 is forbidden for me. I refresh the repo in Package Manager on the disk station and even tried with beta channel selected. I have a DS209+. Maybe this is related to https://github.com/SynoCommunity/spksrc/issues/624 ?

moneytoo commented 11 years ago

@brinskoj Unfortunately ruTorrent isn't available for architecture used in DS209+ right now.

davida72 commented 11 years ago

Here are some comments after using it for a couple of hours. Short version: works fine :)

1) I doubt it's Synology related, but the columns don't line up with the header properly. See [1] 2) It would be great if you could automate the errors found here [2] 3) Is there any way you could check that the listening port is open during installation. 4) Could you replace the favicon with the one I made here [3]. If it helps, it ends up at /volume1/web/rutorrent/favicon.ico 5) Could you change the install icon? I made a new one here. [3] Wasn't sure what size so I made a few.

[1] http://i.imgur.com/5WIjtMp.png [2] http://i.imgur.com/yYBVZvv.png [3] https://dl.dropboxusercontent.com/u/5454/junk/rutorrent_icons.zip

davida72 commented 11 years ago

Guides for the plugins can be found here. Might be worth adding to the description somehow.

http://forums.rutorrent.org/index.php?board=4.0

davida72 commented 11 years ago

Also, here's a plugin for Chrome that will send a torrent file to rutorrent. Works with Transmission too.

https://chrome.google.com/webstore/detail/remote-torrent-adder/oabphaconndgibllomdcjbfdghcmenci

brinskoj commented 11 years ago

@moneytoo Is that "right now" just for this beta testing of your rutorrent package before building for all synology arch? I do realize how much of a pain xmlrpc-c can be.

moneytoo commented 11 years ago

@davida72 Thanks for the icons.

1) Yeah, most probably ruTorrent issue - browser compatibility or something like that. 2) The permission issue is obvious so I will check that. I wonder about the two other missing binaries which should be available on Synology by default:

DiskStation> which curl
/usr/syno/bin/curl
DiskStation> which stat
/bin/stat

At least on my DS212+ they are. Are you using the latest DSM 4.2/4.3? Of course we could just add these binaries to the SPK but I would like to know why's that (anyone?). 3) Do you mean the internal port rTorrent and ruTorrent are using? It was just picked not to collide with other Synology/Synocommunity or other popular software. Experienced users can change it and those less experience should not run into such issues. Do you have in mind mechanism for detecting whatever port is free and select next in row if it isn't?

@brinskoj Honestly I don't know. I only tried compiling libtorrent but that is failing because of using std::tr1. That could be worked around by using boost which is already in spksrc but boost itself just doesn't compile for me. I want to check this soon but I have no idea how many other obstacles could be there. Another idea is to roll back these changes that require std:tr1 - from few files I looked it seems like possible but I'm not sure if it would really go that smooth.

davida72 commented 11 years ago

2) curl and stat are present and in the same directories you list. I'm using DSM 4.2. 3) AFAIK, all torrent software requires a listening port to seed properly. I have no beef with the port range you chose. I wondered if there was some way of establishing whether the user had set up their router correctly so that the appropriate listening ports were open. Perhaps I'm over-engineering it. I'm currently wondering why rutorrent says this:

http://i.imgur.com/jorZgTJ.png

moneytoo commented 11 years ago

@davida72 2) It's PHP open_basedir settings. I remembered this few times I had to check this but I forgot that again. I will fix that ;) 3) That is default setting. I have the same triangle but that's because I'm behind NAT and what the plugin does is that it uses one website to check that port on your public IP.

droidgren commented 11 years ago

I am running Running DSM 4.2 DS212+

Everything works except the errors already shown above (stat, and webserver user must have execute access to the rtorrent session directory)

Two other issues

1) In the select Directory dialog (Add torrent etc), the dropdown menu is blank, so I can't select any subdir to already chosen path. (Is this related to the plugin: _getdir ?) On the plugin page: https://code.google.com/p/rutorrent/wiki/Plugin_getdir it says: "Shows only directories to which rtorrent can write and which php can show." I have given rutorrent write acess to my directories but php is running as "nobody" user. I this correct? Maybe this explains the session access error too?

2) In rutorrent connection settings maximum memory usage is set to 820Mb, Isn't this i bit much on the most nas systems? I have 256mb ram.

Update: I added the torrent path to open_basedir in DSM settings and then it worked ;-) So now its only the stat error.

moneytoo commented 11 years ago

@droidgren 1) It's because of PHP open_basedir configuration. Next update will fix that (but you can disable open_basedir in PHP settings by setting it to empty string). 2) You are right, that doesn't seem optimal. I'm going to check that.

Updated version should fix mentioned issues. Please note that the even after updating max memory settings will stay the same unless you do uninstall&install (it's not taken care of since it's in testing).

droidgren commented 11 years ago

Thanks for 3.5-2 update. Now the stats is working and select Directory dropdown working again New (?)issues, probably related. 1) Move torrents data doesn't work (Using rightclik -> "Save to"), no error it just doesn't move. 2) Can't delete torrent data. Torrent disappear but not the data.

ghost commented 11 years ago

I am running Running DSM 4.3 DS1812+ I have two problems SSL CA from private tracker and how to open port tracker

moneytoo commented 11 years ago

@droidgren Both issues will be fixed by switching $datadir_runmode from rtorrent to webserver in rutorrent/plugins/datadir/conf.php. For some reasons the rtorrent option requires more relaxed open_basedir settings.

@MrOnyx Seems like rtorrent requires CA storage (is there even one on Synology?). We could add root certs from something like http://pki.google.com/roots.pem or Mozilla but would that solve the issue? Do private trackers use known CA or do they use self signed? Because other option is to patch rtorrent to accept cert.

droidgren commented 11 years ago

@moneytoo Nope, it didn't help. But when I added download path to open_basedir it worked again with datadir = rtorrent.

davida72 commented 11 years ago

Tried the new version. Great to see the new favicon and icon. It now starts with no warnings or errors in the log.

foshizzlemanizzle commented 11 years ago

mine runs like a charm except when im adding a rss feed with HTTPS then it runs alot of errors up.

and end with a comment: 06.09.2013 20:35:06] Error loading feed

anyone know how to fix this ?

awesome you made this btw... been waiting for this

moneytoo commented 11 years ago

If you have troubles connecting to https trackers or feeds, please post the site here (but only if that's appropriate) or email me. I would like to check if it's because of missing known CAs and adding them makes any sense or if there are any other issues.

ghost commented 11 years ago

I have problem on this tracker with CAs https://hdcenter.cc

moneytoo commented 11 years ago

@MrOnyx Not much of a surprise that they use StartCom (as the only one from usual root CAs that's free). Adding known CAs makes sense so I'm going to fix that.

foshizzlemanizzle commented 11 years ago

actually ive made a HTTP rss link instead of the GTTPS and then it worked... but sadly the only part that dont work are the unpacking... and unpacking to another destination aswell...

foshizzlemanizzle commented 11 years ago

08.09.2013 16:03:18] Unpacking finished with errors (/volume1/Torrents/Boern.Paa.Hospitalet.S01E01.DANiSH.PDTV.x264-TVBYEN/=>/volume1/Tv/)

foshizzlemanizzle commented 11 years ago

and ive noticed another bug.. when you rightclick on something you want to delete and remove.... it only remove it from the torrent list... the current titel still remain on the nas drive...

droidgren commented 11 years ago

Can you compile rTorrent 0.9.3 for the package? Because 0.9.2 is banned on many private trackers. Thanks

moneytoo commented 11 years ago

@droidgren 0.9.2 is the latest stable so definitely not upgrading this version. However second testing/unstable package in repo is possible, but not right now.

droidgren commented 11 years ago

@moneytoo Ok thanx, is it possible to replace the binary yourself without issues?

moneytoo commented 11 years ago

@droidgren You should be able to compile it yourself if you change the rtorrent & libtorrent-rakshasa versions. However to successfully compile you have to have libxml2-dev and curl-dev installed as this is one compile issues I have to fix/clean.

ghost commented 11 years ago

when the update comes with bug fixing for CAs

moneytoo commented 11 years ago

@MrOnyx It should be ready soon but meanwhile you can either apply the changes from 48e7bec95bbd84cfe49c24ab8b3c98c60d7e7e1f on your installation manually or disable ssl roots verification entirely setting network.http.ssl_verify_peer.set=0 also in /usr/local/rutorrent/var/.rtorrent.rc.

ghost commented 11 years ago

i have no access to / usr / local / rtorrent / var / .rtorrent.rc