Anope IRC Services

Please login or register.

Login with username, password and session length
Advanced search  

News:

Pages: [1]   Go Down

Author Topic: Geo IP [module request]  (Read 9251 times)

0 Members and 1 Guest are viewing this topic.

deiks

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 139
  • Shizle my nizle
Geo IP [module request]
« on: November 03, 2010, 10:39:53 PM »

Hi,

I wanna request geo ip module which scans connections upon connecting and uses sajoin to some defined channel.
Example: if user is from USA it forces user to #us etc.


But also I want it to delay about 2 seconds before forcing.

Guys on #anope told me that it is possible with denora, and more difficult with anope.
So lets try...

Regards
Logged

Jobe

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1023
    • Anope IRC Services
Re: Geo IP [module request]
« Reply #1 on: November 04, 2010, 08:42:10 AM »

There is http://alpha.users.mdbnet.net/modules/denora/ircd_geoajoin.c however it requires the SVN version of Denora of at minimum revision 362

You can download the svn version using the command:
svn co http://denorastats.org/svn/denora/trunk denora-svn
Logged
Your IP: ()
My IRC Status:

Come along and visit http://www.anopequotes.org/

deiks

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 139
  • Shizle my nizle
Re: Geo IP [module request]
« Reply #2 on: November 04, 2010, 06:35:15 PM »

Hi,

Thanks, I'll try it.
Can u edit it to add sjoin delay about two seconds. It's becouse of bopm scanner, it sajoins user and it floods channel when banned users quiting.
So it waits 2 seconds, and then sjoin. And also check if user is still online, then sjoin. Not to send null parameter, you know :D

Thanks
Logged

Jobe

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1023
    • Anope IRC Services
Re: Geo IP [module request]
« Reply #3 on: November 04, 2010, 07:41:45 PM »

I'm affraid that's not something I know how to do yet sorry.
Logged
Your IP: ()
My IRC Status:

Come along and visit http://www.anopequotes.org/

deiks

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 139
  • Shizle my nizle
Re: Geo IP [module request]
« Reply #4 on: November 04, 2010, 09:51:55 PM »

Thanks in any way.

In which format are country codes

US , UK, DE etc.?

Will that resolve hosts like

comcast.net
Logged

katsklaw

  • Supporter
  • Anope User
  • Offline Offline
  • Posts: 537
Re: Geo IP [module request]
« Reply #5 on: November 04, 2010, 10:00:31 PM »

Quote from: src code
   "countrycode is a 2 letter ISO 3166-1 alpha-2 country code, ?? for\n"
   "unknown or ** for everyone\n"
   "channels is a single channel or a comma (,) seperate list of channels",

Use the source, Luke! ;P
Logged

deiks

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 139
  • Shizle my nizle
Re: Geo IP [module request]
« Reply #6 on: November 04, 2010, 11:06:11 PM »

Want ask to be sure :P

katsklaw, when u are here already :D can u help about this timer :P
Logged

katsklaw

  • Supporter
  • Anope User
  • Offline Offline
  • Posts: 537
Re: Geo IP [module request]
« Reply #7 on: November 05, 2010, 12:16:20 AM »

Want ask to be sure :P

katsklaw, when u are here already :D can u help about this timer :P

Assuming Denora still uses Anope's callback (timer), it would be easy.

Jobe, http://wiki.anope.org/index.php/Tutorials:Modules:Callbacks
Logged

Jobe

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1023
    • Anope IRC Services
Re: Geo IP [module request]
« Reply #8 on: November 05, 2010, 08:55:41 AM »

I know how to use grep :P Just havnt had time to look into it is all.

Will that resolve hosts like

comcast.net
The module doesnt use rDNS at all, it uses Denora's GeoIP support which uses ONLY the IP to look up the country using the GeoIP DB found in the Denora installation directory (you can update it from http://www.maxmind.com/app/geolitecountry using the binary format)
« Last Edit: November 05, 2010, 10:06:45 AM by Jobe »
Logged
Your IP: ()
My IRC Status:

Come along and visit http://www.anopequotes.org/

deiks

  • Anope User
  • Offline Offline
  • Gender: Male
  • Posts: 139
  • Shizle my nizle
Re: Geo IP [module request]
« Reply #9 on: November 05, 2010, 12:22:10 PM »

Yeah, thats quite good explanation for advanced user. But for me is ...

Could someone find about 15 minutes of time to explain it better. What should I do with geoIP.dat and this timer?
I'm noob with C
Logged

katsklaw

  • Supporter
  • Anope User
  • Offline Offline
  • Posts: 537
Re: Geo IP [module request]
« Reply #10 on: November 05, 2010, 04:50:41 PM »

The ircd already knows the users IP to start with as it's part of the connection proccess, so it doesn't need to resolve comcast.net from the go.

Where did the "I know how to use grep" comment fit in?  ???
Logged

Jobe

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1023
    • Anope IRC Services
Re: Geo IP [module request]
« Reply #11 on: November 05, 2010, 05:28:39 PM »

Where did the "I know how to use grep" comment fit in?  ???
You always used to be an advocate of using existing modules to learn how to code new modules ;)
Logged
Your IP: ()
My IRC Status:

Come along and visit http://www.anopequotes.org/

katsklaw

  • Supporter
  • Anope User
  • Offline Offline
  • Posts: 537
Re: Geo IP [module request]
« Reply #12 on: November 05, 2010, 10:07:51 PM »

Still am, just don't see the connection. Oh well, not that important.  ;D
Logged

Jobe

  • Contributor
  • *
  • Offline Offline
  • Gender: Male
  • Posts: 1023
    • Anope IRC Services
Re: Geo IP [module request]
« Reply #13 on: November 05, 2010, 10:51:12 PM »

Updated to allow custom delay in seconds per entry:
http://alpha.users.mdbnet.net/modules/denora/ircd_geoajoin.c
Logged
Your IP: ()
My IRC Status:

Come along and visit http://www.anopequotes.org/
Pages: [1]   Go Up