1
0
mirror of https://github.com/anope/anope.git synced 2026-06-12 19:14:47 +02:00

Add an option to disable the encryption and database module checks.

This commit is contained in:
Sadie Powell
2025-08-01 13:57:47 +01:00
parent 1245b43ade
commit 02aeb254ee
4 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -383,7 +383,7 @@ namespace Anope
/** Other command line options.
*/
extern CoreExport bool ReadOnly, NoFork, NoThird, NoPID, NoExpire, ProtocolDebug;
extern CoreExport bool ReadOnly, NoFork, NoThird, NoDB, NoPID, NoExpire, ProtocolDebug;
/** The root of the Anope installation. Usually ~/anope
*/
+10 -4
View File
@@ -382,6 +382,9 @@ bool Anope::Init(int ac, char **av)
if (GetCommandLineArgument("noexpire", 'e'))
Anope::NoExpire = true;
if (GetCommandLineArgument("nodb", 'b'))
Anope::NoDB = true;
if (GetCommandLineArgument("protocoldebug"))
Anope::ProtocolDebug = true;
@@ -552,11 +555,14 @@ bool Anope::Init(int ac, char **av)
setuidgid();
#endif
if (!ModuleManager::FindFirstOf(DATABASE))
throw CoreException("You must load a non-deprecated database module!");
if (!Anope::NoDB)
{
if (!ModuleManager::FindFirstOf(DATABASE))
throw CoreException("You must load a non-deprecated database module!");
if (!ModuleManager::FindFirstOf(ENCRYPTION))
throw CoreException("You must load a non-deprecated encryption module!");
if (!ModuleManager::FindFirstOf(ENCRYPTION))
throw CoreException("You must load a non-deprecated encryption module!");
}
if (!IRCD)
throw CoreException("You must load a protocol module!");
+1 -1
View File
@@ -24,7 +24,7 @@
/* Command-line options: */
unsigned Anope::Debug = 0;
bool Anope::ReadOnly = false, Anope::NoFork = false, Anope::NoThird = false, Anope::NoPID = false, Anope::NoExpire = false, Anope::ProtocolDebug = false;
bool Anope::ReadOnly = false, Anope::NoFork = false, Anope::NoThird = false, Anope::NoDB = false, Anope::NoPID = false, Anope::NoExpire = false, Anope::ProtocolDebug = false;
Anope::string Anope::ServicesDir;
Anope::string Anope::ServicesBin;
+3
View File
@@ -34,6 +34,9 @@ Module::Module(const Anope::string &modname, const Anope::string &, ModType modt
if (ModuleManager::FindModule(this->name))
throw CoreException("Module already exists!");
if (Anope::NoDB && type & DATABASE)
throw ModuleException("Database modules may not be loaded");
if (Anope::NoThird && type & THIRD)
throw ModuleException("Third party modules may not be loaded");