1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-27 01:36:37 +02:00
Commit Graph

9036 Commits

Author SHA1 Message Date
Bram Matthys 9fef375d0a Make reading priority of config blocks a simple array. 2022-01-03 16:55:47 +01:00
Bram Matthys 92c81b194f Move "spkifp" to unrealircdctl, so it is available for Windows users.
For *NIX users no visible change.
2022-01-03 14:48:00 +01:00
Bram Matthys 3dd7c19c77 Move "gencloak" to unrealircdctl, so it is available for Windows users.
For *NIX users no visible change.
2022-01-03 14:28:10 +01:00
Bram Matthys e35c29f3d5 Move mkpasswd operation to unrealircdctl. For *NIX users no change as this
is done behind-the-scenes (the command is still ./unrealircd mkpasswd).
For Windows users it finally means they can generate passwords via the CLI
using: unrealircdctl mkpasswd pwdhere
2022-01-03 14:14:12 +01:00
Bram Matthys 243c6635da Update /STATS P output a little (since it shows the control channel). 2022-01-03 13:51:46 +01:00
Bram Matthys df0a9e4f37 BuildBot: build unrealircdctl.exe 2022-01-03 13:51:32 +01:00
Bram Matthys 5425c8fbb6 Don't fail on versions older than Windows 10 version 1803.
And be a bit more informative on why unrealircdctl fails on those.
2022-01-03 13:31:24 +01:00
Bram Matthys c02eb3f16c Windows code cleanup: WSAStartup() -> init_winsock() 2022-01-03 13:19:22 +01: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 c0c265baee Fix some (totally unimportant) resource leaks and fix a case where,
if UnrealIRCd hung up on client communication without saying goodbye,
we would return a 0 exit code (success).
2022-01-03 09:03:23 +01:00
Bram Matthys a4af100ca8 Memory isn't initialized to zero by dbuf_queue_init(), causing
dbuf->length to be unitialized.
This wasn't an actual problem until yesterday in UnrealIRCd code,
since the whole client struct was initialized to zero, including
client->local->sendQ(->length) etc.
However, now we use the dbuf code elsewhere too (on the stack) and
3rd party modules can use it too, so fix this bug.
2022-01-03 09:02:54 +01:00
Bram Matthys 75a2fde672 Merge branch 'unreal60_dev' of github.com:unrealircd/unrealircd into unreal60_dev 2022-01-02 20:19:21 +01:00
Bram Matthys 39688517b0 Make "./unrealircd rehash" show output on the terminal, same for
"./unrealircd reloadtls" and there is now also a "./unrealircd status"

The output is colorized if the terminal supports it (just like on the
boot screen) and also the exit status is 0 for success and non-0 for
failure. The purpose of all this is that you can easily detect rehash
errors on the command line.

These three commands communicate to UnrealIRCd via the new control
UNIX socket, which is in ~/data/unrealircd.ctl.
This also does a lot of other stuff because we now have an internal
tool called bin/unrealircdctl which is called by ./unrealircd for
some of the commands to communicate to the unrealircd.ctl socket.
Later on more of the existing functionality may be moved to that
tool and we may also provide it on Windows in CLI mode so people
have more of the same functionality as on *NIX.
2022-01-02 20:17:36 +01:00
k4be d8bb78677f Add TS to s2s MODE messages generated by SVS(2)MODE
(if the source is a server).
2022-01-02 20:09:57 +01:00
Bram Matthys 834736070e Make "SVS(2)MODE -b user" work properly for extended bans.
It was missing for a lot of extbans (removing too little) and
for ~t it was removing too much (eg quiet bans).
Bug reported and changes suggested by k4be.

Coders:
Setting extban.options to EXTBOPT_CHSVSMODE has no effect anymore,
just didn't want to remove it so modules would still compile.
We now purely match based on .is_banned_events including BANCHK_JOIN.
2022-01-02 13:12:33 +01:00
Bram Matthys 46bdc1c5e1 Print message about outdated release if automatically rejected by crash handler. 2022-01-02 09:32:33 +01:00
Bram Matthys dbef19cd7a Add initial implementation of UNIX domain sockets (listen::file).
Various things still need to be done: a lot more testing, ability to
set permissions on the file, #ifdef's because of lack of support
on Windows (currently won't compile), etc.

One thing that I don't intend to change is that I chose not to display
the socket in the host but have clients show up as 'localhost' (and
ip '127.0.0.1'). Doing it this way keeps things easy, otherwise we risk
a lot of breakage for nearly nothing gained, really.

Things can be tested via:
listen {
        file "/tmp/listen";
}

and then with netcat:
nc -U /tmp/listen
USER x x x x
NICK hai
etc...
2022-01-01 18:48:17 +01:00
Bram Matthys 40c528acde Add missing space in spamfilter log message.
This is a fix-for-fix b98d02817a.

Reported by armyn in https://bugs.unrealircd.org/view.php?id=6049
2021-12-30 16:42:29 +01:00
Bram Matthys 4e209968fe Fix hang on "Loading IRCd configuration" if DNS is not working correctly.
For example if the 1st DNS resolver is refusing or ignoring requests.
We forgot to call unrealdns_timeout() in the waiting loop, so DNS requests
never timed out and c-ares didn't try the 2nd/3rd server either.

Issue reported by Elodie.
2021-12-30 14:49:29 +01:00
Bram Matthys c5c17f2ccf Include "client_port" (eg 6697) and "server_port" (eg 55123) in JSON
output for local clients.
2021-12-30 13:20:37 +01:00
Bram Matthys 4ca9e9b3c2 Also support show-event in log::destination::channel. 2021-12-30 11:39:51 +01:00
Bram Matthys d677ce04de New option set::server-notice-show-event which, if set to 'no', can be used
to hide the event information (eg. connect.LOCAL_CLIENT_CONNECT) in
server notices. This can be overriden in oper::server-notice-show-event.

See https://www.unrealircd.org/docs/Set_block#set::server-notice-show-event
2021-12-30 11:29:30 +01:00
Bram Matthys 0f52ff76e8 Add link to https://www.unrealircd.org/docs/Log_block#Logging_to_a_channel
in the release notes.
Also add the sub-options: color, json-message-tag and oper-only.
2021-12-30 10:40:01 +01:00
Bram Matthys eaded2d12f Use spamfilter::match with single quotes in example spamfilter.conf
and give a hint to do that so they are not misinterpreted by an URL
since that may happen for other spamfilters (not the one included
in this file though). Suggested by Lord255.
2021-12-30 09:57:57 +01:00
Bram Matthys 4cb708117a Initial version of snomask logging to channels (more to follow) 2021-12-30 08:59:00 +01:00
Bram Matthys a35e9f7af9 Bump version to 6.0.2-git (start of dev for next version) 2021-12-30 08:58:08 +01:00
Bram Matthys 34c7727eb1 Error on unknown items in log block, eg a leftover log::flags or log::maxsize
from UnrealIRCd 5, or just some incorrect item that does not exist.
2021-12-30 08:16:01 +01:00
Bram Matthys cdc433f8c0 ** UnrealIRCd 6.0.1.1 ** 2021-12-29 19:30:49 +01:00
Bram Matthys 0242b509b8 Fix compatibility between U5 and U6 for named extended bans in SJOIN
when SJSBY is enabled. This caused named bans not to show up properly
(or not at all) on the U5 side when syncing servers.
2021-12-29 19:21:02 +01:00
Bram Matthys 73dc1a08db ** UnrealIRCd 6.0.1 ** 2021-12-29 15:27:31 +01:00
Bram Matthys faab128472 Bump version to 6.0.1 and create draft release notes (unreleased yet!) 2021-12-29 12:02:57 +01:00
Bram Matthys c5cb19dc5d Fix "./unrealircd upgrade" (and ./Config -quick) problem with local-curl.
First, what we call local-curl is a situation where the system does not have
the cURL library installed and UnrealIRCd offers to compile and use it.

The problem is that CURLDIR in config.settings may refer to an old directory
such as /home/xyz/unrealircd-5.2.1/extras/curl and UnrealIRCd 6 would try to
use it. That would be problematic as it would result in: 1) no cURL updates
anymore since it is only half-detected as local-curl, and 2) once you remove
the unrealircd-5.2.1 directory (since you are on U6) it breaks as well.

So, we now check for this situation and in case of something that looks like
a local-curl situation, change the path to <currentunreal>/extras/curl and
download and compile cURL fresh, as expected.

All this is only for the like 1% users that uses local-curl, which then
used ./unrealircd upgrade or ./Config -quick.

Reported by CrazyCat on the forums.
2021-12-29 10:59:58 +01:00
Bram Matthys 73be662db2 Make "./unrealircd upgrade" return exit codes from stage 2 as well.
Exit status is now documented at https://www.unrealircd.org/docs/Upgrading
and can be used to see the difference between:
* upgrade+configtest OK,
* upgrade OK but configtest failed
* some other failure
* no newer version available
Handy for scripting...
2021-12-29 10:04:00 +01:00
Bram Matthys 607d2bcd62 Make "./unrealircd upgrade" work on FreeBSD.
Suggested by and patches from rafaelgrether in
https://bugs.unrealircd.org/view.php?id=6016

This also cleans up a tiny bit, part of it suggested by Lord255 in
https://bugs.unrealircd.org/view.php?id=5963
2021-12-29 09:31:03 +01:00
Bram Matthys 58551c2d43 When unloading any of the vhoaq channel modes it would cause a crash
later on, because unload_extcmode_commit() would call extcmode_para_delslot()
even though member modes don't use a parameter slot, and hence it
would NULLify a wrong slot, usually for the +H parameter mode. Fun.

We now no longer crash and mass-unset the modes on everyone in the
channel when such a mode is unloaded, just like we do when unloading
any of the other channel modes. It is not done in an efficient way
(one mode per line) but this should be an extremely rare event anyway.

Crash reported by CrazyCat.
2021-12-29 08:41:37 +01:00
Bram Matthys fa5526a44b Add a warning to ./unrealircd spkifp about it using the default certificate
locations, and inform the user that they can specify a file.

This doesn't solve https://bugs.unrealircd.org/view.php?id=6021 completely
but at least makes the user aware of this.

Reported by arcanefeenix and crazycat.
2021-12-28 18:31:38 +01:00
Valerie Pond f4bf9986af Fix some typos in CHGIDENT and CHGNAME log messages (#189) 2021-12-28 18:09:08 +01:00
Bram Matthys 3859c2f477 Error when an invalid (unknown) snomask is encountered in the config file.
This should help users who are upgrading to UnrealIRCd 6 spot silly mistakes
which would cause them to miss server notices.

It now errors and refers to
https://www.unrealircd.org/docs/Upgrading_from_5.x#Update_your_snomasks
2021-12-28 18:04:23 +01:00
Bram Matthys f7719d2de2 Make TKL add/remove/expire oper messages show a [duration: 60m] instead of
the [expires: ZZZZZZZZZZZZZZZZZZZZ GMT] string.

This because most people are interested in the length of the ban (so
relative time) and the exact time a TKL expires is less interesting
(the absolute time) and due to GMT/UTC requires calculating to the
local timezone too.

This also makes the tkl expiry messages be more like the add message,
with []'s, while previous it used more free text at the end of the line.
2021-12-26 09:00:39 +01:00
Bram Matthys d687e310bd Add function pretty_time_val_r(), for which you can specify a buf. 2021-12-26 08:59:44 +01:00
Bram Matthys 7f9c7a0eb4 Remove high cpu load warning, since it is confusing and may very well
not be caused by UnrealIRCd.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=6029
2021-12-25 08:58:46 +01:00
Bram Matthys b98d02817a In SPAMFILTER_MATCH log message, remove leading space in 'destination' JSON.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=6027
2021-12-22 17:11:44 +01:00
Bram Matthys c586c14b9f Fix ~T / ~text ban not working (was not censoring or blocking) 2021-12-22 09:25:59 +01:00
Bram Matthys 8dd1864cee Channel mode +f (flood) could place a timed extban with ~t instead of ~time.
This was only a visual issue, and coincidently these bans were still being
removed after the appropriate time, even without the fix for
0b6a70368c.
2021-12-22 09:10:51 +01:00
Bram Matthys 0b6a70368c Fix timed bans (~t/~time) not expiring if all servers on the net are U6.
Reported by armyn in https://bugs.unrealircd.org/view.php?id=6032
2021-12-22 09:10:05 +01:00
kpcyrd c1732581f8 Add SOURCE_DATE_EPOCH support for build date (#188)
For reproducible builds.
2021-12-19 18:56:37 +01:00
Bram Matthys 3059f3289a Channel is not +H? Send empty response/batch (as per IRCv3 discussion)
Backport of https://github.com/unrealircd/unrealircd/pull/156
(simplified)
2021-12-19 10:45:52 +01:00
alicetries b3c191fc23 Update short_date function to avoid crash if year > 9999 (#174) 2021-12-19 10:29:20 +01:00
crazycatdevs 9e7d4b0122 Small simplification (#185) 2021-12-19 10:24:36 +01:00
Bram Matthys d77f42e4be This one should be the other way around...
Not that anything is this particular code path should trigger it (OK,
maybe if some 3rd party module kills the user from HOOKTYPE_SECURE_CONNECT)
better safe than sorry.
2021-12-17 14:20:39 +01:00