Announcement

Collapse
No announcement yet.

Rutorrent autodl-irssi error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rutorrent autodl-irssi error

    Whenever I try to make changes to autodl-irssi preferences via rutorrent I get the following error:

    "Could not save to autodl.cfg! Error: Unknown error: AJAX error, status: error, Exception info: Bad Request"

    Permissions are correct. Irssi is running under the same user that owns the configuration files. When I open the screen I see that irssi is working. Does anyone have any idea how to go about getting the plugin to work?

    00:40 -!- Irssi: You are running autodl-irssi v1.64 | autodl-trackers v264
    00:40 -!- Irssi: Bugs and Requests Issues * autodl-community/autodl-irssi * GitHub
    00:40 -!- Irssi: Help and Discussion #autodl-community on irc.p2p-network.net
    00:40 -!- Irssi: Successfully loaded tracker files
    00:40 -!- Irssi: Reading configuration files
    00:40 -!- Irssi: GUI server listening on 127.0.0.1:50000
    00:40 -!- Irssi: Configuration files loaded
    00:40 -!- Irssi: Loaded 0 releases from history file.
    00:40 -!- ___ _
    00:40 -!- |_ _|_ _ _____(_)
    00:40 -!- | || '_(_-<_-< |
    00:40 -!- |___|_| /__/__/_|
    00:40 -!- Irssi v0.8.19 - Irssi

    My installation: Ubuntu 16.04

    Install Dependencies


    sudo apt-get -y install irssi libarchive-zip-perl libnet-ssleay-perl libhtml-parser-perl libxml-libxml-perl libdigest-sha-perl libjson-perl libjson-xs-perl libxml-libxslt-perl php-xml

    Install Autodl-irssi

    mkdir -p ~/.irssi/scripts/autorun
    cd ~/.irssi/scripts
    curl -sL http://git.io/vlcND | grep -Po '(?<="browser_download_url": ")(.*-v[\d.]+.zip)' | xargs wget --quiet -O autodl-irssi.zip
    unzip -o autodl-irssi.zip
    rm autodl-irssi.zip
    cp autodl-irssi.pl autorun/
    mkdir -p ~/.autodl
    touch ~/.autodl/autodl.cfg Install ruTorrent Plugin

    cd /var/www/html/rutorrent/plugins
    sudo rm -rf autodl-irssi
    sudo git clone GitHub - autodl-community/autodl-rutorrent: ruTorrent plugin for autodl-community fork of autodl-irssi autodl-irssi
    sudo cp autodl-irssi/_conf.php autodl-irssi/conf.php
    sudo chown -R www-data:www-data autodl-irssi Configure Autodl-irssi

    Edit plugin configuration:
    sudo nano autodl-irssi/conf.php

    $autodlPort = 50000;
    $autodlPassword = "13c414f687e2e326";


    nano ~/.autodl/autodl.cfg
    [options]gui-server-port = 50000
    gui-server-password = 13c414f687e2e326
    upload-type = rtorrent
    rt-dir = /home/downloads/auto
    rt-label = Auto

    nano ~/.autodl/autodl2.cfg
    [options]
    rt-address = 127.0.0.1:5000

  • #2
    Figured out the problem. It was mod security.


    Two solutions, both require modifying your rutorrent.conf under /etc/apache2/sites-enabled/


    1. Disable it outright in the directory:


    <Directory "/var/www/html/rutorrent/plugins/autodl-irssi">
    <IfModule security2_module>
    SecRuleEngine Off
    </IfModule>
    </Directory>


    2. Search for triggered rules and add those exceptions (more secure).


    a) Find culprits:


    grep ModSecurity /var/log/apache2/error.log | sed -e 's#^.*\[id "\( [0-9]*\).*hostname "\([a-z0-9\-\_\.]*\)"\].*uri "#\1 \2 #' | cut -d\" -f1 | sort -n | uniq -c | sort -n


    b) Look for entries as such:


    1 980130 seedbox.example.com /rutorrent/plugins/autodl-irssi/writeconfig.php (rutorrent in this string can also be apache alias)


    The first number is number of times triggered. The second number is the code of the rule triggered. Copy this.


    c) modify rutorrent.conf


    <LocationMatch "/webui/php/setsettings.php">
    <IfModule security2_module>
    SecRuleRemoveById 941160
    SecRuleRemoveById 942240
    </IfModule>
    </LocationMatch>


    <LocationMatch "/webui/plugins/autodl-irssi/writeconfig.php">
    <IfModule security2_module>
    SecRuleRemoveById 200002
    SecRuleRemoveById 200003
    SecRuleRemoveById 920130
    SecRuleRemoveById 920140
    SecRuleRemoveById 949110
    SecRuleRemoveById 980130
    </IfModule>
    </LocationMatch>


    <LocationMatch "/robots.txt">
    <IfModule security2_module>
    SecRuleRemoveById 920350
    </IfModule>
    </LocationMatch>


    <LocationMatch "/sitemap.xml">
    <IfModule security2_module>
    SecRuleRemoveById 920350
    </IfModule>
    </LocationMatch>


    As a reference here's my full rutorrent.conf


    Alias /webui "/var/www/html/rutorrent"


    <Directory "/usr/lib/cgi-bin">
    AllowOverride None
    Options +Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    Order allow,deny
    Allow from all
    </Directory>


    <Directory "/var/www/html/rutorrent">
    AuthName "Restricted Access"
    AuthType Basic
    Require valid-user
    AuthUserFile /home/user/.htpasswd
    </Directory>


    #<Directory "/var/www/html/rutorrent/plugins/autodl-irssi">
    # <IfModule security2_module>
    # SecRuleEngine Off
    # </IfModule>
    #</Directory>


    <LocationMatch "/webui/php/setsettings.php">
    <IfModule security2_module>
    SecRuleRemoveById 941160
    SecRuleRemoveById 942240
    </IfModule>
    </LocationMatch>


    <LocationMatch "/webui/plugins/autodl-irssi/writeconfig.php">
    <IfModule security2_module>
    SecRuleRemoveById 200002
    SecRuleRemoveById 200003
    SecRuleRemoveById 920130
    SecRuleRemoveById 920140
    SecRuleRemoveById 949110
    SecRuleRemoveById 980130
    </IfModule>
    </LocationMatch>


    <LocationMatch "/robots.txt">
    <IfModule security2_module>
    SecRuleRemoveById 920350
    </IfModule>
    </LocationMatch>


    <LocationMatch "/sitemap.xml">
    <IfModule security2_module>
    SecRuleRemoveById 920350
    </IfModule>
    </LocationMatch>


    CustomLog /var/log/apache2/rutorrent.log vhost_combined
    ErrorLog /var/log/apache2/rutorrent_error.log

    Comment


    • #3
      Mod Evasive also triggers AJAX errors. Modified PageCount and SiteCount as Such:

      <IfModule mod_evasive20.c>
      DOSHashTableSize 3097
      DOSPageCount 25
      DOSSiteCount 50
      DOSPageInterval 1
      DOSSiteInterval 1
      DOSBlockingPeriod 10

      DOSEmailNotify [email protected]
      #DOSSystemCommand "su - someuser -c '/sbin/... %s ...'"
      DOSLogDir "/var/log/apache2/mod_evasive"
      DOSWhitelist 127.0.0.1
      </IfModule>

      Comment

      Working...
      X