1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-07 20:23:12 +02:00

When using old set::anti-flood settings it is now a (big) warning instead

of an error. Also the warning will differ depending on whether you use
the defaults that were in example.conf for a long time, or some custom
settings.

It's not perfect but should help people with migrating from 5.0.x to 5.2.x.
This commit is contained in:
Bram Matthys
2021-06-06 17:32:46 +02:00
parent 3335eb3305
commit cc490ca924
2 changed files with 33 additions and 13 deletions
+2 -4
View File
@@ -9,20 +9,18 @@ The two main features are: an improved and more flexible anti-flood block
and channel history which can now be stored encrypted on disk and allows
clients to fetch hundreds/thousands of lines.
Breaking change:
Enhancements:
* The set::anti-flood block has been redone so you can have different limits
for ''unknown-users'' and ''known-users''.
* As a reminder, by default, "known-users" are users who are identified
to services OR are on an IP that has been connected for over 2 hours
in the past X days. The exact definition of "known-users" is in the
[security-group block](https://www.unrealircd.org/docs/Security-group_block).
* See [here](https://www.unrealircd.org/docs/FAQ#new-anti-flood-block)
* See [here](https://www.unrealircd.org/docs/Anti-flood_settings)
for more information on the layout of the new set::anti-flood block.
* All violatons of target-flood, nick-flood, join-flood, away-flood,
invite-flood, knock-flood, max-concurrent-conversations are now
reported to opers with the snomask ```f``` (flood).
Enhancements:
* Add support for database encryption. The way this works
is that you define an encryption password in a
[secret { } block](https://www.unrealircd.org/docs/Secret_block).
+31 -9
View File
@@ -8485,22 +8485,24 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
}
else if (!strcmp(cep->ce_varname, "anti-flood"))
{
int anti_flood_warned_old = 0;
int anti_flood_old = 0;
int anti_flood_old_and_default = 0;
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next)
{
/* Test for old options: */
if (flood_option_is_old(cepp->ce_varname))
{
/* Warn only once per block: */
if (anti_flood_warned_old == 0)
/* Special code if the user is using 100% of the defaults */
if (cepp->ce_vardata &&
((!strcmp(cepp->ce_varname, "nick-flood") && !strcmp(cepp->ce_vardata, "3:60")) ||
(!strcmp(cepp->ce_varname, "connect-flood") && cepp->ce_vardata && !strcmp(cepp->ce_vardata, "3:60")) ||
(!strcmp(cepp->ce_varname, "away-flood") && cepp->ce_vardata && !strcmp(cepp->ce_vardata, "4:120"))))
{
config_error("%s:%d: the set::anti-flood block has been reorganized to be more flexible. "
"See https://www.unrealircd.org/docs/FAQ#new-anti-flood-block for how to update your block. "
"Or simply remove all the anti-flood options from the conf to use UnrealIRCds defaults.",
cepp->ce_fileptr->cf_filename, cepp->ce_varlinenum);
anti_flood_warned_old = 1;
errors++;
anti_flood_old_and_default = 1;
} else
{
anti_flood_old = 1;
}
continue;
}
@@ -8763,6 +8765,26 @@ int _test_set(ConfigFile *conf, ConfigEntry *ce)
}
}
}
/* Now the warnings: */
if (anti_flood_old == 1)
{
config_warn("%s:%d: the set::anti-flood block has been reorganized to be more flexible. "
"Your custom anti-flood settings have NOT been read.",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
config_warn("See https://www.unrealircd.org/docs/Anti-flood_settings for the new block style,");
config_warn("OR: simply remove all the anti-flood options from the conf to get rid of this "
"warning and use the built-in defaults.");
} else
if (anti_flood_old_and_default == 1)
{
config_warn("%s:%d: the set::anti-flood block has been reorganized to be more flexible.",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
config_warn("To fix this warning, delete the anti-flood block from your configuration file "
"(file %s around line %d), this will make UnrealIRCd use the built-in defaults.",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
config_warn("If you want to learn more about the new functionality you can visit "
"https://www.unrealircd.org/docs/Anti-flood_settings");
}
}
else if (!strcmp(cep->ce_varname, "options")) {
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next) {