mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Merge branch 'insp3' into master.
This commit is contained in:
commit
3ab889537f
2
.github/SECURITY.md
vendored
2
.github/SECURITY.md
vendored
@ -10,7 +10,7 @@ Version | Supported
|
||||
------- | ---------
|
||||
4.x.y | :warning:
|
||||
3.x.y | :white_check_mark:
|
||||
2.0.x | :white_check_mark:
|
||||
2.0.x | :warning:
|
||||
1.2.y | :x:
|
||||
1.1.y | :x:
|
||||
1.0.y | :x:
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -10,6 +10,7 @@
|
||||
/Makefile
|
||||
/GNUmakefile
|
||||
/build
|
||||
/core
|
||||
/docs/doxygen
|
||||
/run
|
||||
|
||||
|
@ -43,6 +43,6 @@ InspIRCd is licensed under [version 2 of the GNU General Public License](https:/
|
||||
* [Website](https://www.inspircd.org)
|
||||
* [Documentation](https://docs.inspircd.org)
|
||||
* [GitHub](https://github.com/inspircd)
|
||||
* [Support IRC channel](https://kiwiirc.com/nextclient/irc.inspircd.org:+6697/#inspircd) — \#inspircd on irc.inspircd.org
|
||||
* [Development IRC channel](https://kiwiirc.com/nextclient/irc.inspircd.org:+6697/#inspircd.dev) — \#inspircd.dev on irc.inspircd.org
|
||||
* [InspIRCd test network](https://kiwiirc.com/nextclient/testnet.inspircd.org:+6697) — testnet.inspircd.org
|
||||
* [Support IRC channel](https://kiwiirc.com/nextclient/irc.inspircd.org:+6697/inspircd?nick=Your%20nick%20here) — \#inspircd on irc.inspircd.org
|
||||
* [Development IRC channel](https://kiwiirc.com/nextclient/irc.inspircd.org:+6697/inspircd.dev?nick=Your%20nick%20here) — \#inspircd.dev on irc.inspircd.org
|
||||
* [InspIRCd test network](https://kiwiirc.com/nextclient/testnet.inspircd.org:+6697/?nick=Your%20nick%20here) — testnet.inspircd.org
|
||||
|
@ -10,8 +10,6 @@
|
||||
# -- w00t 16/dec/2006
|
||||
#
|
||||
|
||||
<config format="xml">
|
||||
|
||||
<alias text="HELP" replace="HELPOP $2-">
|
||||
|
||||
<helpmsg nohelp="There is no help for the topic you searched for. Please try again.">
|
||||
|
@ -112,21 +112,10 @@
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#- PORT CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-
|
||||
# #
|
||||
# Enter the port and address bindings here. #
|
||||
# Configure the port and address bindings here. #
|
||||
# #
|
||||
# #
|
||||
# ____ _ _____ _ _ ____ _ _ _ #
|
||||
# | _ \ ___ __ _ __| | |_ _| |__ (_)___ | __ )(_) |_| | #
|
||||
# | |_) / _ \/ _` |/ _` | | | | '_ \| / __| | _ \| | __| | #
|
||||
# | _ < __/ (_| | (_| | | | | | | | \__ \ | |_) | | |_|_| #
|
||||
# |_| \_\___|\__,_|\__,_| |_| |_| |_|_|___/ |____/|_|\__(_) #
|
||||
# #
|
||||
# If you want to link servers to InspIRCd you must load the #
|
||||
# spanningtree module! Please see the modules list for #
|
||||
# information on how to load this module! If you do not load this #
|
||||
# module, server ports will NOT work! #
|
||||
|
||||
# Listener that binds on a TCP/IP endpoint:
|
||||
# TLS (SSL) listener that binds on a TCP/IP endpoint:
|
||||
<bind
|
||||
# address: IP address to bind to if the box that you are hosting
|
||||
# on has more than one IP, else the ircd will try to bind to all
|
||||
@ -168,6 +157,10 @@
|
||||
# not have brought the network interfaces up yet.
|
||||
free="no">
|
||||
|
||||
# Plaintext listener that binds on a TCP/IP endpoint:
|
||||
<bind address="" port="6667" type="clients">
|
||||
|
||||
|
||||
# Listener that binds on a UNIX endpoint (not supported on Windows):
|
||||
#<bind
|
||||
|
||||
@ -193,7 +186,6 @@
|
||||
# shut down cleanly and left a zombie socket behind.
|
||||
#replace="yes">
|
||||
|
||||
<bind address="" port="6667" type="clients">
|
||||
|
||||
# Listener accepting HTML5 WebSocket connections.
|
||||
# Requires the websocket module and SHA-1 hashing support (provided by the sha1
|
||||
@ -208,9 +200,6 @@
|
||||
# completely link-compatible and can be used alongside each other on each end
|
||||
# of the link without any significant issues.
|
||||
|
||||
<bind address="" port="7000,7001" type="servers">
|
||||
<bind address="1.2.3.4" port="7005" type="servers" ssl="openssl">
|
||||
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#- CONNECTIONS CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#
|
||||
# #
|
||||
@ -288,8 +277,8 @@
|
||||
# globalmax: Maximum global (network-wide) connections per IP (or CIDR mask, see below).
|
||||
globalmax="3"
|
||||
|
||||
# maxconnwarn: Enable warnings when localmax or globalmax are reached (defaults to on)
|
||||
maxconnwarn="off"
|
||||
# maxconnwarn: Enable warnings when localmax or globalmax are reached (defaults to yes)
|
||||
maxconnwarn="no"
|
||||
|
||||
# resolvehostnames: If disabled, no DNS lookups will be performed on connecting users
|
||||
# in this class. This can save a lot of resources on very busy servers.
|
||||
@ -419,7 +408,7 @@
|
||||
# immediately killing them; their commands are held in the recvq and processed later
|
||||
# as the user's command penalty drops. Note that if this is enabled, flooders will
|
||||
# quit with "RecvQ exceeded" rather than "Excess Flood".
|
||||
fakelag="on"
|
||||
fakelag="yes"
|
||||
|
||||
# localmax: Maximum local connections per IP.
|
||||
localmax="3"
|
||||
@ -665,8 +654,9 @@
|
||||
# - stripcolor Channel mode +S - strips formatting codes from
|
||||
# messages (requires the stripcolor module).
|
||||
# - topiclock Channel mode +t - limits changing the topic to (half)ops
|
||||
# You can also configure this on a per-channel basis with a channel mode.
|
||||
# See m_exemptchanops in modules.conf.example for more details.
|
||||
# You can also configure this on a per-channel basis with a channel mode and
|
||||
# even negate the configured exemptions below.
|
||||
# See exemptchanops in modules.conf.example for more details.
|
||||
exemptchanops="censor:o filter:o nickflood:o nonick:v regmoderated:o"
|
||||
|
||||
# invitebypassmodes: This allows /INVITE to bypass other channel modes.
|
||||
@ -698,13 +688,13 @@
|
||||
# connections. If defined, it sets a soft max connections value.
|
||||
softlimit="12800"
|
||||
|
||||
# clonesonconnect: If this is set to false, we won't check for clones
|
||||
# clonesonconnect: If this is set to no, we won't check for clones
|
||||
# on initial connection, but only after the DNS check is done.
|
||||
# This can be useful where your main class is more restrictive
|
||||
# than some other class a user can be assigned after DNS lookup is complete.
|
||||
# Turning this option off will make the server spend more time on users we may
|
||||
# potentially not want. Normally this should be negligible, though.
|
||||
# Default value is true
|
||||
# Default value is yes
|
||||
clonesonconnect="yes"
|
||||
|
||||
# timeskipwarn: The time period that a server clock can jump by before
|
||||
@ -938,10 +928,10 @@
|
||||
|
||||
<badnick
|
||||
# nick: Nick to disallow. Wildcards are supported.
|
||||
nick="ChanServ"
|
||||
nick="Tr0ll123"
|
||||
|
||||
# reason: Reason to display on /NICK.
|
||||
reason="Reserved for a network service">
|
||||
reason="Don't use this nick.">
|
||||
|
||||
<badhost
|
||||
# host: ident@hostname to ban.
|
||||
|
@ -1,3 +1,23 @@
|
||||
#-#-#-#-#-#-#-#-#-#-#-#- PORT CONFIGURATION -#-#-#-#-#-#-#-#-#-#-#-
|
||||
# #
|
||||
# Configure the port and address bindings for linking here. #
|
||||
# #
|
||||
# Refer to the port configuration section in inspircd.conf.example #
|
||||
# for more information about the available options. #
|
||||
# #
|
||||
|
||||
# TLS (SSL) listener that binds on a TCP/IP endpoint:
|
||||
<bind address="1.2.3.4"
|
||||
port="7005"
|
||||
type="servers"
|
||||
ssl="gnutls">
|
||||
|
||||
# Plaintext listener that binds on a TCP/IP endpoint:
|
||||
<bind address=""
|
||||
port="7000,7001"
|
||||
type="servers">
|
||||
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#- SERVER LINK CONFIGURATION -#-#-#-#-#-#-#-#-#-#
|
||||
# #
|
||||
# Defines which servers can link to this one, and which servers this #
|
||||
@ -10,8 +30,8 @@
|
||||
# |_| \_\___|\__,_|\__,_| |_| |_| |_|_|___/ |____/|_|\__(_) #
|
||||
# #
|
||||
# If you want to link servers to InspIRCd you must load the #
|
||||
# spanningtree module! #
|
||||
# #
|
||||
# spanningtree module! If you do not load this module, server ports #
|
||||
# will NOT work! #
|
||||
# #
|
||||
|
||||
<link
|
||||
|
@ -78,13 +78,13 @@
|
||||
# matched, or it has no format value. Aliases are #
|
||||
# read from the top of the file to the bottom. #
|
||||
# #
|
||||
# usercommand - If this is true, the alias can be run simply as #
|
||||
# /ALIASNAME. Defaults to true. #
|
||||
# usercommand - If set to yes, the alias can be run simply as #
|
||||
# /ALIASNAME. Defaults to yes. #
|
||||
# #
|
||||
# channelcommand - If this is true, the alias can be used as an #
|
||||
# channelcommand - If set to yes, the alias can be used as an #
|
||||
# in-channel alias or 'fantasy command', prefixed #
|
||||
# by the fantasy prefix character, !aliasname by #
|
||||
# default. Defaults to false. #
|
||||
# default. Defaults to no. #
|
||||
# #
|
||||
# format - If this is defined, the parameters of the alias #
|
||||
# must match this glob pattern. For example if you #
|
||||
@ -116,11 +116,11 @@
|
||||
# to successfully trigger. If they are not, then #
|
||||
# the user receives a 'no such nick' 401 numeric. #
|
||||
# #
|
||||
# stripcolor - If this is true, the text from the user will be #
|
||||
# stripcolor - If set to yes, the text from the user will be #
|
||||
# stripped of color and format codes before #
|
||||
# matching against 'text'. #
|
||||
# #
|
||||
# uline - Setting this to true will ensure that the user #
|
||||
# uline - Setting this to yes will ensure that the user #
|
||||
# given in 'requires' is also on a U-lined server, #
|
||||
# as well as actually being on the network. If the #
|
||||
# user is online, but not on a U-lined server, #
|
||||
@ -128,7 +128,7 @@
|
||||
# possibly a sign of a user trying to impersonate #
|
||||
# a service. #
|
||||
# #
|
||||
# operonly - If true, this will make the alias oper only. #
|
||||
# operonly - If yes, this will make the alias oper only. #
|
||||
# If a non-oper attempts to use the alias, it will #
|
||||
# appear to not exist. #
|
||||
# #
|
||||
@ -848,6 +848,8 @@
|
||||
# See <options:exemptchanops> in inspircd.conf.example for a more #
|
||||
# detailed list of the restriction modes that can be exempted. #
|
||||
# These are settable using: /MODE #chan +X <restriction>:<status> #
|
||||
# Furthermore, the exemptions configured in <options:exemptchanops> #
|
||||
# can also be negated by using: /MODE #chan +X <restriction>:* #
|
||||
#<module name="exemptchanops">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
@ -980,9 +982,9 @@
|
||||
#<module name="hidechans">
|
||||
#
|
||||
# This mode can optionally prevent opers from seeing channels on a +I
|
||||
# user, for more privacy if set to true.
|
||||
# user, for more privacy if set to yes.
|
||||
# This setting is not recommended for most mainstream networks.
|
||||
#<hidechans affectsopers="false">
|
||||
#<hidechans affectsopers="no">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# Hide list module: Allows for hiding the list of listmodes from users
|
||||
@ -1104,10 +1106,10 @@
|
||||
# the timeout for ident lookups here. If not defined, it will default #
|
||||
# to 5 seconds. This is a non-blocking timeout which holds the user #
|
||||
# in a 'connecting' state until the lookup is complete. #
|
||||
# prefixunqueried: If on, the idents of users being in a connect class#
|
||||
# with ident lookups disabled (i.e. <connect useident="off">) will be #
|
||||
# prefixed with a "~". If off, the ident of those users will not be #
|
||||
# prefixed. Default is off. #
|
||||
# prefixunqueried: If yes, the idents of users in a connect class #
|
||||
# with ident lookups disabled (i.e. <connect useident="no">) will be #
|
||||
# prefixed with a "~". If no, the ident of those users will not be #
|
||||
# prefixed. Default is no. #
|
||||
#
|
||||
#<ident timeout="5" prefixunqueried="no">
|
||||
|
||||
@ -1133,7 +1135,7 @@
|
||||
# The following block can be used to control which extensions are
|
||||
# enabled. Note that extended-join can be incompatible with delayjoin
|
||||
# and host cycling.
|
||||
#<ircv3 accountnotify="on" awaynotify="on" extendedjoin="on">
|
||||
#<ircv3 accountnotify="yes" awaynotify="yes" extendedjoin="yes">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# IRCv3 account-tag module. Adds the 'account' tag which contains the
|
||||
@ -1422,9 +1424,9 @@
|
||||
#<module name="namedmodes">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# NAMESX module: Provides support for the NAMESX extension which allows
|
||||
# clients to see all the prefixes set on a user without getting confused.
|
||||
# This is supported by mIRC, x-chat, klient, and maybe more.
|
||||
# NAMESX module: Provides support for the IRCv3 multi-prefix capability
|
||||
# and legacy NAMESX extension which allow clients to see all the prefix
|
||||
# modes set on a user.
|
||||
#<module name="namesx">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
@ -1450,7 +1452,7 @@
|
||||
# which allows up to X nick changes in Y seconds.
|
||||
#<module name="nickflood">
|
||||
#
|
||||
# The number of seconds to prevent nick changes for:
|
||||
# The time period to prevent nick changes for:
|
||||
#<nickflood duration="1m">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
@ -1539,8 +1541,8 @@
|
||||
#<module name="operlog">
|
||||
#
|
||||
# If the following option is on then all oper commands will be sent to
|
||||
# the snomask 'r'. The default is off.
|
||||
#<operlog tosnomask="off">
|
||||
# the snomask 'r'. The default is no.
|
||||
#<operlog tosnomask="no">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# Oper prefixing module: Adds a channel prefix mode +y which is given
|
||||
@ -1677,8 +1679,8 @@
|
||||
# whenever +P is set, unset, or the topic/modes on a +P channel is changed.
|
||||
# If you want to do this, set the filename below, and uncomment the include.
|
||||
#
|
||||
# If 'listmodes' is true then all list modes (+b, +I, +e, +g...) will be
|
||||
# saved. Defaults to false.
|
||||
# If 'listmodes' is yes then all list modes (+b, +I, +e, +g...) will be
|
||||
# saved. Defaults to no.
|
||||
#
|
||||
# 'saveperiod' determines how often to check if the database needs to be
|
||||
# saved to disk. Defaults to every five seconds.
|
||||
@ -1784,8 +1786,8 @@
|
||||
# in the same way as /REMOVE.
|
||||
#<module name="remove">
|
||||
#
|
||||
# supportnokicks: If true, /REMOVE is not allowed on channels where the
|
||||
# nokicks (+Q) mode is set. Defaults to false.
|
||||
# supportnokicks: If yes, /REMOVE is not allowed on channels where the
|
||||
# nokicks (+Q) mode is set. Defaults to no.
|
||||
# protectedrank: Members having this rank or above may not be /REMOVE'd
|
||||
# by anyone. Set to 0 to disable this feature. Defaults to 50000.
|
||||
#<remove supportnokicks="yes" protectedrank="50000">
|
||||
@ -2258,7 +2260,7 @@
|
||||
#<module name="svshold">
|
||||
# SVSHOLD does not generate server notices by default, you can turn
|
||||
# notices on by uncommenting the next line.
|
||||
#<svshold silent="false">
|
||||
#<svshold silent="no">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# SWHOIS module: Allows you to add arbitrary lines to user WHOIS.
|
||||
@ -2286,11 +2288,9 @@
|
||||
#<module name="topiclock">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
# UHNAMES support module: Adds support for the IRCX style UHNAMES
|
||||
# extension, which displays ident and hostname in the names list for
|
||||
# each user, saving clients from doing a WHO on the channel.
|
||||
# If a client does not support UHNAMES it will not enable it, this will
|
||||
# not break incompatible clients.
|
||||
# UHNAMES support module: Adds support for the IRCv3 userhost-in-names
|
||||
# capability and legacy UHNAMES extension which display the ident and
|
||||
# hostname of users in the NAMES list.
|
||||
#<module name="uhnames">
|
||||
|
||||
#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#-#
|
||||
|
@ -259,6 +259,9 @@ class CoreExport ServiceProvider : public classbase
|
||||
ServiceProvider(Module* Creator, const std::string& Name, ServiceType Type);
|
||||
virtual ~ServiceProvider() = default;
|
||||
|
||||
/** Retrieves a string that represents the type of this service. */
|
||||
const char* GetTypeString() const;
|
||||
|
||||
/** Register this service in the appropriate registrar
|
||||
*/
|
||||
virtual void RegisterService();
|
||||
|
@ -166,6 +166,26 @@ void ServiceProvider::DisableAutoRegister()
|
||||
stdalgo::erase(*ServerInstance->Modules.NewServices, this);
|
||||
}
|
||||
|
||||
const char* ServiceProvider::GetTypeString() const
|
||||
{
|
||||
switch (service)
|
||||
{
|
||||
case SERVICE_COMMAND:
|
||||
return "command";
|
||||
case SERVICE_MODE:
|
||||
return "mode";
|
||||
case SERVICE_METADATA:
|
||||
return "metadata";
|
||||
case SERVICE_IOHOOK:
|
||||
return "iohook";
|
||||
case SERVICE_DATA:
|
||||
return "data service";
|
||||
case SERVICE_CUSTOM:
|
||||
return "module service";
|
||||
}
|
||||
return "unknown service";
|
||||
}
|
||||
|
||||
bool ModuleManager::Attach(Implementation i, Module* mod)
|
||||
{
|
||||
if (stdalgo::isin(EventHandlers[i], mod))
|
||||
@ -400,7 +420,10 @@ void ModuleManager::DoSafeUnload(Module* mod)
|
||||
{
|
||||
std::multimap<std::string, ServiceProvider*>::iterator curr = i++;
|
||||
if (curr->second->creator == mod)
|
||||
{
|
||||
DataProviders.erase(curr);
|
||||
FOREACH_MOD(OnServiceDel, (*curr->second));
|
||||
}
|
||||
}
|
||||
|
||||
dynamic_reference_base::reset_all();
|
||||
@ -549,6 +572,8 @@ void ModuleManager::AddServices(const ServiceList& list)
|
||||
|
||||
void ModuleManager::AddService(ServiceProvider& item)
|
||||
{
|
||||
ServerInstance->Logs.Log("SERVICE", LOG_DEBUG, "Adding %s %s provided by %s", item.name.c_str(),
|
||||
item.GetTypeString(), item.creator ? item.creator->ModuleSourceFile.c_str() : "the core");
|
||||
switch (item.service)
|
||||
{
|
||||
case SERVICE_DATA:
|
||||
@ -576,6 +601,8 @@ void ModuleManager::AddService(ServiceProvider& item)
|
||||
|
||||
void ModuleManager::DelService(ServiceProvider& item)
|
||||
{
|
||||
ServerInstance->Logs.Log("SERVICE", LOG_DEBUG, "Deleting %s %s provided by %s", item.name.c_str(),
|
||||
item.GetTypeString(), item.creator ? item.creator->ModuleSourceFile.c_str() : "the core");
|
||||
switch (item.service)
|
||||
{
|
||||
case SERVICE_MODE:
|
||||
@ -586,7 +613,7 @@ void ModuleManager::DelService(ServiceProvider& item)
|
||||
case SERVICE_IOHOOK:
|
||||
{
|
||||
DelReferent(&item);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
throw ModuleException("Cannot delete unknown service type");
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
/// $CompilerFlags: find_compiler_flags("libargon2" "")
|
||||
|
||||
/// $LinkerFlags: find_linker_flags("libargon2" "-llibargon2")
|
||||
/// $LinkerFlags: find_linker_flags("libargon2" "-largon2")
|
||||
|
||||
/// $PackageInfo: require_system("arch") argon2 pkgconf
|
||||
/// $PackageInfo: require_system("darwin") argon2 pkg-config
|
||||
|
@ -247,14 +247,18 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
|
||||
Close();
|
||||
}
|
||||
|
||||
void SendHTTPError(unsigned int response)
|
||||
void SendHTTPError(unsigned int response, const char* errstr = NULL)
|
||||
{
|
||||
if (!errstr)
|
||||
errstr = http_status_str((http_status)response);
|
||||
|
||||
ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Sending HTTP error %u: %s", response, errstr);
|
||||
static HTTPHeaders empty;
|
||||
std::string data = InspIRCd::Format(
|
||||
"<html><head></head><body style='font-family: sans-serif; text-align: center'>"
|
||||
"<h1 style='font-size: 48pt'>Error %u</h1><h2 style='font-size: 24pt'>%s</h2><hr>"
|
||||
"<small>Powered by <a href='https://www.inspircd.org'>InspIRCd</a></small></body></html>",
|
||||
response, http_status_str((http_status)response));
|
||||
response, errstr);
|
||||
|
||||
Page(data, response, &empty);
|
||||
}
|
||||
@ -286,8 +290,10 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
|
||||
if (parser.upgrade || HTTP_PARSER_ERRNO(&parser))
|
||||
return;
|
||||
http_parser_execute(&parser, &parser_settings, recvq.data(), recvq.size());
|
||||
if (parser.upgrade || HTTP_PARSER_ERRNO(&parser))
|
||||
if (parser.upgrade)
|
||||
SendHTTPError(status_code ? status_code : 400);
|
||||
else if (HTTP_PARSER_ERRNO(&parser))
|
||||
SendHTTPError(status_code ? status_code : 400, http_errno_description((http_errno)parser.http_errno));
|
||||
}
|
||||
|
||||
void ServeData()
|
||||
@ -327,7 +333,32 @@ class HttpServerSocket : public BufferedSocket, public Timer, public insp::intru
|
||||
return false;
|
||||
|
||||
if (url.field_set & (1 << UF_PATH))
|
||||
out.path = uri.substr(url.field_data[UF_PATH].off, url.field_data[UF_PATH].len);
|
||||
{
|
||||
// Normalise the path.
|
||||
std::vector<std::string> pathsegments;
|
||||
irc::sepstream pathstream(uri.substr(url.field_data[UF_PATH].off, url.field_data[UF_PATH].len), '/');
|
||||
for (std::string pathsegment; pathstream.GetToken(pathsegment); )
|
||||
{
|
||||
if (pathsegment == ".")
|
||||
{
|
||||
// Stay at the current level.
|
||||
continue;
|
||||
}
|
||||
|
||||
if (pathsegment == "..")
|
||||
{
|
||||
// Traverse up to the previous level.
|
||||
if (!pathsegments.empty())
|
||||
pathsegments.pop_back();
|
||||
continue;
|
||||
}
|
||||
|
||||
pathsegments.push_back(pathsegment);
|
||||
}
|
||||
|
||||
out.path.reserve(url.field_data[UF_PATH].len);
|
||||
out.path.append("/").append(stdalgo::string::join(pathsegments, '/'));
|
||||
}
|
||||
|
||||
if (url.field_set & (1 << UF_FRAGMENT))
|
||||
out.fragment = uri.substr(url.field_data[UF_FRAGMENT].off, url.field_data[UF_FRAGMENT].len);
|
||||
|
@ -41,12 +41,12 @@ class ModuleHttpConfig : public Module, public HTTPRequestEventListener
|
||||
|
||||
ModResult OnHTTPRequest(HTTPRequest& request) override
|
||||
{
|
||||
if ((request.GetPath() != "/config") && (request.GetPath() != "/config/"))
|
||||
if (request.GetPath() != "/config")
|
||||
return MOD_RES_PASSTHRU;
|
||||
|
||||
ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Handling request for the HTTP /config route");
|
||||
std::stringstream buffer;
|
||||
ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Handling HTTP request for %s", request.GetPath().c_str());
|
||||
|
||||
std::stringstream buffer;
|
||||
for (auto& [_, tag] : ServerInstance->Config->config_data)
|
||||
{
|
||||
// Show the location of the tag in a comment.
|
||||
|
@ -432,32 +432,27 @@ class ModuleHttpStats : public Module, public HTTPRequestEventListener
|
||||
|
||||
ModResult HandleRequest(HTTPRequest* http)
|
||||
{
|
||||
std::string path = http->GetPath();
|
||||
|
||||
if (path != "/stats" && path.substr(0, 7) != "/stats/")
|
||||
if (http->GetPath() != "/stats")
|
||||
return MOD_RES_PASSTHRU;
|
||||
|
||||
if (path[path.size() - 1] == '/')
|
||||
path.erase(path.size() - 1, 1);
|
||||
|
||||
ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Handling httpd event");
|
||||
ServerInstance->Logs.Log(MODNAME, LOG_DEBUG, "Handling HTTP request for %s", http->GetPath().c_str());
|
||||
|
||||
bool found = true;
|
||||
std::stringstream data;
|
||||
data << "<inspircdstats>";
|
||||
|
||||
if (path == "/stats")
|
||||
if (http->GetPath() == "/stats")
|
||||
{
|
||||
data << Stats::ServerInfo << Stats::General
|
||||
<< Stats::XLines << Stats::Modules
|
||||
<< Stats::Channels << Stats::Users
|
||||
<< Stats::Servers << Stats::Commands;
|
||||
}
|
||||
else if (path == "/stats/general")
|
||||
else if (http->GetPath() == "/stats/general")
|
||||
{
|
||||
data << Stats::General;
|
||||
}
|
||||
else if (path == "/stats/users")
|
||||
else if (http->GetPath() == "/stats/users")
|
||||
{
|
||||
if (enableparams)
|
||||
Stats::ListUsers(data, http->GetParsedURI().query_params);
|
||||
|
@ -222,8 +222,7 @@ class ModuleLDAPOper : public Module
|
||||
return MOD_RES_PASSTHRU;
|
||||
|
||||
std::string acceptedhosts = tag->getString("host");
|
||||
std::string hostname = user->ident + "@" + user->GetRealHost();
|
||||
if (!InspIRCd::MatchMask(acceptedhosts, hostname, user->GetIPString()))
|
||||
if (!InspIRCd::MatchMask(acceptedhosts, user->MakeHost(), user->MakeHostIP()))
|
||||
return MOD_RES_PASSTHRU;
|
||||
|
||||
if (!LDAP)
|
||||
|
@ -162,7 +162,7 @@ class ModuleOverride
|
||||
|
||||
if (CanOverride(source, "MODE"))
|
||||
{
|
||||
std::string msg = source->nick + " overriding modes: ";
|
||||
std::string msg = source->nick + " used oper override to set modes on " + channel->name + ": ";
|
||||
|
||||
// Construct a MODE string in the old format for sending it as a snotice
|
||||
std::string params;
|
||||
|
@ -67,15 +67,15 @@ class CommandSanick : public Command
|
||||
/* Have we hit target's server yet? */
|
||||
if (target && IS_LOCAL(target))
|
||||
{
|
||||
std::string oldnick = user->nick;
|
||||
std::string newnick = target->nick;
|
||||
if (target->ChangeNick(parameters[1]))
|
||||
const std::string oldnick = target->nick;
|
||||
const std::string newnick = parameters[1];
|
||||
if (!ServerInstance->Users.FindNick(newnick) && target->ChangeNick(newnick))
|
||||
{
|
||||
ServerInstance->SNO.WriteGlobalSno('a', oldnick+" used SANICK to change "+newnick+" to "+parameters[1]);
|
||||
ServerInstance->SNO.WriteGlobalSno('a', user->nick + " used SANICK to change " + oldnick + " to " + newnick);
|
||||
}
|
||||
else
|
||||
{
|
||||
ServerInstance->SNO.WriteGlobalSno('a', oldnick+" failed SANICK (from "+newnick+" to "+parameters[1]+")");
|
||||
ServerInstance->SNO.WriteGlobalSno('a', user->nick + " failed SANICK (from " + oldnick + " to " + newnick + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -167,7 +167,7 @@ class SHA1HashProvider : public HashProvider
|
||||
{
|
||||
public:
|
||||
SHA1HashProvider(Module* mod)
|
||||
: HashProvider(mod, "hash/sha1", 20, 64)
|
||||
: HashProvider(mod, "sha1", 20, 64)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -159,6 +159,21 @@ void TreeSocket::SendCapabilities(int phase)
|
||||
extra = " CHALLENGE=" + this->GetOurChallenge();
|
||||
}
|
||||
|
||||
// 1205 HACK: Allow services to know what extbans exist.
|
||||
if (proto_version <= PROTO_INSPIRCD_30)
|
||||
{
|
||||
dynamic_reference_nocheck<ExtBan::Manager> extbanmgr(Utils->Creator, "extbanmanager");
|
||||
if (extbanmgr)
|
||||
{
|
||||
std::string extbanchars;
|
||||
for (const auto& [extban, _] : extbanmgr->GetLetterMap())
|
||||
extbanchars.push_back(extban);
|
||||
|
||||
if (!extbanchars.empty())
|
||||
extra.append(" EXTBANS=" + extbanchars);
|
||||
}
|
||||
}
|
||||
|
||||
this->WriteLine("CAPAB CAPABILITIES " /* Preprocessor does this one. */
|
||||
":NICKMAX="+ConvToStr(ServerInstance->Config->Limits.MaxNick)+
|
||||
" CHANMAX="+ConvToStr(ServerInstance->Config->Limits.MaxChannel)+
|
||||
|
@ -108,15 +108,11 @@ It appears that the server endpoint is using plaintext! Make sure that:
|
||||
- ssl_openssl
|
||||
- ssl_mbedtls
|
||||
|
||||
* If you have specified one or more <sslprofile> tags then the value of
|
||||
<bind:ssl> is the same as an <sslprofile:name> field. Otherwise, it should
|
||||
be set to "gnutls" for the ssl_gnutls module, "openssl" for the ssl_openssl
|
||||
module, or "mbedtls" for the ssl_mbedtls module.
|
||||
* The value of <bind:ssl> is the same as an <sslprofile:name> field.
|
||||
|
||||
* If you have specified the name of an <sslprofile> in <bind:ssl> then the
|
||||
value of <sslprofile:provider> is set to "gnutls" if using the ssl_gnutls
|
||||
module, "openssl" if using the ssl_openssl module, or "mbedtls" if using
|
||||
the ssl_mbedtls module.
|
||||
* The value of <sslprofile:provider> for your used SSL profile is set to
|
||||
"gnutls" if using the ssl_gnutle module, "openssl" if using the ssl_openssl
|
||||
module, or "mbedtls" if using the ssl_mbedtls module.
|
||||
|
||||
* If you have your SSL configuration in a file other than inspircd.conf then
|
||||
that file is included by inspircd.conf.
|
||||
|
Loading…
x
Reference in New Issue
Block a user