forked from inspircd/inspircd-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
- Loading branch information
Showing
14 changed files
with
612 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,7 @@ | |
*/ | ||
|
||
/// $ModAuthor: Sadie Powell <[email protected]> | ||
/// $ModConfig: <antiknock nickregex="(st|sn|cr|pl|pr|fr|fl|qu|br|gr|sh|sk|tr|kl|wr|bl|[bcdfgklmnprstvwz])([aeiou][aeiou][bcdfgklmnprstvwz])(ed|est|er|le|ly|y|ies|iest|ian|ion|est|ing|led|inger|[abcdfgklmnprstvwz])" docmd="yes" donick="yes" donotice="yes" doshun="yes" shunduration="15" shunreason="User was caught in an antiknock trap"> | ||
/// $ModConfig: <antiknock nickregex="(st|sn|cr|pl|pr|fr|fl|qu|br|gr|sh|sk|tr|kl|wr|bl|[bcdfgklmnprstvwz])([aeiou][aeiou][bcdfgklmnprstvwz])(ed|est|er|le|ly|y|ies|iest|ian|ion|est|ing|led|inger|[abcdfgklmnprstvwz])" docmd="yes" dokill="yes" donick="yes" donotice="yes" doshun="yes" shunduration="15" shunreason="User was caught in an antiknock trap"> | ||
/// $ModDesc: Attempts to block a common IRC spambot. | ||
/// $ModDepends: core 4 | ||
|
||
|
@@ -33,6 +33,7 @@ class ModuleAntiKnocker final | |
{ | ||
public: | ||
bool docmd; | ||
bool dokill; | ||
bool donick; | ||
bool donotice; | ||
bool doshun; | ||
|
@@ -56,12 +57,15 @@ class ModuleAntiKnocker final | |
delete sh; | ||
} | ||
|
||
std::string message; | ||
if (!user->IsFullyConnected()) | ||
message = "Connection timeout"; | ||
else | ||
message = INSP_FORMAT("Ping timeout: {} seconds", user->GetClass()->pingtime); | ||
ServerInstance->Users.QuitUser(user, message); | ||
if (dokill) | ||
{ | ||
std::string message; | ||
if (!user->IsFullyConnected()) | ||
message = "Connection timeout"; | ||
else | ||
message = INSP_FORMAT("Ping timeout: {} seconds", user->GetClass()->pingtime); | ||
ServerInstance->Users.QuitUser(user, message); | ||
} | ||
} | ||
|
||
ModuleAntiKnocker() | ||
|
@@ -87,6 +91,7 @@ class ModuleAntiKnocker final | |
} | ||
|
||
docmd = tag->getBool("docmd", true); | ||
dokill = tag->getBool("dokill", true); | ||
donick = tag->getBool("donick", true); | ||
donotice = tag->getBool("donotice", true); | ||
doshun = tag->getBool("doshun", true); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* InspIRCd -- Internet Relay Chat Daemon | ||
* | ||
* Copyright (C) 2012 Attila Molnar <[email protected]> | ||
* | ||
* This file is part of InspIRCd. InspIRCd is free software: you can | ||
* redistribute it and/or modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation, version 2. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/// $ModAuthor: Attila Molnar <[email protected]> | ||
/// $ModConfig: <connbanner text="Banner text goes here."> | ||
/// $ModDepends: core 4 | ||
/// $ModDesc: Displays a static text to every connecting user before registration | ||
|
||
|
||
#include "inspircd.h" | ||
|
||
class ModuleConnBanner final | ||
: public Module | ||
{ | ||
private: | ||
std::string text; | ||
|
||
public: | ||
ModuleConnBanner() | ||
: Module(VF_NONE, "Displays a static text to every connecting user before registration") | ||
{ | ||
} | ||
|
||
void ReadConfig(ConfigStatus& status) override | ||
{ | ||
const auto& tag = ServerInstance->Config->ConfValue("connbanner"); | ||
text = tag->getString("text"); | ||
} | ||
|
||
void OnUserPostInit(LocalUser* user) override | ||
{ | ||
if (!text.empty()) | ||
user->WriteNotice("*** " + text); | ||
} | ||
}; | ||
|
||
MODULE_INIT(ModuleConnBanner) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,8 +17,7 @@ | |
*/ | ||
|
||
|
||
/// $ModAuthor: Sadie Powell | ||
/// $ModAuthorMail: [email protected] | ||
/// $ModAuthor: Sadie Powell <[email protected]> | ||
/// $ModDesc: Prevents clients from sending messages that trigger CVE-2024-39844. | ||
/// $ModDepends: core 4 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* InspIRCd -- Internet Relay Chat Daemon | ||
* | ||
* Copyright (C) 2010-2012 Attila Molnar <[email protected]> | ||
* | ||
* This file is part of InspIRCd. InspIRCd is free software: you can | ||
* redistribute it and/or modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation, version 2. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
/// $ModAuthor: Attila Molnar <[email protected]> | ||
/// $ModDepends: core 4 | ||
/// $ModDesc: Provides the +a usermode that hides idle and signon time in WHOIS from non-opers | ||
|
||
|
||
#include "inspircd.h" | ||
#include "modules/whois.h" | ||
|
||
class ModuleHideIdle final | ||
: public Module | ||
, public Whois::LineEventListener | ||
{ | ||
private: | ||
SimpleUserMode hideidle; | ||
|
||
public: | ||
ModuleHideIdle() | ||
: Module(VF_NONE, "Provides the +a usermode that hides idle and signon time in WHOIS from non-opers") | ||
, Whois::LineEventListener(this) | ||
, hideidle(this, "hideidle", 'a') | ||
{ | ||
} | ||
|
||
ModResult OnWhoisLine(Whois::Context& whois, Numeric::Numeric& numeric) override | ||
{ | ||
if (numeric.GetNumeric() != RPL_WHOISIDLE) | ||
return MOD_RES_PASSTHRU; | ||
|
||
if (whois.GetSource() == whois.GetTarget()) | ||
return MOD_RES_PASSTHRU; | ||
|
||
if (!whois.GetTarget()->IsModeSet(hideidle)) | ||
return MOD_RES_PASSTHRU; | ||
|
||
if (!whois.GetSource()->HasPrivPermission("users/auspex")) | ||
return MOD_RES_DENY; | ||
|
||
return MOD_RES_PASSTHRU; | ||
} | ||
}; | ||
|
||
MODULE_INIT(ModuleHideIdle) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,11 +18,13 @@ | |
|
||
/// $CompilerFlags: find_compiler_flags("RapidJSON") | ||
|
||
/// $ModAuthor: Sadie Powell | ||
/// $ModAuthorMail: [email protected] | ||
/// $ModAuthor: Sadie Powell <[email protected]> | ||
/// $ModDepends: core 4 | ||
/// $ModDesc: Provides the DRAFT extjwt IRCv3 extension. | ||
|
||
/// $PackageInfo: require_system("debian~") rapidjson-dev | ||
/// $PackageInfo: require_system("darwin") rapidjson | ||
|
||
#include "inspircd.h" | ||
#include "modules/account.h" | ||
#include "modules/hash.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,10 +20,9 @@ | |
/// $LinkerFlags: find_linker_flags("libqrencode") | ||
|
||
/// $PackageInfo: require_system("arch") qrencode pkgconf | ||
/// $PackageInfo: require_system("centos") qrencode-devel pkgconfig | ||
/// $PackageInfo: require_system("darwin") qrencode pkg-config | ||
/// $PackageInfo: require_system("debian") libqrencode-dev pkg-config | ||
/// $PackageInfo: require_system("ubuntu") libqrencode-dev pkg-config | ||
/// $PackageInfo: require_system("debian~") libqrencode-dev pkg-config | ||
/// $PackageInfo: require_system("rhel~") qrencode-devel pkgconfig | ||
|
||
/// $ModAuthor: Sadie Powell <[email protected]> | ||
/// $ModDesc: Provides support for QR code generation via the /QRCODE command. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.