Kerwood / Rtorrent-Auto-Install

Auto install script for rtorrent with Rutorrent as GUI.
259 stars 109 forks source link

Multiple users, do you support it? #40

Closed ItsAdventureTime closed 9 years ago

ItsAdventureTime commented 9 years ago

Hi,

I just love your script, much better than Notos'. My question is, can you support multiple users?

Thanks.

jdupl commented 9 years ago

Perhaps I can implement it. Do you mean multiple instances of rutorrent with each a different user?

ItsAdventureTime commented 9 years ago

Hi,

Thanks for replying. I think it is possible just by using a single instance of rutorrent and rtorrent but multiple users. What do you think? So that it will save resources too. It's like a Wordpress site, single site, single server but multiple users. Because, I was thinking of creating a different VPS for the other user who wants to have his own seedbox.

Thanks.

jdupl commented 9 years ago

I don't think rtorrent supports that. Each system user would have his own instance or rtorrent. It is quite a complex task because sgci ports must not be share.

In terms of ressource, rtorrent is very lightweight and a VPS with 256MB of RAM would be capable to handle at least 5 users.

ItsAdventureTime commented 9 years ago

I see, sorry about that. I'm still a newbie and still learning Linux. And yes, I have no idea how rtorrent, rutorrent works. I heard there is something like xmlrpc and rutorrent needs a web server with PHP in order to function properly.

Good to hear that, at least I'm assured that rtorrent is very lightweight. How about ruTorrent? So, I guess you have to add something in Apache, that will let it access the different home directories of users wherein those will contain the ruTorrent files?

jdupl commented 9 years ago

Rutorrent files can be share. Rutorrent does not really run on the machine. It is the webserver that processes these files and sends them to your browser.

For simplicity, I think it weould be easier that each user has it's rutorrent files in his home (because of htprivate files). Each user would download in their home folder too.

The main question remains on how to "track" free scgi ports and how to seperate webui acess. Url can seperated by user http://ip.addr/user/ or by port http://ip.addr:userPort/rutorrent.

ItsAdventureTime commented 9 years ago

Sorry for the late reply. Oh, so what you are telling me is that each other /home/(username) will be having their own /rutorrent folders?

jdupl commented 9 years ago

This or maybe a folder in /var/www/"user". The downloads would be in the users' home.

dvu0704 commented 9 years ago

Hi jdupl,

Your previous rtorrent supported multi-user, not sure you dropped the multi-user?

It would be nice to add it back, so we can share same server with multi-instance/multi-user.

My real.... question is, how to I create or move second user's home folder to a new mount-point? I would like each user to use different disk to eliminate disk I/O problem.

I guess we can define each user download location from the their owned ".rtorrent.rc" file without the need of move their home folder?

And btw, do you support Ubuntu 14.x version? I installed your previous version on Ubuntu 14 last few week ago, I had manually modified a few things to made it work, also had to moved the rtorrent folder to /var/www/html in-order to bring-up rutorrent.

Is there an easy way to stop/start/restart rtorrent from the shell? I haven't find an easy way to do it :(

Last;y, how do you configure rtorrent upload speed more aggressive?

Thanks!

Kerwood commented 9 years ago

The script never supported multi users.

I guess you could change the scgi port number in the rtorrent.rc file and define in apache virtual host file, which scgi port to use based on either http port or domain name.

There is a script specifically for Ubuntu 14.04

There is a init script for starting/stopping/restarting rtorrent, but its not multiuser supported.

sudo service rtorrent-init stop
dvu0704 commented 9 years ago

Hi Kerwood,

Interesting, I have used your script few years now. I remember when I first installed it, it prompted to enter torrent user, password, etc... at the end of the script, it prompted if I want to create another rtorrent user, if I select yes, then I will enter new rtorrent account, etc.... otherwise I select no to exist and complete the installation.

Anyhow, I am about to re-install the rtorrent on Ubuntu server, I am seeing some issues with Debian-Wheezy from time to time, I also have problem format large disk with GPT partition, I ended up use other disk partition tool to get it partition and format properly.

BTW, do you guys accept donation? Maybe you can ping me privately with the info?

Thanks Kerwood.

Kerwood commented 9 years ago

That was definitely not my script :) ..

I always use Wheezy and never have problems with it. I made a simple guide for setting GTP tables up. Its in Danish but use google translate. http://linuxbloggen.dk/opret-en-partition-over-2tb/

No I dont accept donations, but if we meet some day, you can buy me a beer :) But i appreciate the thought.

Where are you from ?

dvu0704 commented 9 years ago

I am from US/CA, I can buy you a few beer if we ever meet.

Thanks for another GPT tables guide, the guide I was using is very much same as yours. I also learned how to use UUID mount point for auto start :)

I am still trying to figure it out how to make rtorrent uploads quicker, so I don't have to use second torrent client to handle uploads. Deluge client uploads very aggressive :), but not so good for other general uses.

Kerwood commented 9 years ago

What do you mean "upload quicker" ?.. The speed depends on requested peers.

dvu0704 commented 9 years ago

I am often upload my shares, speaking of fresh new upload torrent, I get average 20+ leeches, my total upload speed about 10MB+, but rtorrent only utilizing about 2MB max. When I download, it utilized all 10MB+, but never the same for upload.

Kerwood commented 9 years ago

Please use bits when referring to speed. And bytes to storeage. :)

That is weird. I really dont think that has anything to do with rtorrent. I can easily max my 250mbit upload bandwidth out with rtorrent. No problem.

dvu0704 commented 9 years ago

I have 100Mb up/100Mb down Internet line, I should be able to do 12MB nor down when there are 20+ leechers.

I know it's also depending your CPU/RAM and disk I/O too. My CPU utilized average 2% to 5%, in most cases, it's only utilized 1% of CPU speed. When I create new torrent, CPU utilized about 25% MAX.

I have noticed the different when I switched from my OS from Debian-Wheezy to Ubuntu, it's improved the upload speed 3x better.

for example, same size of torrent file, same amount of leechers, same computer, same version of rtorrent. Normally, my upload speed with Debian-Wheezy is about 1.x MB to 2.x MB. After switched the OS, it went up to average 2.x MB to 7.x MB which is not bad. I'm the only 1 seeder in this case, everyone else are leechers.

Same setup, same OS "Ubuntu" and using Deluge, it maxed out my upload speed at 12.x MB.

speaking of download speed, rtorrent is the winner, it always does good with downloads.

people who leeches from me with Deluge client, their ratio usually 3x higher than me, even I am not maxed out my line yet.

I do understand it's also depending on the peering too, but it's not in this case.

Anyhow, I'm staying with rtorrent, it's easy to work with and reliable client, t's also utilize less resources compare to other clients. If I could figure it out how to tunes it, it may work better.

Kerwood commented 9 years ago

Thats wierd.. Especially the switching fra Debian to Ubuntu part. Maybe theres some settings to tweak ? Also keep in mind that peers are a really varable factor in this equation.

I haven't experienced problems like that in my uploading days.

dvu0704 commented 9 years ago

I don't know how to teak the OS/Kernel. Remember, I am a newbie when it come to Linux? :)

I have been playing with the rtorrent settings, but no luck. Anyother weir thing is, some of the settings from rtorrent does not saved after made those changes.

  1. Under "Connection", I want to remove "Random port each time rtorrent starts". If I make the change, reboot the machine, this option checked again. This option worked fine with rtorrent version 0.9.3/0.13.3
  2. Under "Downloads", I want to remove "Check hash after download". this does not work either after reboot the machine.
  3. Under "General", Alternate list background colour" and "Date format" does not saved after reboot too.

All of those worked fine with previous version.

Kerwood commented 9 years ago

The first two options you have to make in your rtorrent.rc file. Settings in rutorrent, I am having problems with aswell.. I dont remember have those problems in the past. Maybe its a bug in rutorrent ?

dvu0704 commented 9 years ago

Yeah, I know I can enable those options from the rtorrent file which I did. But when option is not defined in the the rtorrent file, I should be able to make those changes from ruttorent and settings should saved/stored somewhere in the web server? I guess it's not the case here.

dvu0704 commented 9 years ago

BTW, I used to rent a dedicate seedbox 100Mb line from Xirvik. OMG, their rtorrent ran awesome fast regardless upload or download. I quit because I can't effort it anymore :(

Kerwood commented 9 years ago

Rutorrent is operating with the www-data user and is not able to write to the rtorrent.rc file. Making the changes manually in rtorrent.rc is the best way.

But the rutorrent settings not being stored is a pain in the ass!

dvu0704 commented 9 years ago

I hear you :).

I was hoping, if someone could make rtorrent to work on the Windows OS, that would be awesome for me and you can't complain about my Linux skills, lol.

Kerwood commented 9 years ago

Hehe.. I hope not :)

Just hang in there.. Every time you solve a problem, you get smarter :)

Kerwood commented 9 years ago

Hi dvu0704 .. I found out that rutorrent stores its default UI settings in /var/www/rutorrent/share/settings/uisettings.json so if you want change the standard settings for the UI, its in that file. Also look in the folder /var/www/rutorrent/share/users, there should be folder named as your username. In settings/uisettings.json in your user folder, is the settings for your user. Some times it seems that rutorrent does not load my users UI settings and therefore are loading the default. If you refresh the page with F5 it should load your settings again.

If you want (I have not tested this) you can make your changes to rutorrent in the GUI and copy your users uisettings.json file to the default. It would then load your settings every time.

sudo cp -v  /var/www/rutorrent/share/users/USERNAME/settings/uisettings.json /var/www/rutorrent/share/settings/uisettings.json 

Test it out.

dvu0704 commented 9 years ago

Hi Kerwood,

Nice finding, I will definitely look into this ASAP, ATM I am sleepy. Luckily, I decided to visit this page before I go bed :), I will make this change tomorrow and let you know how that goes?

Thanks again, great job.

dvu0704 commented 9 years ago

I have been busy for the last 16 hours :). I just got home not to long ago and tried what you suggested above, it worked :). My Ubuntu directory structures of course different with yours, just correct the path, all went well. Thanks for that.

Now, you need to figure it out how to fix the rotrrent service auto start please? :). I think it's some to do with permission, I am too good with Linux, I would let you take the lead for this :)

Thanks again, cheers....