aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Pages: [1] 2

Author Topic: aMuleCMD: Update IPFilter  (Read 9209 times)

gav616

  • Guest
aMuleCMD: Update IPFilter
« on: January 07, 2010, 08:12:34 PM »

To be able to update the IPFilter using 'amulecmd'.

For example:
Code: [Select]
#!/bin/sh
amulecmd -c update ipfilter

Reason:
I wanna create a cron script to update the filter once a week.
either from the current URL in my config, or maybe you can also specify a url when issuing the cmd.
« Last Edit: January 07, 2010, 08:18:07 PM by gav616 »
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMuleCMD: Update IPFilter
« Reply #1 on: January 07, 2010, 08:30:04 PM »

Sure. How?

At the moment we have reload ipfilter.
1) I could add reload ipfilternet
2) I could change it to reload ipfilter local and reload ipfilter net (breaking reload ipfilter).
I find 2) cleaner. update ipfilter doesn't fit in well imho.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

gav616

  • Guest
Re: aMuleCMD: Update IPFilter
« Reply #2 on: January 07, 2010, 09:38:41 PM »

I agree with  you, my suggestion was an example, based on, well, not much  :D
Logged

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: aMuleCMD: Update IPFilter
« Reply #3 on: January 08, 2010, 08:27:55 AM »

(breaking reload ipfilter).
You don't necessarily have to. You can make reload ipfilter an alias of reload ipfilter local.

And you could maybe add a variant which accepts an url, such as reload ipfilter from <url>.
Logged
concordia cum veritate

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMuleCMD: Update IPFilter
« Reply #4 on: January 08, 2010, 03:49:45 PM »

Code: [Select]
aMulecmd$ help reload ipfilter
RELOAD IPFILTER: Reload IP Filter table.

Available extensions:
File    Reload current IP Filter table.
Net     Update IP Filter table from URL.

aMulecmd$ help reload ipfilter net
RELOAD IPFILTER NET: Update IP Filter table from URL.

aMulecmd$ reload ipfilter net
 > Operation was successful.
aMulecmd$ reload ipfilter net  http://bluetack.co.uk/config/level1.gz
 > Operation was successful.
aMulecmd$ reload ipfilter file
 > Operation was successful.
aMulecmd$ reload ipfilter
 > Operation was successful.
aMulecmd$ reload ipfilter file duh
This command should not have any parameters.
Type 'help reload ipfilter file' to get more help.
aMulecmd$
9948
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

gav616

  • Guest
Re: aMuleCMD: Update IPFilter
« Reply #5 on: January 08, 2010, 05:48:48 PM »

Marvellous! much appreciated  ;D

Now make it so it can only update if the file is newer then the existing one... (I like keeping you busy...:))
Reason:
Bluetack and other mirrors get hammed, it would be nice if we only updated when necessary.

edit*

I think the eMule mod MorphXT uses a system to only download when needed, might be helpful to look at the source code. (maybe)
« Last Edit: January 08, 2010, 05:54:16 PM by gav616 »
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMuleCMD: Update IPFilter
« Reply #6 on: January 08, 2010, 07:50:06 PM »

Might be helpful if you look at the source code and give a hint how this is supposed to work.
I think this could only be done for a special site, but not generally. But I'm open for suggestions.  :)
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

GonoszTopi

  • The current man in charge of most things.
  • Administrator
  • Hero Member
  • *****
  • Karma: 169
  • Offline Offline
  • Posts: 2685
Re: aMuleCMD: Update IPFilter
« Reply #7 on: January 08, 2010, 08:30:51 PM »

Basically, there are two ways to do it.

1) The server checks if the file is newer:
We need to include in the request an "If-Modified-Since" header, and the server should reply with a "304 Not modified" response if the file is unchanged.

2) We check if the file is newer on the server:
We send a HEAD request to the server, and then check the "Last-Modified" response header.
Logged
concordia cum veritate

gav616

  • Guest
Re: aMuleCMD: Update IPFilter
« Reply #8 on: January 10, 2010, 02:25:34 PM »

9949
Code: [Select]
gav ~ $  /usr/bin/amulecmd -c reload ipfilter net http://bluetack.co.uk/config/level1.gz
Unexpected parameter 'ipfilter'
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMuleCMD: Update IPFilter
« Reply #9 on: January 10, 2010, 03:34:50 PM »

Code: [Select]
amulecmd -c "reload ipfilter net http://bluetack.co.uk/config/level1.gz"
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

gav616

  • Guest
Re: aMuleCMD: Update IPFilter
« Reply #10 on: January 11, 2010, 12:29:38 AM »

 :o ;D
Logged

gav616

  • Guest
Re: aMuleCMD: Update IPFilter
« Reply #11 on: January 13, 2010, 02:37:06 PM »

Is it possible for multiple lists to be supported?

obviously they would have to be downloaded then merged together...
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMuleCMD: Update IPFilter
« Reply #12 on: January 13, 2010, 09:25:51 PM »

It would not be a big problem, but do you really think that's necessary?
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon

gav616

  • Guest
Re: aMuleCMD: Update IPFilter
« Reply #13 on: January 16, 2010, 02:43:45 PM »

It would not be a big problem, but do you really think that's necessary?

ability to mix and match the filters would be very useful.
e.g.
using two or three lists:
level1.gz - anti-p2p corps
badpeers.gz - anti-p2p clients

ect..
Logged

Stu Redman

  • Administrator
  • Hero Member
  • *****
  • Karma: 214
  • Offline Offline
  • Posts: 3739
  • Engines screaming
Re: aMuleCMD: Update IPFilter
« Reply #14 on: January 16, 2010, 07:33:28 PM »

Aren't these combined lists also available for download?

- I'd make it so that you can enter several URLs (separated by ';') instead of the single one.
Logged
The image of mother goddess, lying dormant in the eyes of the dead, the sheaf of the corn is broken, end the harvest, throw the dead on the pyre -- Iron Maiden, Isle of Avalon
Pages: [1] 2