]> jfr.im git - irc/unrealircd/unrealircd.git/log
irc/unrealircd/unrealircd.git
7 months agoMake deny channel { } support escaped sequences like channel "#xyz\*"; unreal60_dev
Bram Matthys [Wed, 25 Oct 2023 17:45:04 +0000 (19:45 +0200)] 
Make deny channel { } support escaped sequences like channel "#xyz\*";
This so you can match a literal * or ? via \* and \?

And do the same for allow channel { }.

This can break current configs if you have a deny channel for a channel
with a slash in it, since a \ which already sortof needed to be \\ in
the config file, now needs to be \\\\ (doesn't that look great?).
Fortunately slashes are not really common in channel names, let alone
deny channel { } configuration.

7 months agoReserve more file descriptors. Eg when 10.000 are available, reserve 250.
Bram Matthys [Wed, 25 Oct 2023 09:57:41 +0000 (11:57 +0200)] 
Reserve more file descriptors. Eg when 10.000 are available, reserve 250.
Since 10k+ fd's available is the common situation, this means we then have
250 fd's reserved for non-clients, such as HTTPS callbacks and other things.

Previously:
<1024: reserve 4 fd's
1024+: reserve 8 fd's

Now:
<1024: reserve 8 fd's
1024-2047: reserve 16 fd's
2048-10000: reserve 32 fd's
10000+: reserve 250 fd's

7 months agoFix HOOKTYPE_IS_HANDSHAKE_FINISHED not called at two places where
Bram Matthys [Mon, 23 Oct 2023 17:02:03 +0000 (19:02 +0200)] 
Fix HOOKTYPE_IS_HANDSHAKE_FINISHED not called at two places where
register_user() is called.

7 months agoMake autoconf check for getsockopt TCP_INFO and define HAVE_TCP_INFO
Bram Matthys [Mon, 23 Oct 2023 08:33:47 +0000 (10:33 +0200)] 
Make autoconf check for getsockopt TCP_INFO and define HAVE_TCP_INFO
At the moment only for third/centralblocklist

Also bump #define UNREAL_VERSION_TIME    202343

7 months agoLimit operclass name to a-zA-Z0-9_- and use the same validation in ~operclass extban.
Bram Matthys [Mon, 23 Oct 2023 07:48:40 +0000 (09:48 +0200)] 
Limit operclass name to a-zA-Z0-9_- and use the same validation in ~operclass extban.
This fixes the issue where +e/+I ~operclass:name gets cut off if the
name contains any digits.

Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6353

Also, we previously allowed any characters in the operclass, which is not
a great idea.

7 months agoSend central-blocklist hits globally
Bram Matthys [Sat, 21 Oct 2023 14:01:00 +0000 (16:01 +0200)] 
Send central-blocklist hits globally

7 months agoFix a compile problem on 32-bit archs.
Bram Matthys [Fri, 13 Oct 2023 06:14:19 +0000 (08:14 +0200)] 
Fix a compile problem on 32-bit archs.
(well not really fix, but move it behind a DEBUGMODE ifdef)

7 months agoFix some markup in release notes
Bram Matthys [Fri, 13 Oct 2023 05:48:33 +0000 (07:48 +0200)] 
Fix some markup in release notes
[skip ci]

7 months ago** UnrealIRCd 6.1.2.3 **
Bram Matthys [Fri, 13 Oct 2023 05:45:13 +0000 (07:45 +0200)] 
** UnrealIRCd 6.1.2.3 **

7 months agoFix ::exclude-security-group not working.
Bram Matthys [Thu, 12 Oct 2023 16:46:18 +0000 (18:46 +0200)] 
Fix ::exclude-security-group not working.
Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6350

7 months agourl_unreal: Fix build (#262)
Val Lorentz [Thu, 12 Oct 2023 05:12:56 +0000 (07:12 +0200)] 
url_unreal: Fix build (#262)

Broken by 9a6a06b63f71c0c4d1d53bd10a867d0c22597910

7 months agoAdd set::dns and increase DNS timeout for DNSBL (3000ms first, then on retry 6000ms).
Bram Matthys [Wed, 11 Oct 2023 16:56:12 +0000 (18:56 +0200)] 
Add set::dns and increase DNS timeout for DNSBL (3000ms first, then on retry 6000ms).
This is quite a bit higher than client DNS lookups (1500ms first, on retry 3000ms)
and is because some DNSBL are reported to be quite a bit slower than ordinary DNS.
(Maybe just some, but.. the higher timeout does not hurt anyone anyway)

Note that all this has no effect on client handshake times, as DNSBL checks are
done in the background. Only side-effect is that if we do get a "late hit" then
you may now see a kill a few seconds after the client is online (which was actually
already possible before too for quick clients, but.. yeah...)

These settings can be overriden via set::dns, these are the defaults:

set {
        dns {
                client {
                        timeout 1500;
                        retry 2;
                }
                dnsbl {
                        timeout 3000;
                        retry 2;
                }
        }
}

When you REHASH we will check if the values are different than the current
c-ares settings and if so, reinitialize the resolver. Reinitializing the
resolver will destroy outstanding DNS requests, eg DNS lookups for clients
currently connecting, but so be it. Not a super-huge issue since changing
this is rare.

Requested by BlackBishop in https://bugs.unrealircd.org/view.php?id=6306

7 months agoSplit resolver channel into two: client & dnsbl
Bram Matthys [Wed, 11 Oct 2023 16:08:26 +0000 (18:08 +0200)] 
Split resolver channel into two: client & dnsbl

7 months agoFix UTF8 not working in spamfilter { } blocks, only after the first REHASH.
Bram Matthys [Sun, 8 Oct 2023 16:32:26 +0000 (18:32 +0200)] 
Fix UTF8 not working in spamfilter { } blocks, only after the first REHASH.
With error messages about it possibly but also possibly not (silently failing).

This is actually quite bad because when the ircd is running, you could
happily add spamfilters with UTF8 like stuff, REHASH fine, but if you
then restart the IRCd would fail to boot due to a config error.

Reported by BlackBishop.

7 months agoFix possible REHASH crash in some circumstances (also in 6.1.*)
Bram Matthys [Sat, 7 Oct 2023 15:23:02 +0000 (17:23 +0200)] 
Fix possible REHASH crash in some circumstances (also in 6.1.*)

If you make a parser mistake in the config file, like a missing semicolon,
then under some circumstances the server may crash. Not always, it seems,
which explains why this bug is not reported that much.

7 months ago** UnrealIRCd 6.1.2.2 **
Bram Matthys [Fri, 6 Oct 2023 07:37:51 +0000 (09:37 +0200)] 
** UnrealIRCd 6.1.2.2 **

7 months agoAdd support for "REHASH -centralspamfilter" (alias "REHASH -cs") to force
Bram Matthys [Fri, 6 Oct 2023 06:42:17 +0000 (08:42 +0200)] 
Add support for "REHASH -centralspamfilter" (alias "REHASH -cs") to force
an immediate fetch+load of central spamfilter rules, so you don't have
to wait an hour (or whatever is configured).

7 months agoMake central spamfilters show in STATS spamfilter as "-centralspamfilter-"
Bram Matthys [Fri, 6 Oct 2023 06:24:20 +0000 (08:24 +0200)] 
Make central spamfilters show in STATS spamfilter as "-centralspamfilter-"
rather than "-config-". Suggested by Lord255.
[skip ci]

7 months agoFix another instance of "STATS spamfilter" accidentally containing spaces
Bram Matthys [Fri, 6 Oct 2023 05:44:24 +0000 (07:44 +0200)] 
Fix another instance of "STATS spamfilter" accidentally containing spaces
When using multi-targets like spamfilter { action { report; block; } }
it would output in stats like "report, block". Now changed to "report,block"

7 months agoFix STATS output for config-based spamfilters with reasons with spaces.
Bram Matthys [Fri, 6 Oct 2023 05:36:26 +0000 (07:36 +0200)] 
Fix STATS output for config-based spamfilters with reasons with spaces.

For config-based spamfilters, the reason was not escaped, meaning that
spaces and underscores did not work as expected.
For example, in "STATS spamfilter" the spaces were displayed as-is
which means that the numeric output was not really parsable.

Apparently this bug exists since UnrealIRCd 5 already...

7 months agoFix possible crash on SETNAME with spamfilter 'u'.
Bram Matthys [Fri, 6 Oct 2023 05:12:15 +0000 (07:12 +0200)] 
Fix possible crash on SETNAME with spamfilter 'u'.
[skip ci]

7 months agoFix tkldb storing (and restoring) central spamfilters.
Bram Matthys [Fri, 6 Oct 2023 05:08:22 +0000 (07:08 +0200)] 
Fix tkldb storing (and restoring) central spamfilters.
These should not be in tkldb, just like config-based spamfilters are not.

7 months agoDon't allow central spamfilter without 'reason'
Bram Matthys [Fri, 6 Oct 2023 05:00:44 +0000 (07:00 +0200)] 
Don't allow central spamfilter without 'reason'

7 months agoDon't crash when reading spamfilters from tkldb that don't compile (anymore).
Bram Matthys [Thu, 5 Oct 2023 15:37:06 +0000 (17:37 +0200)] 
Don't crash when reading spamfilters from tkldb that don't compile (anymore).
For example, because of a different version of PCRE2, or because of the switch
from non-UTF8 to UTF8 (or vice versa) which disallows certain byte sequences.

7 months agoFix minor compiler warning on conflicting types for Auth_Hash (PR #261)
alice [Thu, 5 Oct 2023 05:43:17 +0000 (06:43 +0100)] 
Fix minor compiler warning on conflicting types for Auth_Hash (PR #261)

auth.c:569:13: error: conflicting types for 'Auth_Hash' due to enum/integer mismatch; have 'const char *(AuthenticationType,  const char *)' [-Werror=enum-int-mismatch]
  569 | const char *Auth_Hash(AuthenticationType type, const char *text)
In file included from include/unrealircd.h:32, from auth.c:21:
include/h.h:547:26: note: previous declaration of 'Auth_Hash' with type 'const char *(int,  const char *)'
  547 | extern const char       *Auth_Hash(int type, const char *para);

7 months ago** UnrealIRCd 6.1.2.1 **
Bram Matthys [Wed, 4 Oct 2023 08:22:43 +0000 (10:22 +0200)] 
** UnrealIRCd 6.1.2.1 **

7 months agoFix crash on REHASH with crule (such as spamfilter::rule).
Bram Matthys [Wed, 4 Oct 2023 08:14:09 +0000 (10:14 +0200)] 
Fix crash on REHASH with crule (such as spamfilter::rule).
This happens when !, || or && are used, though the exact requirements
for the crash may also require a function with arguments.

Reported by BlackBishop.

8 months ago** UnrealIRCd 6.1.2 **
Bram Matthys [Wed, 4 Oct 2023 05:11:36 +0000 (07:11 +0200)] 
** UnrealIRCd 6.1.2 **

8 months agoAdd Windows .gitignore files (#260)
Juest Zungo [Wed, 4 Oct 2023 05:11:12 +0000 (02:11 -0300)] 
Add Windows .gitignore files (#260)

8 months agoUpdate help.conf (#259)
PeGaSuS [Wed, 4 Oct 2023 05:10:17 +0000 (07:10 +0200)] 
Update help.conf (#259)

Added missing action type "~flood"

8 months agoRemove client->local->next_nick_allowed which is unused nowadays.
Bram Matthys [Mon, 2 Oct 2023 12:26:01 +0000 (14:26 +0200)] 
Remove client->local->next_nick_allowed which is unused nowadays.
It was moved to the generic anti-flood framework which is
FloodCounter flood[MAXFLOODOPTIONS];

8 months agoCall fd_unnotify() on SetDeadSocket(), since we don't care anymore.
Bram Matthys [Mon, 2 Oct 2023 12:25:24 +0000 (14:25 +0200)] 
Call fd_unnotify() on SetDeadSocket(), since we don't care anymore.

8 months agoAdd small caveat for limited score bumping (running mixed net)
Bram Matthys [Sat, 23 Sep 2023 10:02:31 +0000 (12:02 +0200)] 
Add small caveat for limited score bumping (running mixed net)
[skip ci]

8 months agoAlmost forgot version bump in setup.h
Bram Matthys [Sat, 23 Sep 2023 09:46:53 +0000 (11:46 +0200)] 
Almost forgot version bump in setup.h
[skip ci]

8 months ago** UnrealIRCd 6.1.2-rc2 **
Bram Matthys [Sat, 23 Sep 2023 09:19:41 +0000 (11:19 +0200)] 
** UnrealIRCd 6.1.2-rc2 **

8 months agoUpdate release notes
Bram Matthys [Sat, 23 Sep 2023 08:52:29 +0000 (10:52 +0200)] 
Update release notes
[skip ci]

8 months agoFix NULL pointer crash due to reputation code changes from yesterday
Bram Matthys [Mon, 18 Sep 2023 07:16:17 +0000 (09:16 +0200)] 
Fix NULL pointer crash due to reputation code changes from yesterday

8 months agoUpdate account extban in help.conf (#254)
PeGaSuS [Sun, 17 Sep 2023 10:14:32 +0000 (12:14 +0200)] 
Update account extban in help.conf (#254)

Specify the use of `~account:*` and `~account:0` on the usage of ~account extban on the helpop output.

8 months agoDon't bump reputation scores anymore for users who are in no channels or
Bram Matthys [Sun, 17 Sep 2023 09:41:31 +0000 (11:41 +0200)] 
Don't bump reputation scores anymore for users who are in no channels or
when they are only in channel(s) with very low member counts.

This because some typical bot/drone behavior is not to join any channels.
This kinda forces them to expose themselves a bit more (and if they don't,
they don't get more reputation).

The downside is for the unusual case where a legit chatter would be on
the network but not joining any channels, but that is rare. In any case,
this setting can be adjusted if that is typical or more normal behavior
on your network :D.

* The [reputation score](https://www.unrealircd.org/docs/Reputation_score)
  of connected users (actually IP's) is increased every 5 minutes. We still
  do this, but only for users who are at least in one channel that has 3
  or more members. This setting is tweakable via
  [set::reputation::score-bump-timer-minimum-channel-members](https://www.unrealircd.org/docs/Set_block#set::reputation).
  Setting this to 0 means to bump scores also for people who are in no
  channels at all, which was the behavior in previous UnrealIRCd versions.

8 months agoUse client:set:reputation oper privilege for latest change
Bram Matthys [Sun, 17 Sep 2023 07:58:21 +0000 (09:58 +0200)] 
Use client:set:reputation oper privilege for latest change
[skip ci]

8 months agoSupport setting of reputation via /REPUTATION <nick|ip> <value>
Bram Matthys [Sun, 17 Sep 2023 07:55:59 +0000 (09:55 +0200)] 
Support setting of reputation via /REPUTATION <nick|ip> <value>
Useful for testing and.. well.. perhaps other things.

8 months agoAllow setting reputation in https://www.unrealircd.org/docs/Actions via
Bram Matthys [Sun, 17 Sep 2023 07:39:55 +0000 (09:39 +0200)] 
Allow setting reputation in https://www.unrealircd.org/docs/Actions via
action { set REPUTATION--; } and similar.

Also enhancement to reputation S2S traffic, to support decreasing:
  *
+ * Since UnrealIRCd 6.0.2+ there is now also asterisk-score-asterisk:
+ * :server REPUTATION 1.2.3.4 *2*
+ * The leading asterisk means no reply will be sent back, ever, and the
+ * trailing asterisk will mean it is a "FORCED SET", which means that
+ * servers should set the reputation to that value, even if it is lower.
+ * This way reputation can be reduced and the reducation can be synced
+ * across servers, which was not possible before 6.0.2.
+ *

So if you are actually decreasing reputation, you need all servers on
6.0.2 or higher for it to work properly, otherwise the other servers
don't decrease it, and next connect the highest wins again, etc.

8 months agoUpdate example.conf with Windows commands for mkpasswd/gencloak/spkifp
Bram Matthys [Wed, 13 Sep 2023 17:49:59 +0000 (19:49 +0200)] 
Update example.conf with Windows commands for mkpasswd/gencloak/spkifp
These work since UnrealIRCd 6.0.2.

8 months agoAdd set::blacklist::recheck-time 'never' to disable rechecking and document
Bram Matthys [Sat, 9 Sep 2023 09:20:32 +0000 (11:20 +0200)] 
Add set::blacklist::recheck-time 'never' to disable rechecking and document
this and blacklist::recheck.

8 months agoAdd blacklist::recheck to skip a dnsbl from rechecks.
Bram Matthys [Sat, 9 Sep 2023 09:09:01 +0000 (11:09 +0200)] 
Add blacklist::recheck to skip a dnsbl from rechecks.

Suggested by BlackBishop in https://bugs.unrealircd.org/view.php?id=6307

8 months ago'./unrealircd module upgrade' only showed output for one module upgrade,
Bram Matthys [Sat, 9 Sep 2023 08:38:46 +0000 (10:38 +0200)] 
'./unrealircd module upgrade' only showed output for one module upgrade,
even when multiple modules were upgraded.

Actually not sure about the cause and how this is possible, but running
'make install' only once at the end is the solution, which is something
that should be done that way anyway.

Reported by westor in https://bugs.unrealircd.org/view.php?id=5919

8 months agoConfig file: when not using quotes, don't silently drop slashes in names/values.
Bram Matthys [Sat, 9 Sep 2023 07:41:47 +0000 (09:41 +0200)] 
Config file: when not using quotes, don't silently drop slashes in names/values.

In the config file, when not using quotes, a slash at the beginning of a
variable name or value was silently discarded (eg `file /tmp/xyz;` resulted
in a file `tmp/xyz`).

Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6325

8 months agoForgot to mention set::blacklist::recheck-time in release notes.
Bram Matthys [Fri, 8 Sep 2023 16:22:53 +0000 (18:22 +0200)] 
Forgot to mention set::blacklist::recheck-time in release notes.
[skip ci]

8 months ago** UnrealIRCd 6.1.2-rc1 **
Bram Matthys [Fri, 8 Sep 2023 15:46:18 +0000 (17:46 +0200)] 
** UnrealIRCd 6.1.2-rc1 **

8 months agoUpdate curl-ca-bundle to Tue Aug 22 03:12:04 2023 GMT
Bram Matthys [Fri, 8 Sep 2023 15:37:28 +0000 (17:37 +0200)] 
Update curl-ca-bundle to Tue Aug 22 03:12:04 2023 GMT
[skip ci]

8 months agoIntegrate third/blacklistrecheck functionality (set::blacklist::recheck-time)
Bram Matthys [Wed, 6 Sep 2023 14:31:55 +0000 (16:31 +0200)] 
Integrate third/blacklistrecheck functionality (set::blacklist::recheck-time)
https://www.unrealircd.org/docs/Set_block#set::blacklist::recheck-time

9 months agoIn `HOOKTYPE_PRE_CHANMSG` the `mtags` is now a `MessageTag **`,
Bram Matthys [Sat, 19 Aug 2023 15:26:14 +0000 (17:26 +0200)] 
In `HOOKTYPE_PRE_CHANMSG` the `mtags` is now a `MessageTag **`,
so a pointer-to-a-pointer rather than a pointer, to allow stripping
message tags by modules. Needed for a module from Valware.

9 months agoShow who actually tried to use a banned nick.
Bram Matthys [Sat, 19 Aug 2023 10:17:00 +0000 (12:17 +0200)] 
Show who actually tried to use a banned nick.
Reported by Amiga600 in https://bugs.unrealircd.org/view.php?id=6300
Inspired by patch from Valware in https://github.com/unrealircd/unrealircd/pull/255

9 months agoRemember answer to "generate certificate" question in ./Config (#256)
netjester [Sat, 19 Aug 2023 10:06:09 +0000 (11:06 +0100)] 
Remember answer to "generate certificate" question in ./Config (#256)

10 months agoFix crash when ~security-group:securitygroup is used in conf (so old style
Bram Matthys [Wed, 26 Jul 2023 10:44:31 +0000 (12:44 +0200)] 
Fix crash when ~security-group:securitygroup is used in conf (so old style
in eg ban user::mask).
Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6319

10 months agoMake central spamfilters require an 'id', and ignore for non-central.
Bram Matthys [Fri, 21 Jul 2023 10:24:45 +0000 (12:24 +0200)] 
Make central spamfilters require an 'id', and ignore for non-central.
At least for now...

10 months agoAdd set::central-spamfilter::feed and update the page at
Bram Matthys [Fri, 21 Jul 2023 10:02:23 +0000 (12:02 +0200)] 
Add set::central-spamfilter::feed and update the page at
https://www.unrealircd.org/docs/Central_Spamfilter

10 months agoSpamfilter fixes: prevent actions that are currently config-only from
Bram Matthys [Thu, 20 Jul 2023 12:50:40 +0000 (14:50 +0200)] 
Spamfilter fixes: prevent actions that are currently config-only from
being added by other servers and being able to spread to areas of
which the code is currently not ready for ('set', 'report', 'stop').

10 months agoUse (*errors)++ consistently.
Bram Matthys [Mon, 17 Jul 2023 07:01:43 +0000 (09:01 +0200)] 
Use (*errors)++ consistently.

This fixes one bug from yesterday in securitygroup.c:258,
fixes 2 (harmless) warnings and other than that just style.

10 months agoUpdate release notes a bit
Bram Matthys [Sun, 16 Jul 2023 17:56:19 +0000 (19:56 +0200)] 
Update release notes a bit
[skip ci]

10 months agoAdd new spamfilter type 'raw' which matches against a raw command/protocol line.
Bram Matthys [Sun, 16 Jul 2023 17:47:43 +0000 (19:47 +0200)] 
Add new spamfilter type 'raw' which matches against a raw command/protocol line.

SPAMFILTER add -simple R block - Hi_there! LIST*

Though it is more useful in complex spamfilter rules in the conf, presumably.

10 months agoFix memory leak if using sni blocks
Bram Matthys [Sun, 16 Jul 2023 16:52:32 +0000 (18:52 +0200)] 
Fix memory leak if using sni blocks

10 months agoPossibly fix Windows build.
Bram Matthys [Sun, 16 Jul 2023 16:29:47 +0000 (18:29 +0200)] 
Possibly fix Windows build.

10 months agoRemove antimixedutf8 changes from release notes
Bram Matthys [Sun, 16 Jul 2023 15:46:40 +0000 (17:46 +0200)] 
Remove antimixedutf8 changes from release notes
[skip ci]

10 months agoRevert antimixedutf8 changes from earlier, back to 6.1.1(.1) version again.
Bram Matthys [Sun, 16 Jul 2023 15:27:47 +0000 (17:27 +0200)] 
Revert antimixedutf8 changes from earlier, back to 6.1.1(.1) version again.

10 months agoUpdate release notes
Bram Matthys [Sun, 16 Jul 2023 10:32:02 +0000 (12:32 +0200)] 
Update release notes
[skip ci]

10 months agoFix set unknown-users { } not working
Bram Matthys [Sun, 16 Jul 2023 10:22:16 +0000 (12:22 +0200)] 
Fix set unknown-users { } not working
Repoerted by BlackBishop in https://bugs.unrealircd.org/view.php?id=6292

10 months agoAdd security-group::rule support, see https://www.unrealircd.org/docs/Crule
Bram Matthys [Sun, 16 Jul 2023 10:06:34 +0000 (12:06 +0200)] 
Add security-group::rule support, see https://www.unrealircd.org/docs/Crule

10 months agospamfilter::rule: add destination('#xyz') support (supports wildcards)
Bram Matthys [Sun, 16 Jul 2023 09:29:53 +0000 (11:29 +0200)] 
spamfilter::rule: add destination('#xyz') support (supports wildcards)

10 months agocrule: add inchannel('#xyz'), and inchannel('@#needopshere') works too
Bram Matthys [Sun, 16 Jul 2023 09:21:35 +0000 (11:21 +0200)] 
crule: add inchannel('#xyz'), and inchannel('@#needopshere') works too

10 months agoMake 'channel' work in security groups.
Bram Matthys [Sun, 16 Jul 2023 09:05:07 +0000 (11:05 +0200)] 
Make 'channel' work in security groups.

10 months agocrule: code cleanups / conform a bit more to unrealircd style
Bram Matthys [Sun, 16 Jul 2023 08:50:57 +0000 (10:50 +0200)] 
crule: code cleanups / conform a bit more to unrealircd style

10 months agocrule/spamfilter: pass text in crule context, not used yet, but could
Bram Matthys [Sun, 16 Jul 2023 08:46:01 +0000 (10:46 +0200)] 
crule/spamfilter: pass text in crule context, not used yet, but could
be useful in some future crule function.
[skip ci]

10 months agocrule: remove CR_DEBUG, bump some limits and remove collapse() call
Bram Matthys [Sun, 16 Jul 2023 08:38:01 +0000 (10:38 +0200)] 
crule: remove CR_DEBUG, bump some limits and remove collapse() call

10 months agoMove crule to a module, so we can hot-patch if needed in the future.
Bram Matthys [Sun, 16 Jul 2023 08:30:57 +0000 (10:30 +0200)] 
Move crule to a module, so we can hot-patch if needed in the future.
This is a mandatory module to load, and included in modules.default.conf.

This also meant that the crule_test() etc efunctions are available
before running config test routines, so we now have a flag for
early efuncs. I guess we could consider doing that for all efuncs
though, so not sure if this flag is really needed.

10 months agoSupport single quotes in spamfilter::rule, for like xyz('bla/bla')
Bram Matthys [Sun, 16 Jul 2023 07:29:18 +0000 (09:29 +0200)] 
Support single quotes in spamfilter::rule, for like xyz('bla/bla')

10 months agoAdd some more spamfilter::rule functions
Bram Matthys [Sun, 16 Jul 2023 07:20:54 +0000 (09:20 +0200)] 
Add some more spamfilter::rule functions

10 months agoUpdate release notes a bit
Bram Matthys [Sun, 16 Jul 2023 07:07:57 +0000 (09:07 +0200)] 
Update release notes a bit
[skip ci]

10 months agoWarn on plaintext oper::password in conf and even go as far as
Bram Matthys [Sat, 15 Jul 2023 16:48:27 +0000 (18:48 +0200)] 
Warn on plaintext oper::password in conf and even go as far as
generating the password hashes and suggesting using those.

This also starts the initial work on set::best-practices
https://www.unrealircd.org/docs/Set_block#set::best-practices
with hashed-passwords as the first setting there.

10 months agoShowing this "Configuration test passed OK" makes no sense after
Bram Matthys [Sat, 15 Jul 2023 16:45:28 +0000 (18:45 +0200)] 
Showing this "Configuration test passed OK" makes no sense after
"Configuration loaded", i think it was meant for ./unrealircd configtest
only.

[skip ci]

10 months agoFor watch away notification, a user who is away could change their nick,
Bram Matthys [Sat, 15 Jul 2023 14:47:55 +0000 (16:47 +0200)] 
For watch away notification, a user who is away could change their nick,
and that nick could be on someones watch list. In such a case we
should not only send RPL_LOGON but also a RPL_GONEAWAY.

Reported by Khaled and fix suggested by Khaled & Sadie.

10 months agoWATCH away notification: fix RPL_GONEAWAY and RPL_REAWAY not being sent
Bram Matthys [Sat, 15 Jul 2023 14:41:21 +0000 (16:41 +0200)] 
WATCH away notification: fix RPL_GONEAWAY and RPL_REAWAY not being sent
due to wrong event name being used. Noticed this bug in U6 (and
this bug does not exist in U5) after being pointed at watch away
notification again.

10 months agoLower argon2 parameters so the algorithm runs at a more reasonable speed.
Bram Matthys [Sat, 15 Jul 2023 07:05:59 +0000 (09:05 +0200)] 
Lower argon2 parameters so the algorithm runs at a more reasonable speed.

10 months agoMention password hashing in the example.conf itself.
Bram Matthys [Sat, 15 Jul 2023 06:58:57 +0000 (08:58 +0200)] 
Mention password hashing in the example.conf itself.
Suggested by rafaelgrether in https://bugs.unrealircd.org/view.php?id=6303

10 months agoDefault to argon2 library shipped with UnrealIRCd, the reason
Bram Matthys [Sat, 15 Jul 2023 06:49:11 +0000 (08:49 +0200)] 
Default to argon2 library shipped with UnrealIRCd, the reason
for this is that system argon2 is often much slower (2x slower
on Ubuntu and Debian, for instance), which is not good.
You can still use the system library with the configure option:
--with-system-argon2

10 months agoFix downloads_in_progress() always returning 0 if using cURL
Bram Matthys [Fri, 14 Jul 2023 15:01:59 +0000 (17:01 +0200)] 
Fix downloads_in_progress() always returning 0 if using cURL

10 months agoChange definition of parse_ban_action_config(), was too easy to leak memory.
Bram Matthys [Fri, 14 Jul 2023 06:07:23 +0000 (08:07 +0200)] 
Change definition of parse_ban_action_config(), was too easy to leak memory.

Often you have default values for the config, and then a subsequent config
parsing run would overwrite the return value (= memory leak), merging/appending
would make no sense either, so it would force a free in all code before
calling us, well... let's just deal with it ourselves instead then ;)

10 months agoImplement spamreport::rate-limit
Bram Matthys [Tue, 11 Jul 2023 18:18:07 +0000 (20:18 +0200)] 
Implement spamreport::rate-limit

10 months agoFix compile problem on Windows
Bram Matthys [Tue, 11 Jul 2023 14:26:06 +0000 (16:26 +0200)] 
Fix compile problem on Windows
[skip ci]

10 months agoMake Cmode_t an unsigned long long to have more chanmodes on 32 bit archs.
Bram Matthys [Tue, 11 Jul 2023 13:25:21 +0000 (15:25 +0200)] 
Make Cmode_t an unsigned long long to have more chanmodes on 32 bit archs.
Reported by BlackBishop in https://bugs.unrealircd.org/view.php?id=6301
[skip ci]

10 months agoAdd some explicit cast to fix warning on 32 bit archs.
Bram Matthys [Tue, 11 Jul 2023 13:18:51 +0000 (15:18 +0200)] 
Add some explicit cast to fix warning on 32 bit archs.

Yeah we could use %z here nowadays but we don't have strict C99 requirements(?),
well we have some :D

[skip ci]

10 months agoCentral spamfilter: fix memory leak (freeing ce/cfptr)
Bram Matthys [Tue, 11 Jul 2023 13:14:09 +0000 (15:14 +0200)] 
Central spamfilter: fix memory leak (freeing ce/cfptr)
[skip ci]

10 months agoFix tkldb crash, had to do with stealing references.
Bram Matthys [Tue, 11 Jul 2023 12:46:19 +0000 (14:46 +0200)] 
Fix tkldb crash, had to do with stealing references.

10 months agoFix write bug in tkldb and add spamfilter::action stop.
Bram Matthys [Tue, 11 Jul 2023 12:16:12 +0000 (14:16 +0200)] 
Fix write bug in tkldb and add spamfilter::action stop.
The spamfilter::action stop ill prevent processing other spamfilters.
This would normally be a bit unusual, and potentially dangerous when you
do exclude things this way, but can be useful in some circumstances.

Stopping only affects the same type of spamfilters (general or central
spamfilters), so they don't interfere.

The tkldb write DB bug had to do with that it was processing
central spamfilters, which should be skipped just like config
based spamfilters were already skipped.

10 months agoCentral spamfilter: don't stop processing on 1 bad spamfilter block.
Bram Matthys [Tue, 11 Jul 2023 11:34:28 +0000 (13:34 +0200)] 
Central spamfilter: don't stop processing on 1 bad spamfilter block.

10 months agoFix crash in spamfilter { } block handling due to unitialized variable
Bram Matthys [Tue, 11 Jul 2023 10:15:01 +0000 (12:15 +0200)] 
Fix crash in spamfilter { } block handling due to unitialized variable

10 months agoNew option set::spamfilter::show-message-content-on-hit:
Bram Matthys [Tue, 11 Jul 2023 09:50:28 +0000 (11:50 +0200)] 
New option set::spamfilter::show-message-content-on-hit:
you can now configure to hide the message content in spamfilter hit
messages. Generally it is very useful to see if a spamfilter hit is
correct or not, so the default is 'always', but it also has privacy
implications so there is now this option to disable it.

Suggested by alice, quite a while ago.

https://www.unrealircd.org/docs/Set_block#set::spamfilter::show-message-content-on-hit

Also as mentioned there:
UnrealIRCd has the following spying countermeasure (for many years) to help
that spamfilters are not abused for spying. When a spamfilter hit happens
that has an action like gline or blocking, it is visible to the user that an
action was taken. There is also the action 'warn', which means: take no
action and only warn IRCOps, that one would be easy to use as a spy tool, so
when this happens and message content was revealed, numeric 659
(RPL_SPAMCMDFWD) is sent to the client to indicate that the message is
allowed through but IRCOps were informed.
With this new set::spamfilter::show-message-content-on-hit feature, when
the message content was hidden due to this setting (eg due to 'never' or
'channel-only'), the warn message will not be sent as there is no need to
inform the user in such a case.

10 months agoGet rid of duplicate "spamfilter hit" code.
Bram Matthys [Tue, 11 Jul 2023 09:40:06 +0000 (11:40 +0200)] 
Get rid of duplicate "spamfilter hit" code.

10 months agoAdd set::central-spamfilter::limit-ban-action and ::limit-ban-time
Bram Matthys [Tue, 11 Jul 2023 08:16:49 +0000 (10:16 +0200)] 
Add set::central-spamfilter::limit-ban-action and ::limit-ban-time
to limit actions to limit-ban-action as the highest, and limit
ban times to limit-ban-time the highest, see
https://www.unrealircd.org/docs/Central_Spamfilter

This also changes highest_spamfilter_action() to highest_ban_action().

10 months agoCentral spamfilter: now every 1hr and a default set::central-spamfilter::except
Bram Matthys [Mon, 10 Jul 2023 18:16:59 +0000 (20:16 +0200)] 
Central spamfilter: now every 1hr and a default set::central-spamfilter::except
policy is added. This may be tweaked later.