From c0a68cea9c4233edde89d8eca9b903bd25d510a5 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 28 Aug 2024 14:16:48 +0100 Subject: [PATCH] Tweak the whowas config defaults - Decrease the default number of nick groups. - Increase the days to keep records for. - Enable update on nick change by default. - Remove the upper bounds on the fields. --- docs/conf/inspircd.example.conf | 15 ++++++++------- src/coremods/core_whowas.cpp | 10 +++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/conf/inspircd.example.conf b/docs/conf/inspircd.example.conf index 92684fec7..d0bdd0f25 100644 --- a/docs/conf/inspircd.example.conf +++ b/docs/conf/inspircd.example.conf @@ -940,24 +940,25 @@ # # . + # a /WHOWAS . Defaults to 10. groupsize="10" # maxgroups: Maximum number of nickgroups that can be added to # the list so that /WHOWAS does not use a lot of resources on - # large networks. - maxgroups="100000" + # large networks. Defaults to 10000. + maxgroups="10000" # maxkeep: Maximum time a nick is kept in the whowas list # before being pruned. Time may be specified in seconds, # or in the following format: 1y2w3d4h5m6s. Minimum is - # 1 hour. - maxkeep="3d" + # 1 hour. Defaults to 7 days. + maxkeep="7d" # nickupdate: Whether to update the WHOWAS database on nick # change as well as quit. This can significantly increase the - # memory usage of your IRC server. - nickupdate="no"> + # memory usage of your IRC server so it is not recommended + # for large networks. Defaults to yes. + nickupdate="yes"> #-#-#-#-#-#-#-#-#-#-#-#-#-#- BAN OPTIONS -#-#-#-#-#-#-#-#-#-#-#-#-#-# # # diff --git a/src/coremods/core_whowas.cpp b/src/coremods/core_whowas.cpp index a196079d0..8623ec82e 100644 --- a/src/coremods/core_whowas.cpp +++ b/src/coremods/core_whowas.cpp @@ -470,12 +470,12 @@ public: void ReadConfig(ConfigStatus& status) override { const auto& tag = ServerInstance->Config->ConfValue("whowas"); - unsigned int NewGroupSize = tag->getNum("groupsize", 10, 0, 10000); - unsigned int NewMaxGroups = tag->getNum("maxgroups", 10240, 0, 1000000); - unsigned int NewMaxKeep = static_cast(tag->getDuration("maxkeep", 3600, 3600)); - nickupdate = tag->getBool("nickupdate"); + const auto groupsize = tag->getNum("groupsize", 10); + const auto maxgroups = tag->getNum("maxgroups", 10000); + const auto maxkeep = static_cast(tag->getDuration("maxkeep", 7*24*60*60, 60*60)); + nickupdate = tag->getBool("nickupdate", true); - cmd.manager.UpdateConfig(NewGroupSize, NewMaxGroups, NewMaxKeep); + cmd.manager.UpdateConfig(groupsize, maxgroups, maxkeep); } };