1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 15:34:47 +02:00
Commit Graph

113 Commits

Author SHA1 Message Date
Bram Matthys a89f098a22 Fix mmdb library on Windows and use it by default 2026-04-10 18:44:39 +02:00
Bram Matthys f47396a7db Keep using geoip_classic on Windows for this rc1.
geoip_mmdb doesn't compile on Windows, will look at it after rc1.
Also almost forgot to set this GEOIP_ENGINE ;)
2026-04-04 07:56:05 +02:00
Bram Matthys 0931008874 Fix Windows compile 2026-04-04 07:37:44 +02:00
Bram Matthys 806c883a7f Rename geoip_maxmind to geoip_mmdb with a backwards-compatible warn.
This is a mmdb backend which supports various GeoIP providers,
and we no longer use the maxmind library, so this makes sense.
2026-03-22 12:29:00 +01:00
Bram Matthys 172ace9750 geoip_maxmind: use our own mmdb implementation
This is mainly due to licensing. The libmaxminddb library uses the
Apache license, which meant if we would compile it in by default it
would effectively transform our "GPLv2 or later" to "GPLv3 or later".
Our implementation is ISC licensed, so we can include and enable it
by default and keep things at "GPLv2 or later". This is also why we
used geoip_classic in the first place as default and compiled in,
and not the mmdb variant.

The mmdb.c is based on the specification, using the Go implementation
as a reference during development (ISC licensed), initially implemented
with the help of Claude Opus 4.6. After that substantial changes were
made to make it match UnrealIRCd's style and to make things less error
prone: C style changes, allocation and zero termination of strings in
the library, auto-NULL in variadic functions so the caller cannot
forget NULL there (similar to our unreal_log/do_unreal_log), using
enums as the return type instead of int (similar to curl), adding
doxygen docs, etc.

This also means the old mmdb library dependency has been dropped,
including from configure/autoconf.

At the moment we still use the geoip classic library by default,
including those DB files. The idea is we will switch over sometime
later after this current new MMDB stuff has received more testing.

This also makes us more flexible, since .mmdb files have become the
de-facto standard for pretty much all geoip vendors.
2026-03-22 12:10:18 +01:00
Bram Matthys 6130c1b5ae Update Windows build because library package with cURL changed
due to switch to 'cmake'. This is for unrealircd-libraries-6.2.3.zip from
https://www.unrealircd.org/docs/Windows_external_libraries_for_UnrealIRCd
2026-01-31 14:35:55 +01:00
Bram Matthys a93ab146b6 Add rpc/message and rpc/security_group modules for Windows build 2026-01-31 07:54:14 +01:00
Bram Matthys 5b6037698a Forgot to add 3 modules in Windows makefile.
[skip ci]
2025-10-23 19:05:09 +02:00
Bram Matthys b2d0ec1af3 Move/add local_port & server_port to ModData, so remote clients can be tracked.
This is sent over the wire as early moddata, just like "operlogin" and "operclass"
2025-09-14 17:03:34 +02:00
Bram Matthys 256308a707 Switch back to OpenSSL for the Windows build:
* In 2016 we switched from OpenSSL to LibreSSL because the OpenSSL
  codebase was in a bit of bad shape and LibreSSL promised to be a
  more modern codebase. Now, almost a decade later, OpenSSL has had
  many code cleanups and is more security aware (code audits etc),
  especially since OpenSSL v3 things are looking OK and it seems
  LibreSSL doesn't have much progress nowadays. Which is understandable
  as they have a lot fewer coders available but has an effect on things
  like how long it took for TLSv1.3 to appear and for other new things
  like PQC. It also seems like security fixes are now slower than
  OpenSSL instead of the other way around. Anyway, I think they did their
  job well (together with other people) in "triggering" the OpenSSL
  project to get things back on track. Let's switch back now.
* For context: it seems several Linux distro's that used to do go for
  LibreSSL have also switched back to OpenSSL.
* LibreSSL is still and will continue to be a supported library to
  use with UnrealIRCd (especially with OpenBSD and FreeBSD in mind).
  So, if there are any issues (compile problems, configuration problems,
  some feature not detected), then please report it on our bug tracker
  at https://bugs.unrealircd.org/ ! We will have to rely more on such
  user-reports now that the main devs will likely only work with OpenSSL.

Also... i have cleaned up the Makefile.windows a bit to be more consistent
Hopefully i didn't make a mistake there...

[skip ci]
2025-09-08 17:02:56 +02:00
Bram Matthys 9b3d219743 Add utf8functions with utf8_convert_confusables() from July 16 2023.
I started work on this back then but didn't finalize it. Now I
have to figure out what was left to be done :D. Other than the
obvious case of seeing some debugging code that prints out for
every converted character. Not yet visible / usable by end-users!
2025-03-22 07:56:11 +01:00
Bram Matthys 8c21472d03 Move allow::maxperip to its own module (maxperip), add HOOKTYPE_ALLOW_CLIENT.
Also fix documentation for ~10 hooks to mention the hook name.

Obviously, the maxperip module is loaded by default (in modules.default.conf)
but it is nice to have the 400+ lines contained in a separate module
rather than being in the nick module that does NICK/UID handling.
Will look at moving more later..
2025-03-22 07:42:00 +01:00
Bram Matthys ee1d6818b4 Add +b/+e/+I ~inherit:#channel to inherit channel bans from another channel
Several notes:
* This only checks on-JOIN (not on nick change, message, etc)
  for performance reasons
* If the #channel in ~inherit:#channel also contains ~inherit
  entries then those are not processed (no recursion and no looping)
* Only a limited number of ~inherit entries is permitted.
  This will be moved to set:: items in a future commit so you
  can set different amounts for +b/+e/+I ~inherit.
* This is work in progress, UnrealIRCd or the entire world could explode
* Documentation will follow later

Developers:
* Sadly, clean_ban_mask() needed to be changed to have two more
  parameters, 'ban_type' and 'channel' were added at different positions.
  This because the module needs the ban type (EXBTYPE_BAN, EXBTYPE_EXCEPT,
  EXBTYPE_INVEX) and channel because it rejects based on number of
  existing ~inherit entries in the channel... and while is_ok() is called
  for local clients and has all this information, for services clients
  is_ok() is not called so the only way to reject the +beI is through
  xxx_conv_param() which comes from clean_ban_mask().
2024-09-07 21:02:15 +02:00
Bram Matthys 0b253306b3 Add extbans/asn to Windows makefile. (And rebuild 6.1.7-rc1 on Win)
[skip ci]
2024-07-13 10:30:47 +02:00
Bram Matthys 600185deba Add support for CAP draft/no-implicit-names
https://github.com/unrealircd/unrealircd/pull/265 by Valware
"This is an IRCv3 extension which lets clients opt-out of receiving /names on join.
 This is useful for bots on large channels who do not need to know who is in the channel.
 Specification: https://ircv3.net/specs/extensions/no-implicit-names"

+ module rename from 'no-implicit-names-cap' to 'no-implicit-names'
  (simply because no other modules has that -cap suffix)
+ update to Makefile.windows
2023-12-26 14:46:54 +01:00
Bram Matthys 0cbe6ad090 Makefile.windows: add src/api-apicallback.c to fix build
[skip ci]
2023-12-01 08:02:31 +01:00
Bram Matthys 6aae3e7a5d Update modules and Makefiles so central-api & central-blocklist compile. 2023-11-24 07:31:22 +01:00
Bram Matthys 08cb0fc05d 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.
2023-07-16 10:33:25 +02:00
Bram Matthys def77c4d52 Initial work on spamreport { } block. Not really useful yet.
Early commit before i make it actually work and implement the rest
and hunting for memory leaks etc...
2023-07-08 15:35:08 +02:00
Bram Matthys c352cc2d5f Fix missing 'issued-by-tag' module in windows build. Oops...
[skip ci]
2023-05-06 11:27:49 +02:00
Bram Matthys 7ad160f57a JSON-RPC: WHOWAS fetching is now whowas.get, also expose not only
logon_time/logoff_time but also connected_since.

This also fixes the Makefile for the Windows build (i hope)
2023-04-15 09:24:57 +02:00
Bram Matthys 45201fffe7 New module 'whowasdb': persistent WHOWAS history (preserved between reboots) 2023-04-14 19:29:45 +02:00
Bram Matthys a3efb70d31 Fixes for Windows build: add extbans/flood and all the RPC modules.
[skip ci]
2023-04-07 14:41:03 +02:00
Bram Matthys 290c5d4b72 Fix Windows makefile.
[skip ci]
2023-04-07 14:27:14 +02:00
Bram Matthys 2d4c064c59 Makefile.windows: add missing standard-replies.dll
[skip ci]
2023-03-22 15:11:11 +01:00
Bram Matthys 96fe6d0fda Fix Windows compile problem with current git 2023-03-14 18:33:00 +01:00
Valerie Pond 2cf6e9ef19 Add S2S command SREPLY for handling IRCv3 standard replies (#236)
This command allows servers to send Standard Replies (https://ircv3.net/specs/extensions/standard-replies) to clients.
2023-02-08 08:43:41 +00:00
Ron Nazarov 4999ae408c Add TLINE command
Suggested by PeGaSuS in https://bugs.unrealircd.org/view.php?id=6174
2022-11-18 08:53:36 +00:00
Bram Matthys ea5c3922ad Update Makefile.windows for src/modules/svslogin.c
Related to previous commit 1a4b701776
2022-11-14 08:45:33 +01:00
Bram Matthys 36946c6c51 Move JSON stuff from log.c to json.c now that it is more universal. 2022-06-24 13:21:27 +02:00
Bram Matthys 853f0685ed Split off big chunk of websocket module into websocket_common module.
And load the websocket_common module by default (which is just an API).
2022-06-19 13:13:33 +00:00
Bram Matthys 60c83b4ba1 Move connect-flood and max-unknown-connections-per-ip into their own module.
These deal with set::anti-flood::everyone::connect-flood and
set::max-unknown-connections-per-ip respectively.

This adds a new hook HOOKTYPE_ACCEPT, that is mostly meant for internal
usage by UnrealIRCd. Most module coders will want to use the existing
hook HOOKTYPE_HANDSHAKE instead.

This also gets of check_banned() which is now spread over the individual
modules (eg: checking banned is done in tkl on HOOKTYPE_ACCEPT and
HOOKTYPE_IP_CHANGE).
2022-06-19 13:13:33 +00:00
Bram Matthys 97c8274695 Add RPC API (the beginning..) 2022-06-19 13:13:33 +00:00
Bram Matthys 2397fb8a49 Split 'websocket' module up in 'webserver' and 'websocket' 2022-06-19 13:13:33 +00:00
Bram Matthys d8ff86e739 Fix for compiling on Windows
[skip ci]
2022-05-23 18:48:10 +02:00
Bram Matthys 3ee199fb6f Makefile.windows: add securitygroup.obj
[skip ci]
2022-05-23 17:42:43 +02:00
Bram Matthys 9075e2fa70 Move all the security group and mask code to src/securitygroup.c 2022-05-16 13:54:52 +02:00
Bram Matthys f1a18ce37e Communicate "creationtime" of users. Right now this info is only known
locally, as the only timestamp regarding users that is communicated across
the network is about the "last nick change" ("has this nick since...").
2022-05-13 12:27:21 +02:00
Valerie Pond 61f7dd746e Add IRCv3 +draft/channel-context (#205)
https://github.com/delthas/ircv3-specifications/blob/feature-channel/client-tags/channel-context.md
2022-05-13 07:39:41 +02:00
Bram Matthys 50e5d91c79 Add SVSO command which services can use to make someone IRCOp.
This existed in UnrealIRCd 3.2.x but was later removed when
switching to the new operclass system.
Requested by Valware in https://bugs.unrealircd.org/view.php?id=6041

Syntax: SVSO <uid|nick> <oper account> <operclass> <class> <modes> <snomask> <vhost>
All these parameters need to be set, you cannot leave any of them out,
HOWEVER some can be set to "-" to skip setting them, this is true for:
<class>, <modes>, <snomask>, <vhost>

In UnrealIRCd the <operclass> will be prefixed by "services:" if not already
present. It is up to you to include or omit it.

If you want to set any swhoises you need to use the SWHOIS s2s command,
other than that this command basically does everything for you,
in fact it uses the same code as the OPER command does.
Most of the "user is now ircop" code has been moved out of cmd_oper() to
a new function make_oper() that is called by both cmd_oper() and cmd_svso().

This function also changes the hook HOOKTYPE_LOCAL_OPER:
It no longer passes a ConfigItem_oper struct, since we can't do that for
remote opers. Instead it passes oper name and oper class.
The complete definition is now:
int hooktype_local_oper(Client *client, int add, const char *oper_block, const char *operclass);
2022-05-07 18:53:59 +02:00
Bram Matthys 889bcd99dc Actually build and load module for unrealircd.org/geoip-tag by default. 2022-05-01 14:11:24 +02:00
Bram Matthys 98c0e786b5 Make UnrealIRCd compile on Windows again.
Updated the makefile to build unrealircdctl.exe etc.
2022-01-03 13:10:53 +01:00
Bram Matthys 44e420dc58 Add GeoIP / geoip_classic to Windows build.
Also fix an issue with convert_to_absolute_path() and remotely fetched files.
2021-10-31 14:16:39 +01:00
Bram Matthys 32aa4dc625 Metadata can stay a 3rd party module for now. 2021-10-10 09:39:55 +02:00
Bram Matthys 8057b5755f Add operinfo to Windows Makefile
[skip ci]
2021-09-29 14:55:02 +02:00
Bram Matthys 74a5dbebe2 Update Windows makefile with new cloaking modules and vhoaq chanmodes
[skip ci]
2021-09-29 09:55:54 +02:00
Bram Matthys 10ec3c164a Rename the old cloaking module to "cloak_md5" (UnrealIRCd 3.2.1 - 5.2.X)
It was used from July 2004 and served us well it seems.
2021-09-25 11:23:14 +02:00
Bram Matthys a2a9eebf98 Get rid of ./unrealircd upgrade-conf (was for 3.2.x to 4.x) 2021-09-24 16:40:42 +02:00
Bram Matthys 1d73db560c Get rid of modules/snomasks directory, since the snomask module API is gone.
(IRCOps can set any snomask dynamically now)
2021-09-24 10:10:27 +02:00
Bram Matthys 0439e4f89d Move wallops module from "wallops" to "usermodes/wallops"
(which includes the command)
2021-09-23 19:25:38 +02:00