-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rtorrent module #344
rtorrent module #344
Conversation
Ok, I started to take a look at this but have failed to get it working. I am not sure if I am the one who is not familiar with rTorrent but nothing has worked here. Did u test it at all before sending this PR? Could you help me set everything up so I can take a gander at the rTorrent module? Edit: OK, seems like I got the RPC to work in rtorrent after a lot of research. Will start reviewing soon. |
Conflicts: maraschino/modules.py
- fixed typo causing password error - added connection verification - added some verbosity to the template (connection error, empty torrent list) - added debug logging for connection errors
Mh yeah usually adding "scgi_port = localhost:5000" in .rtorrent.rc should do the trick. The URL you need to enter in rtorrent module then is: scgi:https://127.0.0.1:5000 If your rtorrent is not running on the same machine however, you'd usually additionally set up apache httpd with mod_scgi and htaccess for security reasons instead of just binding rtorrent's scgi service directly to public ip. Example for apache configuration block:
In that case, URL for rtorrent module would be http:https://example.com/RPC2 and you need to enter user/pass for authentication. However, I found a typo in my code so login with user/pass would not have worked at all. Fixed that and added some verbosity, see latest commit. Ah and yes, I tested both login methods before push (rtorrent 0.9.3 / libtorrent 0.13.3) to avoid another stupid typo bug :) |
- added word-break and hyphens declarations so long torrent names don't break layout any longer. Tested on Chrome 32 and Firefox 27, feedback about other browsers welcome. - nicer formatting - removed unneeded stuff from stylesheet
Ye I managed to get this working. |
Mmh you were right if scgi was the only protocol option. However, as http and https are also supported, in addition to host/ip and port we'd need a select box for the protocol and another input box for the location (http:https://host/location). Could do that of course but I think it only makes configuration more complicated. Regarding module name - "rtorrent" is already used for the rtorrent-python module and I didn't want to use absolute imports. However, I'm still a python newbie and don't know much about best practices yet so if you know a better way to get around this I'll be happy to implement it :) |
- removed fetching of torrent file lists as this was really slow and the information wasn't used anyway; will maybe come back later in a torrent details view - added global and per-torrent up-/download-rate information - torrent list can be set to fixed size now
I see what you mean. But I still prefer to keep it with the other module's standards and have ip/port separate and if necessary have a dropdown with scgi/http/https. To be honest I only realised I needed to input the entire address one I looked at the code and that might be because I am just used to that. I see the conflict with having both things called "rtorrent" and I understand if you find it too much work but you can always try changing all the "rtorrent" references in the library to something else like "rtorrentlib" or you can try some more complex import commands. I do realise this is mostly detail so if you find it too complicated you are welcome to ignore this. If you can change the settings I will be happy to merge this! Thanks for the contribution anyways! |
- seperate input boxes for protocol, url and port in settings dialog - basic qualification and verification for configuration settings - if no port is defined, assume 80 for http and 443 for https - if protocol is scgi, ignore username / password
Allright, settings dialog changed. Regarding module name, I'll go with the current solution for now. |
- fix scrollbar in torrent list shown when not needed
@gugahoi is there a reason why this hasn't been merged? I'm planning on giving it a test anyway but I would be much rather be running your main branch than a fork. Or is there a fundamental reason why it can't or won't? |
@wrayan I am not having luck with this. I suspect that it may be something that I have done wrong... In the module it says I would investigate further but I have no idea where to start looking (which file has a mismatched tag on line 6, col 2?)... Any ideas? FWIW I am using nginx to provide xmlrpc via https on port 12322 (i.e. |
@wrayan after digging a little more I think my issue is caused by access via https while using a self signed cert... |
I am sorry, completely forgot about it @JedMeister. Is it working for you? |
NP @gugahoi. I couldn't get it to work directly via rTorrent sgci (I was using a unix socket which this code doesn't appear to support; but also tested after reconfiguring it to use localhost port 5000). Nor could I get it to work via the existing https port that I was already using for ruTorrent (web frontend for rTorrent). But I configured a new Nginx site to provide /RPC2 via localhost http:
Then it all worked fine. I imagine that if I had a proper (CA signed) https cert then https would work too. AFAIK by default Python requires CA https certs (fails on self signed) but I could be wrong and perhaps there is some other issue. Bottom line, yes it works. It could possibly do with a polish, but I don't know python very well nor do I know the Maraschino code so I won't be able to do that anytime soon. IMO it provides value as is. |
Exactly what I was hoping to hear 😄 |
Awesome. Thanks! 😄 |
@JedMeister thanks for reporting this. You're right, ssl doesn't seem to work at all. I'll look into it. |
First try of a rtorrent module based on Chris Lucas' rtorrent-python api and the utorrent module code.
Source doesn't look pretty and the template definately needs some more love but basic features are supported: