Anope IRC Services

Denora Stats (discontinued) => Denora Development (Read Only) => Topic started by: deiks on November 03, 2010, 10:39:53 PM

Title: Geo IP [module request]
Post by: deiks 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
Title: Re: Geo IP [module request]
Post by: Jobe 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
Title: Re: Geo IP [module request]
Post by: deiks 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
Title: Re: Geo IP [module request]
Post by: Jobe on November 04, 2010, 07:41:45 PM
I'm affraid that's not something I know how to do yet sorry.
Title: Re: Geo IP [module request]
Post by: deiks 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
Title: Re: Geo IP [module request]
Post by: katsklaw 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
Title: Re: Geo IP [module request]
Post by: deiks 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
Title: Re: Geo IP [module request]
Post by: katsklaw 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
Title: Re: Geo IP [module request]
Post by: Jobe 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 (http://www.maxmind.com/app/geolitecountry) using the binary format)
Title: Re: Geo IP [module request]
Post by: deiks 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
Title: Re: Geo IP [module request]
Post by: katsklaw 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?  ???
Title: Re: Geo IP [module request]
Post by: Jobe 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 ;)
Title: Re: Geo IP [module request]
Post by: katsklaw on November 05, 2010, 10:07:51 PM
Still am, just don't see the connection. Oh well, not that important.  ;D
Title: Re: Geo IP [module request]
Post by: Jobe 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