Difference between revisions of "2.0/Module/irc2sql"
From AnopeWiki
(Created page with "{{Language|2.0/Modules/irc2sql}} {{Header|irc2sql|Database|Anope}} == <div class="moduleheader">Description</div> == Stores channel and user statistics in a MySQL database. ...") |
|||
Line 3: | Line 3: | ||
== <div class="moduleheader">Description</div> == | == <div class="moduleheader">Description</div> == | ||
− | Stores channel and user statistics in a MySQL database. | + | Stores channel and user statistics in a MySQL database. It creates a new pseudo-client called StatServ. |
*<span style="color: red;">Enabeled/Disabeled using the '''./extras''' command line configuration tool, as 'stats'.</span> | *<span style="color: red;">Enabeled/Disabeled using the '''./extras''' command line configuration tool, as 'stats'.</span> | ||
+ | |||
+ | |||
+ | ;service {...} : | ||
+ | :;nick= :Name of the new service | ||
+ | :;user= :User (ident) for the new service user | ||
+ | :;host= :Hostname for the new service user | ||
+ | :;gecis= :Realname for the new service user | ||
+ | :;mode= :default modes for this new service user | ||
+ | :;channels= :Channels that the new service user joins automatically | ||
+ | |||
+ | ;module {...} : | ||
+ | :;name= :module name | ||
+ | :;client= :Service to connect with | ||
+ | :;engine= :the SQL backend engine, currently requires MySQL v 5.5 via the m_mysql module. | ||
+ | :;prefix= :Table prefix for the data storage tables. | ||
+ | :;geoip_database= :"Country" or "City" are the only options, Country is smaller than the City. USed to decide where a person it. | ||
+ | :;ctcpuser= :Should it ctcp version a user when they connect | ||
+ | :;ctcpeob= :Should it ctcp version a user when services reconnects to a server, or a netsplit server returns | ||
== <div class="moduleheader">Default Configuration</div> == | == <div class="moduleheader">Default Configuration</div> == | ||
Line 11: | Line 29: | ||
<div class="code"> | <div class="code"> | ||
<syntaxhighlight lang="cpp"> | <syntaxhighlight lang="cpp"> | ||
+ | /* | ||
+ | * Example configuration file for the irc2sql gateway | ||
+ | * | ||
+ | */ | ||
+ | |||
+ | service | ||
+ | { | ||
+ | /* | ||
+ | * The name of the StatServ client. | ||
+ | */ | ||
+ | nick = "StatServ" | ||
+ | |||
+ | /* | ||
+ | * The username of the StatServ client. | ||
+ | */ | ||
+ | user = "StatServ" | ||
+ | |||
+ | /* | ||
+ | * The hostname of the StatServ client. | ||
+ | */ | ||
+ | host = "services.host" | ||
+ | |||
+ | /* | ||
+ | * The realname of the StatServ client. | ||
+ | */ | ||
+ | gecos = "Statistical Service" | ||
+ | |||
+ | /* | ||
+ | * The modes this client should use. | ||
+ | * Do not modify this unless you know what you are doing. | ||
+ | * | ||
+ | * These modes are very IRCd specific. If left commented, sane defaults | ||
+ | * are used based on what protocol module you have loaded. | ||
+ | * | ||
+ | * Note that setting this option incorrectly could potentially BREAK some, if | ||
+ | * not all, usefulness of the client. We will not support you if this client is | ||
+ | * unable to do certain things if this option is enabled. | ||
+ | */ | ||
+ | #modes = "+o" | ||
+ | /* | ||
+ | * An optional comma separated list of channels this service should join. Outside | ||
+ | * of log channels this is not very useful, as the service will just idle in the | ||
+ | * specified channels, and will not accept any types of commands. | ||
+ | * | ||
+ | * Prefixes may be given to the channels in the form of mode characters or prefix symbols. | ||
+ | */ | ||
+ | #channels = "@#services,#mychan" | ||
+ | } | ||
+ | |||
+ | module | ||
+ | { | ||
+ | name = "irc2sql" | ||
+ | |||
+ | /* | ||
+ | * The name of the client that should send the CTCP VERSION requests. | ||
+ | * It must already exist or must be defined in the following service block. | ||
+ | */ | ||
+ | client = "StatServ" | ||
+ | |||
+ | /* | ||
+ | * The name of the SQL engine to use. | ||
+ | * This must be MySQL and must match the name in the mysql{} block | ||
+ | */ | ||
+ | engine = "mysql/main" | ||
+ | |||
+ | /* | ||
+ | * An optional prefix to prepended to the name of each created table. | ||
+ | * Do not use the same prefix for other programs. | ||
+ | */ | ||
+ | prefix = "anope_" | ||
+ | |||
+ | /* | ||
+ | * GeoIP - Automatically adds users geoip location to the user table. | ||
+ | * Tables are created by irc2sql, you have to run the | ||
+ | * geoipupdate script after you started Anope to download | ||
+ | * and import the GeoIP database. | ||
+ | * | ||
+ | * The geoip database can be the smaller "country" database or the | ||
+ | * larger "city" database. Comment to disable geoip lookup. | ||
+ | */ | ||
+ | geoip_database = "country" | ||
+ | |||
+ | /* | ||
+ | * Get the CTCP version from users | ||
+ | * The users connecting to the network will receive a CTCP VERSION | ||
+ | * request from the above configured services client | ||
+ | */ | ||
+ | ctcpuser = "yes" | ||
+ | |||
+ | /* | ||
+ | * Send out CTCP VERSION requests to users during burst. | ||
+ | * Disable this if you restart Anope often and don't want to | ||
+ | * annoy your users. | ||
+ | */ | ||
+ | ctcpeob = "yes" | ||
+ | } | ||
+ | |||
</syntaxhighlight></div> | </syntaxhighlight></div> |
Revision as of 20:24, 15 May 2014
Language | |
---|---|
|
Description
Stores channel and user statistics in a MySQL database. It creates a new pseudo-client called StatServ.
- Enabeled/Disabeled using the ./extras command line configuration tool, as 'stats'.
- service {...}
-
- nick=
- Name of the new service
- user=
- User (ident) for the new service user
- host=
- Hostname for the new service user
- gecis=
- Realname for the new service user
- mode=
- default modes for this new service user
- channels=
- Channels that the new service user joins automatically
- module {...}
-
- name=
- module name
- client=
- Service to connect with
- engine=
- the SQL backend engine, currently requires MySQL v 5.5 via the m_mysql module.
- prefix=
- Table prefix for the data storage tables.
- geoip_database=
- "Country" or "City" are the only options, Country is smaller than the City. USed to decide where a person it.
- ctcpuser=
- Should it ctcp version a user when they connect
- ctcpeob=
- Should it ctcp version a user when services reconnects to a server, or a netsplit server returns
Default Configuration
/* * Example configuration file for the irc2sql gateway * */ service { /* * The name of the StatServ client. */ nick = "StatServ" /* * The username of the StatServ client. */ user = "StatServ" /* * The hostname of the StatServ client. */ host = "services.host" /* * The realname of the StatServ client. */ gecos = "Statistical Service" /* * The modes this client should use. * Do not modify this unless you know what you are doing. * * These modes are very IRCd specific. If left commented, sane defaults * are used based on what protocol module you have loaded. * * Note that setting this option incorrectly could potentially BREAK some, if * not all, usefulness of the client. We will not support you if this client is * unable to do certain things if this option is enabled. */ #modes = "+o" /* * An optional comma separated list of channels this service should join. Outside * of log channels this is not very useful, as the service will just idle in the * specified channels, and will not accept any types of commands. * * Prefixes may be given to the channels in the form of mode characters or prefix symbols. */ #channels = "@#services,#mychan" } module { name = "irc2sql" /* * The name of the client that should send the CTCP VERSION requests. * It must already exist or must be defined in the following service block. */ client = "StatServ" /* * The name of the SQL engine to use. * This must be MySQL and must match the name in the mysql{} block */ engine = "mysql/main" /* * An optional prefix to prepended to the name of each created table. * Do not use the same prefix for other programs. */ prefix = "anope_" /* * GeoIP - Automatically adds users geoip location to the user table. * Tables are created by irc2sql, you have to run the * geoipupdate script after you started Anope to download * and import the GeoIP database. * * The geoip database can be the smaller "country" database or the * larger "city" database. Comment to disable geoip lookup. */ geoip_database = "country" /* * Get the CTCP version from users * The users connecting to the network will receive a CTCP VERSION * request from the above configured services client */ ctcpuser = "yes" /* * Send out CTCP VERSION requests to users during burst. * Disable this if you restart Anope often and don't want to * annoy your users. */ ctcpeob = "yes" }