Author Topic: Transmission torrent on LinuxMCE  (Read 4977 times)

davegravy

  • Addicted
  • *
  • Posts: 525
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #15 on: August 14, 2013, 08:10:38 pm »
Still haven't had a chance to check out your work, but one thing that I did with my setup that you might consider adding in the future is: use Transmission's on-complete events to trigger notifications through LMCE.

phenigma

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1002
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #16 on: August 21, 2013, 04:07:00 pm »
robwoodward75:
After setting up according to the included instructions I get a 403 IP Address Forbidden error trying to access the transmission status page.

Code: [Select]
403: Forbidden
Unauthorized IP Address.
Either disable the IP address whitelist or add your address to it.

So I edited /etc/default/transmission-daemon and added "-a 192.168.80.*" to the OPTIONS= line.  That gets past the 403 error.  Now it asks for a username and password.  Which appears to be "transmission"/"transmission".

It appears as though the interface is working.  I'm going to test a couple of torrents.

If you can fix up an install script that includes the edit to the config file then we can put a package together.  Then we can add it to the Add Software page, and work on more integration.

davegravy:
What is your level of transmission integration into lmce?  Are you currently using transmission events to trigger notifications?

J.

davegravy

  • Addicted
  • *
  • Posts: 525
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #17 on: August 21, 2013, 04:44:15 pm »
davegravy:
What is your level of transmission integration into lmce?  Are you currently using transmission events to trigger notifications?
J.

It's mostly not integrated, except that i have an on-complete script that Tranmission executes when a torrent completes. This on-complete script calls MessageSend which posts a pop-up notification to my orbiters. I started looking into having it also use email notification via LMCE.

Unrelated to LMCE is that I have the on-complete script calling Notify My Android to send push notices to my mobile devices.

phenigma

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1002
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #18 on: August 21, 2013, 04:47:19 pm »
It's mostly not integrated, except that i have an on-complete script that Tranmission executes when a torrent completes. This on-complete script calls MessageSend which posts a pop-up notification to my orbiters. I started looking into having it also use email notification via LMCE.

Unrelated to LMCE is that I have the on-complete script calling Notify My Android to send push notices to my mobile devices.

Would you mind sharing your scripts?  I'd really appreciate it.  Feel free to add them to the ticket.

J.

robwoodward75

  • Regular Poster
  • **
  • Posts: 48
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #19 on: August 28, 2013, 10:44:05 am »
Apologies all, been on holiday, and for some reason, no email notifications of your posts?!

I have updated the ticket with some new scripts and pages, including service management of transmission-daemon, the ability to change username and password, or disable login, and some way of connecting via SSL, which requires a mod to the Apache config (also on the ticket)

I'll try to go through the questions / statements you've added!!
Quote
Would you mind sharing your scripts?  I'd really appreciate it.  Feel free to add them to the ticket.
No problem, I added the following lines to the transmission-daemon settings.json, however, I use version 1.93, which does not support on complete scripts (I found this out later!) but reading the LinuxMCE Wiki, I believe it should work!!
Code: [Select]
   "script-torrent-done-enabled": true,
    "script-torrent-done-filename": "/usr/pluto/bin/MessageSend dcerouter -r 0 20 1 809 9 \"Transmission Torrent Download completed\n$TR_TORRENT_NAME\" 70 \"alert\" 182 \"30\" 251 \"??\"",

Quote
What is your level of transmission integration into lmce?
1.93 (The torrent site I use is quite strict on this, I had to roll it back from the updated one, apparently, they reckon higher versions give false stats?!  Not entirely sure myself, but it's a good site, and I don't want to be kicked off!!)

Quote
If you can fix up an install script that includes the edit to the config file then we can put a package together.
OK, I'll get to work on it now, I had posted a few comments on the ticket, but I guess here's better for chatting, the ticket is for updates and facts I guess!!

Thanks all for your interest!

UPDATE:
More humble apologies!  On reading the posts properly, realised you weren't actually talking to me on these!  Sorry Davegravy, hope I haven't stolen your thunder!

Further Update!:
For the install script, which I had previously created something at the beginning of this post, which includes the copying of the web pages from the location of the unpacked tar file, and the extra menu item addition in the  MCE database.  Excuse me for being a bit of a nube, but.... do I assume the copying of the web pages will be unnecessary, if it is incorperated, would I just need the apt-get install of transmission-daemon, the new database, /usr/pluto/bin script, settings.json changes and the update to apache and it's LinuxMCE-ssl update?

Sorry, I know you're busy with other stuff too, but I need some guidance to give you what you need to have a complete install.
« Last Edit: August 28, 2013, 11:35:06 am by robwoodward75 »

phenigma

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1002
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #20 on: August 28, 2013, 10:20:55 pm »
Hi Rob,

I hadn't been checking the ticket.  :)  The forum does send a single e-mail notification of new posts in topics, you may have to configure/enable it in the profile setup (I don't remember if it is automatic).  Trac I'm not so sure about.  I think those notifications are hitting my junk mail box, I'll check that.

I'll have a look at the items you've added and test them on my dev system.  Looking good so far.  Once there is an install-able package then further integration can be investigated as well.

Thanks for the work you are doing here!  It is really appreciated!

J.

robwoodward75

  • Regular Poster
  • **
  • Posts: 48
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #21 on: August 29, 2013, 03:50:59 pm »
Hi J,

I have hit a brick wall on the install script, basically, I have reached the limit of my bash scripting knowledge / ability, and after spending the last day or so googling around to try to find out what I'm doing wrong, I'm still drawing a blank!  Any help would be very gratefully received!!

Here's the scenario!

This is the line I'm trying to push into the /etc/transmission-daemon/settings.json:
   "script-torrent-done-filename": "/usr/pluto/bin/transmission-settings.sh torrentComplete $TR_TORRENT_NAME",

using the following function (and public declared variable for the settings file location):
Code: [Select]
transmissionSettings="/etc/transmission-daemon/settings.json"

changeSetting()
{
        #create a back-up of the current settings file
        backup="_"`date '+%Y%m%d%k%M%S'`".bak"
        oldSetting=$(grep "\"$1\":" $transmissionSettings|awk -F\: '{print $2}'|sed -e 's|\,||g' -e 's|^ *||g' -e 's| *$||g')

        if [ `echo ${oldSetting:0:1}`=='"' ]
        then
                sed -i$backup 's|"'$1'": '$oldSetting',|"'$1'": "'$2'",|' $transmissionSettings
        else
                sed -i$backup 's|"'$1'": '$oldSetting',|"'$1'": '$2',|' $transmissionSettings
        fi

        echo $transmissionSettings$backup
}

triggered by the following command:
Code: [Select]
changeSetting "script-torrent-done-filename" "/usr/pluto/bin/transmission-settings.sh torrentComplete \$TR_TORRENT_NAME"
However..........
Everytime I run it, in the debug console I get the following output:
++ sed -i_20130829144312.bak 's|"script-torrent-done-filename": "",|"script-torrent-done-filename": "/usr/pluto/bin/transmission-settings.sh' torrentComplete '$TR_TORRENT_NAME",|' /etc/transmission-daemon/settings.json
sed: -e expression #1, char 110: unterminated `s' command


Notice the really annoying extra single quotes now appearing in the sed line, making bash think the sed instruction is over, before I've finished it!!!! >:(

Can anyone help me please?!?!?! This is literally the last line(s) in the installer, so is really frustrating me now!! >:( ???

phenigma

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1002
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #22 on: August 30, 2013, 07:09:03 am »
Ouch.  I'll be able to have a closer look tomorrow.

J.

robwoodward75

  • Regular Poster
  • **
  • Posts: 48
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #23 on: August 30, 2013, 04:56:19 pm »
Hi Jason,

Stand down!!  Sanity and will-to-live has been restored!!  Asked a colleague of mine at work, Unix server guy, he managed to sort it out!!  Ticket is now updated with the package install script, which assumes the Web admin area is downloaded with an update from LinuxMCE, not part of the install.

There is also a final (....for the moment anyway!) update of the svn patch, and the settings script.

Let me know if the install script isn't quite what you expected / wanted!

phenigma

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1002
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #24 on: September 02, 2013, 09:31:20 am »
:)  Alright.  I'll work on installing this again and creating a device template and package for easy installation.

J.

robwoodward75

  • Regular Poster
  • **
  • Posts: 48
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #25 on: September 02, 2013, 11:26:41 am »
Thanks Jason,

I've added a new revision of the installer to the ticket, on realising I'd forgotten to add the following lines:
Code: [Select]
a2enmod proxy
a2enmod proxy_http

Which would stop the https proxy redirect to internal http port 9091 from working properly.  May show up as an error on the Apache restart if you've tried already.  Sorry about that!

Rob.
« Last Edit: September 02, 2013, 11:33:06 am by robwoodward75 »

phenigma

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1002
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #26 on: September 02, 2013, 09:04:09 pm »
Okay, I hope to get to a little of this today.

J.

robwoodward75

  • Regular Poster
  • **
  • Posts: 48
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #27 on: September 19, 2013, 11:16:34 am »
Hi Jason,

Sounds like you've done the work to include the transmission pages into the LinuxMCE, if only my "Add Software" section worked, I could add the "official" version in!!  (my "Add Software" is completely empty, so haven't been able to add anything from there since I built the damn thing!!)

Thanks for all your support and advice, I'll leave you in peace for a while before looking at the next steps for transmission integration!!  Though perhaps of making it separate transmission daemons per user?! (Modifying the user page to allow admin to permit / deny transmission daemons for each user)  So each user could only see their own downloads, and link whatever they wanted to wherever they wanted!!!!  I'll see how people get on with this first though!

Also had some thoughts on how to make the initial index.php of LinuxMCE's admin site a little easier to add new sections in, instead of keep adding lines like:

Code: [Select]
        case 'transmission-daemon':
                $output = new Template($dbADO);
                $output->setTemplateFileType('large');
                include_once('operations/others/transmissionDaemon.php');
                transmissionDaemon($output,$dbADO,$transmissionADO);
        break;

And having to get that put in through svn.  Put that section of code into the pluto_main database in a new field, and simply recall the contents of it if the menu selection is correct?!  Would make index.php a fair bit shorter too!!!  As above however, I'll leave you in peace for a while before trying to tackle anything like this!!

Cheers,
Rob.

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3012
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Transmission torrent on LinuxMCE
« Reply #28 on: September 19, 2013, 02:52:52 pm »
Rob,

the changes done will work within web admin. That's where you select the transmission tool. After you do, the web admin will automatically install the software and the menus will be amended.

gbutters

  • Regular Poster
  • **
  • Posts: 19
    • View Profile
Re: Transmission torrent on LinuxMCE
« Reply #29 on: September 23, 2013, 06:40:38 am »
Install fails on 1204.

Setting up lmce-transmission-client (2.0.0.46.13091728061) ...
ERROR 1133 (42000) at line 1: Can't find any matching row in the user table
dpkg: error processing lmce-transmission-client (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 lmce-transmission-client
E: Sub-process /usr/bin/dpkg returned an error code (1)