summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-05-06 07:40:43 -0400
committerAdam <Adam@anope.org>2013-05-06 07:40:43 -0400
commitef06226521d27de88a49a84d8224568fec7624c3 (patch)
treeac67340c29521150bbcedc995ffeb7058366fe5e
parent4c669b947ff090f50fef379cfc1b2cad08ecc486 (diff)
Update the rest of modules.example.conf, default inspircd status modes to a sane rank incase they are prefixless, and 50 other things
-rw-r--r--data/modules.example.conf232
-rw-r--r--data/nickserv.example.conf2
-rw-r--r--modules/commands/cs_suspend.cpp2
-rw-r--r--modules/commands/os_forbid.cpp4
-rw-r--r--modules/extra/m_httpd.cpp3
-rw-r--r--modules/extra/m_ldap.cpp22
-rw-r--r--modules/extra/m_ldap_authentication.cpp4
-rw-r--r--modules/extra/m_mysql.cpp4
-rw-r--r--modules/extra/m_proxyscan.cpp4
-rw-r--r--modules/extra/m_xmlrpc.cpp5
-rw-r--r--modules/m_dnsbl.cpp4
-rw-r--r--modules/protocol/inspircd20.cpp10
-rw-r--r--modules/pseudoclients/chanserv.cpp2
-rw-r--r--src/config.cpp2
14 files changed, 163 insertions, 137 deletions
diff --git a/data/modules.example.conf b/data/modules.example.conf
index f1a5b8d7f..ab05542b2 100644
--- a/data/modules.example.conf
+++ b/data/modules.example.conf
@@ -98,39 +98,41 @@ module { name = "help" }
* a timed G/K-line to the IRCd and forgets about it. Can be useful if your akill list is being fill up by bots.
*/
add_to_akill = yes
-}
-blacklist
-{
- /* Name of the blacklist. */
- name = "rbl.efnetrbl.org"
-
- /* How long to set the ban for. */
- time = 4h
-
- /* Reason for akill.
- * %n is the nick of the user
- * %u is the ident/username of the user
- * %g is the realname of the user
- * %h is the hostname of the user
- * %i is the IP of the user
- * %r is the reason (configured below). Will be nothing if not configured.
- * %N is the network name set in networkinfo:networkname
- */
- reason = "You are listed in the efnet RBL, visit http://rbl.efnetrbl.org/?i=%i for info"
-
- /* Replies to ban and their reason. If this is totally ommited all replies get banned. */
- 1 = "Open Proxy"
- /* Don't ban for result 2 or 3 */
- #2 = "spamtrap666"
- #3 = "spamtrap50"
- 4 = "TOR"
- 5 = "Drones / Flooding"
-}
-blacklist
-{
- name = "dnsbl.dronebl.org"
- time = 4h
- reason = "You have a host listed in the DroneBL. For more information, visit http://dronebl.org/lookup_branded.do?ip=%i&network=%N"
+
+ blacklist
+ {
+ /* Name of the blacklist. */
+ name = "rbl.efnetrbl.org"
+
+ /* How long to set the ban for. */
+ time = 4h
+
+ /* Reason for akill.
+ * %n is the nick of the user
+ * %u is the ident/username of the user
+ * %g is the realname of the user
+ * %h is the hostname of the user
+ * %i is the IP of the user
+ * %r is the reason (configured below). Will be nothing if not configured.
+ * %N is the network name set in networkinfo:networkname
+ */
+ reason = "You are listed in the efnet RBL, visit http://rbl.efnetrbl.org/?i=%i for info"
+
+ /* Replies to ban and their reason. If this is totally ommited all replies get banned. */
+ 1 = "Open Proxy"
+ /* Don't ban for result 2 or 3 */
+ #2 = "spamtrap666"
+ #3 = "spamtrap50"
+ 4 = "TOR"
+ 5 = "Drones / Flooding"
+ }
+
+ blacklist
+ {
+ name = "dnsbl.dronebl.org"
+ time = 4h
+ reason = "You have a host listed in the DroneBL. For more information, visit http://dronebl.org/lookup_branded.do?ip=%i&network=%N"
+ }
}
/*
@@ -153,33 +155,37 @@ blacklist
* Note that using this will allow users to get the IP of your services.
* To prevent this we recommend using a reverse proxy or a tunnel.
*/
-#module { name = "m_httpd" }
-httpd
+#module
{
- /* Name of this service. */
- name = "httpd/main"
+ name = "m_httpd"
- /* IP to listen on. */
- ip = "0.0.0.0"
+ httpd
+ {
+ /* Name of this service. */
+ name = "httpd/main"
- /* Port to listen on. */
- port = 8080
+ /* IP to listen on. */
+ ip = "0.0.0.0"
- /* Time before connections to this server are timed out. */
- timeout = 30
+ /* Port to listen on. */
+ port = 8080
- /* Listen using SSL. Requires m_ssl. */
- #ssl = yes
+ /* Time before connections to this server are timed out. */
+ timeout = 30
- /* If you are using a reverse proxy that sends one of the
- * extforward_headers set below, set this to its IP.
- * This allows services to obtain the real IP of users by
- * reading the forwarded-for HTTP header.
- */
- #extforward_ip = "192.168.0.255"
+ /* Listen using SSL. Requires m_ssl. */
+ #ssl = yes
- /* The header to look for. These probably work as is. */
- extforward_header = "X-Forwarded-For Forwarded-For"
+ /* If you are using a reverse proxy that sends one of the
+ * extforward_headers set below, set this to its IP.
+ * This allows services to obtain the real IP of users by
+ * reading the forwarded-for HTTP header.
+ */
+ #extforward_ip = "192.168.0.255"
+
+ /* The header to look for. These probably work as is. */
+ extforward_header = "X-Forwarded-For Forwarded-For"
+ }
}
/*
@@ -187,17 +193,21 @@ httpd
*
* This module allows other modules to use LDAP. By itself, this module does nothing useful.
*/
-#module { name = "m_ldap" }
-ldap
+#module
{
- server = "ldap://127.0.0.1"
- port = 389
-
- /*
- * Admin credentials used for performing searches and adding users.
- */
- admin_binddn = "cn=Manager,dc=anope,dc=org"
- admin_password = "secret"
+ name = "m_ldap"
+
+ ldap
+ {
+ server = "ldap://127.0.0.1"
+ port = 389
+
+ /*
+ * Admin credentials used for performing searches and adding users.
+ */
+ admin_binddn = "cn=Manager,dc=anope,dc=org"
+ admin_password = "secret"
+ }
}
/*
@@ -206,9 +216,10 @@ ldap
* This module allows many commands such as IDENTIFY, RELEASE, RECOVER, GHOST, etc. use
* LDAP to authenticate users. Requires m_ldap.
*/
-#module { name = "m_ldap_authentication" }
-m_ldap_authentication
+#module
{
+ name = "m_ldap_authentication"
+
/*
* The distinguished name used for searching for users's accounts.
*/
@@ -265,9 +276,10 @@ m_ldap_authentication
*
* Note that this doesn't give the user privileges on the IRCd, only in Services.
*/
-#module { name = "m_ldap_oper" }
-m_ldap_oper
+#module
{
+ name = "m_ldap_oper"
+
/*
* An optional binddn to use when searching for groups.
* %a is replaced with the account name of the user.
@@ -302,16 +314,20 @@ m_ldap_oper
*
* This module allows other modules to use MySQL.
*/
-#module { name = "m_mysql" }
-mysql
+#module
{
- /* The name of this service. */
- name = "mysql/main"
- database = "anope"
- server = "127.0.0.1"
- username = "anope"
- password = "mypassword"
- port = 3306
+ name = "m_mysql"
+
+ mysql
+ {
+ /* The name of this service. */
+ name = "mysql/main"
+ database = "anope"
+ server = "127.0.0.1"
+ username = "anope"
+ password = "mypassword"
+ port = 3306
+ }
}
/*
@@ -374,30 +390,26 @@ mysql
* How long before connections should be timed out.
*/
timeout = 5
-}
-
-/*
- * A proxyscan block (must have m_proxyscan loaded).
- * You may have multiple proxyscan blocks.
- */
-proxyscan
-{
- /* The type of proxy to check for. A comma separated list is allowed. */
- type = "HTTP"
-
- /* The ports to check. */
- port = "80,8080"
- /* How long to set the ban for. */
- time = 4h
-
- /*
- * The reason to ban the user for.
- * %h is replaced with the type of proxy found.
- * %i is replaced with the IP of proxy found.
- * %p is replaced with the port.
- */
- reason = "You have an open proxy running on your host (%t:%i:%p)"
+ proxyscan
+ {
+ /* The type of proxy to check for. A comma separated list is allowed. */
+ type = "HTTP"
+
+ /* The ports to check. */
+ port = "80,8080"
+
+ /* How long to set the ban for. */
+ time = 4h
+
+ /*
+ * The reason to ban the user for.
+ * %h is replaced with the type of proxy found.
+ * %i is replaced with the IP of proxy found.
+ * %p is replaced with the port.
+ */
+ reason = "You have an open proxy running on your host (%t:%i:%p)"
+ }
}
/*
@@ -476,14 +488,19 @@ module
*
* This module allows other modules to use SQLite.
*/
-#module { name = "m_sqlite" }
-sqlite
+#module
{
- /* The name of this service. */
- name = "sqlite/main"
+ name = "m_sqlite"
- /* The database name, it will be created if it does not exist. */
- database = "anope.db"
+ /* A SQLite database */
+ sqlite
+ {
+ /* The name of this service. */
+ name = "sqlite/main"
+
+ /* The database name, it will be created if it does not exist. */
+ database = "anope.db"
+ }
}
/*
@@ -565,9 +582,10 @@ module
* Allows remote applications (websites) to execute queries in real time to retrieve data from Anope.
* By itself this module does nothing, but allows other modules (m_xmlrpc_main) to receive and send XMLRPC queries.
*/
-#module { name = "m_xmlrpc" }
-m_xmlrpc
+#module
{
+ name = "m_xmlrpc"
+
/* Web service to use. Requires m_httpd. */
server = "httpd/main"
}
diff --git a/data/nickserv.example.conf b/data/nickserv.example.conf
index 67358b9d6..075a4b79e 100644
--- a/data/nickserv.example.conf
+++ b/data/nickserv.example.conf
@@ -440,7 +440,7 @@ module
*
* This directive is optional.
*/
- #nickregdelay = 30
+ #nickregdelay = 30s
}
command { service = "NickServ"; name = "CONFIRM"; command = "nickserv/confirm"; }
diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp
index a26cbacd5..5fc6fe287 100644
--- a/modules/commands/cs_suspend.cpp
+++ b/modules/commands/cs_suspend.cpp
@@ -19,7 +19,7 @@ class CommandCSSuspend : public Command
CommandCSSuspend(Module *creator) : Command(creator, "chanserv/suspend", 1, 3)
{
this->SetDesc(_("Prevent a channel from being used preserving channel data and settings"));
- this->SetSyntax(_("\037channel\037 [+\037expiry\037] [\037reason\037]"));
+ this->SetSyntax(_("\037channel\037 [+\037expiry\037] \037reason\037"));
}
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp
index 6cc00edda..c7c147c7e 100644
--- a/modules/commands/os_forbid.cpp
+++ b/modules/commands/os_forbid.cpp
@@ -14,8 +14,6 @@
#include "module.h"
#include "modules/os_forbid.h"
-static ServiceReference<NickServService> nickserv("NickServService", "NickServ");
-
class MyForbidService : public ForbidService
{
Serialize::Checker<std::vector<ForbidData *>[FT_SIZE - 1]> forbid_data;
@@ -87,7 +85,7 @@ class CommandOSForbid : public Command
CommandOSForbid(Module *creator) : Command(creator, "operserv/forbid", 1, 5), fs("ForbidService", "forbid")
{
this->SetDesc(_("Forbid usage of nicknames, channels, and emails"));
- this->SetSyntax(_("ADD {NICK|CHAN|EMAIL|REGISTER} [+\037expiry\037] \037entry\037\002 [\037reason\037]"));
+ this->SetSyntax(_("ADD {NICK|CHAN|EMAIL|REGISTER} [+\037expiry\037] \037entry\037\002 \037reason\037"));
this->SetSyntax(_("DEL {NICK|CHAN|EMAIL|REGISTER} \037entry\037"));
this->SetSyntax(_("LIST (NICK|CHAN|EMAIL|REGISTER)"));
}
diff --git a/modules/extra/m_httpd.cpp b/modules/extra/m_httpd.cpp
index 5a4260149..212abfa4f 100644
--- a/modules/extra/m_httpd.cpp
+++ b/modules/extra/m_httpd.cpp
@@ -352,8 +352,9 @@ class HTTPD : public Module
this->providers.clear();
}
- void OnReload(Configuration::Conf *conf) anope_override
+ void OnReload(Configuration::Conf *config) anope_override
{
+ Configuration::Block *conf = config->GetModule(this);
std::set<Anope::string> existing;
for (int i = 0; i < conf->CountBlock("httpd"); ++i)
diff --git a/modules/extra/m_ldap.cpp b/modules/extra/m_ldap.cpp
index 4168193a3..17ad60213 100644
--- a/modules/extra/m_ldap.cpp
+++ b/modules/extra/m_ldap.cpp
@@ -423,7 +423,7 @@ class ModuleLDAP : public Module, public Pipe
LDAPServices.clear();
}
- void OnReload(Configuration::Conf *conf) anope_override
+ void OnReload(Configuration::Conf *config) anope_override
{
int i, num;
@@ -433,8 +433,9 @@ class ModuleLDAP : public Module, public Pipe
LDAPService *s = it->second;
++it;
- for (i = 0; i < Config->CountBlock("ldap"); ++i)
- if (Config->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main") == cname)
+ Configuration::Block *conf = Config->GetModule(this);
+ for (i = 0; i < conf->CountBlock("ldap"); ++i)
+ if (conf->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main") == cname)
break;
if (i == num)
@@ -447,16 +448,19 @@ class ModuleLDAP : public Module, public Pipe
}
}
- for (i = 0; i < Config->CountBlock("ldap"); ++i)
+ Configuration::Block *conf = config->GetModule(this);
+ for (i = 0; i < conf->CountBlock("ldap"); ++i)
{
- const Anope::string &connname = Config->GetBlock("ldap", i)->Get<const Anope::string>("name", "ldap/main");
+ Configuration::Block *ldap = conf->GetBlock("ldap", i);
+
+ const Anope::string &connname = ldap->Get<const Anope::string>("name", "ldap/main");
if (this->LDAPServices.find(connname) == this->LDAPServices.end())
{
- const Anope::string &server = Config->GetBlock("ldap", i)->Get<const Anope::string>("server", "127.0.0.1");
- int port = Config->GetBlock("ldap", i)->Get<int>("port", "389");
- const Anope::string &admin_binddn = Config->GetBlock("ldap", i)->Get<const Anope::string>("admin_binddn");
- const Anope::string &admin_password = Config->GetBlock("ldap", i)->Get<const Anope::string>("admin_password");
+ const Anope::string &server = ldap->Get<const Anope::string>("server", "127.0.0.1");
+ int port = ldap->Get<int>("port", "389");
+ const Anope::string &admin_binddn = ldap->Get<const Anope::string>("admin_binddn");
+ const Anope::string &admin_password = ldap->Get<const Anope::string>("admin_password");
try
{
diff --git a/modules/extra/m_ldap_authentication.cpp b/modules/extra/m_ldap_authentication.cpp
index 4bd76ff09..08f070bb8 100644
--- a/modules/extra/m_ldap_authentication.cpp
+++ b/modules/extra/m_ldap_authentication.cpp
@@ -220,9 +220,9 @@ class NSIdentifyLDAP : public Module
ModuleManager::SetPriority(this, PRIORITY_FIRST);
}
- void OnReload(Configuration::Conf *conf) anope_override
+ void OnReload(Configuration::Conf *config) anope_override
{
- Configuration::Block *config = Config->GetModule(this);
+ Configuration::Block *conf = Config->GetModule(this);
basedn = conf->Get<const Anope::string>("basedn");
search_filter = conf->Get<const Anope::string>("search_filter");
diff --git a/modules/extra/m_mysql.cpp b/modules/extra/m_mysql.cpp
index a61f11e8b..8cf12ca79 100644
--- a/modules/extra/m_mysql.cpp
+++ b/modules/extra/m_mysql.cpp
@@ -212,9 +212,9 @@ class ModuleSQL : public Module, public Pipe
}
}
- for (i = 0; i < Config->CountBlock("mysql"); ++i)
+ for (i = 0; i < config->CountBlock("mysql"); ++i)
{
- Configuration::Block *block = Config->GetBlock("mysql", i);
+ Configuration::Block *block = config->GetBlock("mysql", i);
const Anope::string &connname = block->Get<const Anope::string>("name", "mysql/main");
if (this->MySQLServices.find(connname) == this->MySQLServices.end())
diff --git a/modules/extra/m_proxyscan.cpp b/modules/extra/m_proxyscan.cpp
index 075f9067e..da2ab5692 100644
--- a/modules/extra/m_proxyscan.cpp
+++ b/modules/extra/m_proxyscan.cpp
@@ -295,9 +295,9 @@ class ModuleProxyScan : public Module
}
this->proxyscans.clear();
- for (int i = 0; i < conf->CountBlock("proxyscan"); ++i)
+ for (int i = 0; i < config->CountBlock("proxyscan"); ++i)
{
- Configuration::Block *block = conf->GetBlock("proxyscan", i);
+ Configuration::Block *block = config->GetBlock("proxyscan", i);
ProxyCheck p;
Anope::string token;
diff --git a/modules/extra/m_xmlrpc.cpp b/modules/extra/m_xmlrpc.cpp
index c1a9bc1d5..66e2db9ac 100644
--- a/modules/extra/m_xmlrpc.cpp
+++ b/modules/extra/m_xmlrpc.cpp
@@ -177,6 +177,11 @@ class ModuleXMLRPC : public Module
if (httpref)
httpref->UnregisterPage(&xmlrpcinterface);
}
+
+ void OnReload(Configuration::Conf *conf) anope_override
+ {
+ this->httpref = ServiceReference<HTTPProvider>("HTTPProvider", conf->GetModule(this)->Get<const Anope::string>("server", "httpd/main"));
+ }
};
MODULE_INIT(ModuleXMLRPC)
diff --git a/modules/m_dnsbl.cpp b/modules/m_dnsbl.cpp
index b6ebcfb55..ea1f1d9f6 100644
--- a/modules/m_dnsbl.cpp
+++ b/modules/m_dnsbl.cpp
@@ -103,9 +103,9 @@ class ModuleDNSBL : public Module
this->add_to_akill = block->Get<bool>("add_to_akill", "yes");
this->blacklists.clear();
- for (int i = 0, num = conf->CountBlock("blacklist"); i < num; ++i)
+ for (int i = 0, num = block->CountBlock("blacklist"); i < num; ++i)
{
- Configuration::Block *bl = conf->GetBlock("blacklist", i);
+ Configuration::Block *bl = block->GetBlock("blacklist", i);
Anope::string bname = bl->Get<const Anope::string>("name");
if (bname.empty())
diff --git a/modules/protocol/inspircd20.cpp b/modules/protocol/inspircd20.cpp
index 702bf6eea..3998486e3 100644
--- a/modules/protocol/inspircd20.cpp
+++ b/modules/protocol/inspircd20.cpp
@@ -300,7 +300,7 @@ struct IRCDMessageCapab : Message::Capab
ChannelMode *cm = NULL;
if (modename.equals_cs("admin"))
- cm = new ChannelModeStatus("PROTECT", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0);
+ cm = new ChannelModeStatus("PROTECT", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 3);
else if (modename.equals_cs("allowinvite"))
cm = new ChannelMode("ALLINVITE", modechar[0]);
else if (modename.equals_cs("auditorium"))
@@ -326,9 +326,9 @@ struct IRCDMessageCapab : Message::Capab
else if (modename.equals_cs("flood"))
cm = new ChannelModeFlood(modechar[0]);
else if (modename.equals_cs("founder"))
- cm = new ChannelModeStatus("OWNER", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0);
+ cm = new ChannelModeStatus("OWNER", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 4);
else if (modename.equals_cs("halfop"))
- cm = new ChannelModeStatus("HALFOP", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0);
+ cm = new ChannelModeStatus("HALFOP", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 1);
else if (modename.equals_cs("history"))
cm = new ChannelModeHistory(modechar[0]);
else if (modename.equals_cs("invex"))
@@ -360,7 +360,7 @@ struct IRCDMessageCapab : Message::Capab
else if (modename.equals_cs("nonotice"))
cm = new ChannelMode("NONOTICE", modechar[0]);
else if (modename.equals_cs("op"))
- cm = new ChannelModeStatus("OP", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0);
+ cm = new ChannelModeStatus("OP", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 2);
else if (modename.equals_cs("operonly"))
cm = new ChannelModeOper(modechar[0]);
else if (modename.equals_cs("permanent"))
@@ -382,7 +382,7 @@ struct IRCDMessageCapab : Message::Capab
else if (modename.equals_cs("topiclock"))
cm = new ChannelMode("TOPIC", modechar[0]);
else if (modename.equals_cs("voice"))
- cm = new ChannelModeStatus("VOICE", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0);
+ cm = new ChannelModeStatus("VOICE", modechar.length() > 1 ? modechar[1] : modechar[0], modechar.length() > 1 ? modechar[0] : 0, 0);
/* Unknown status mode, (customprefix) - add it */
else if (modechar.length() == 2)
cm = new ChannelModeStatus(modename.upper(), modechar[1], modechar[0]);
diff --git a/modules/pseudoclients/chanserv.cpp b/modules/pseudoclients/chanserv.cpp
index a93271581..73980a36a 100644
--- a/modules/pseudoclients/chanserv.cpp
+++ b/modules/pseudoclients/chanserv.cpp
@@ -82,7 +82,7 @@ class MyChanServService : public ChanServService
/** Constructor
* @param chan The channel
*/
- ChanServTimer(Module *m, Channel *chan) : Timer(m, Config->GetModule(this->GetOwner())->Get<time_t>("inhabit", "15s")), c(chan)
+ ChanServTimer(Module *m, Channel *chan) : Timer(m, Config->GetModule(m)->Get<time_t>("inhabit", "15s")), c(chan)
{
if (!ChanServ || !c)
return;
diff --git a/src/config.cpp b/src/config.cpp
index 17d15a0d9..e2243b236 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -180,7 +180,7 @@ Conf::Conf() : Block("")
ValidateNotEmpty("mail", check[i], mail->Get<const Anope::string>(check[i]));
}
- this->ReadTimeout = options->Get<unsigned>("readtimeout");
+ this->ReadTimeout = options->Get<time_t>("readtimeout");
this->UsePrivmsg = options->Get<bool>("useprivmsg");
this->StrictPrivmsg = options->Get<bool>("usestrictprivmsg") ? "/msg " : "/";
{