1
0
Fork 0
mirror of https://github.com/pissnet/pissircd.git synced 2024-06-05 07:48:44 +01:00
Commit graph

2430 commits

Author SHA1 Message Date
angryce
94c04fda0e
Merge branch 'piss60' into unreal60 2021-11-14 16:06:52 +01:00
Bram Matthys
f9c46f9f10
Add escaping option for URLs.
In the config file if you have a value that is 100% an URL (eg no
spaces and all that) then it is seen as a remote include and will
be fetched. Eg: file "https://something/"
We already had that.

Now we add a new option to make it NOT interpret this as an URL.
Probably only used in rare cases, but, it is needed for modules
like extjwt where you configure an URL.
The solution is simple: use single quotes instead of double:
Eg: url 'https://something/'

Note that single quotes are only supported in this version onwards,
they were not supported in earlier UnrealIRCd versions.

It is also only supported in values at the moment (not names),
since that is the only place where URLs are actually fetched for.
2021-11-10 18:41:22 +01:00
Bram Matthys
6b87bd1b34
Only allow setting of snomasks that actually exist in the log { } blocks.
Otherwise probably too confusing. Suggested by westor in
https://bugs.unrealircd.org/view.php?id=5995
2021-11-10 15:59:10 +01:00
Bram Matthys
d74ab4cfb1
Add set::server-notice-colors and oper::server-notice-colors so one
can turn colors in snomask server notices on or off.
2021-11-10 08:22:00 +01:00
angryce
f4cc36ebb1
Merge pull request from pissnet/unreal60
Unreal60
2021-11-08 01:16:40 +01:00
angryce
a2a322afff
Merge pull request from unrealircd/unreal60_dev
Couple of small updates (mostly just notes it seems this time)
2021-11-07 23:27:37 +01:00
Bram Matthys
4c9a83365c
Fix read-after-free due to commit from a few minutes ago.
An URL that did not need to be fetched (due to url-refresh time) could
cause a download complete message ending up in a call to rehash_internal().
This was too soon, as we were still adding and processing other config
files.
2021-11-07 14:23:00 +01:00
Raphael Bertoche
337ae83379 Merge branch 'unreal60' into piss60 2021-11-06 17:37:34 -03:00
Raphael Bertoche
5ee60e1366 Merge branch 'unreal60_dev' of https://github.com/unrealircd/unrealircd into unreal60 2021-11-06 17:35:27 -03:00
Bram Matthys
c4a64f4aab
** UnrealIRCd 6.0.0-beta2 ** 2021-11-06 19:05:14 +01:00
Bram Matthys
d18f8115f1
Let's bump UnrealProtocol from 5002 to 6000 2021-11-06 18:57:35 +01:00
Bram Matthys
edb33baa22
Make it so set::level-on-join can also specify a mode letter such
as 'v' instead of like 'voice'. This is needed because third party
modules can now add access levels as well (eg: X).
2021-11-03 08:44:39 +01:00
Raphael Bertoche
1f6777ce0e Merge branch 'unreal60_dev' of https://github.com/unrealircd/unrealircd into unreal60 2021-11-02 03:00:14 -03:00
Raphael Bertoche
0e6b4958e8 Merge branch 'piss60' of https://github.com/pissnet/pissircd into piss60 2021-10-31 09:26:47 -03:00
Raphael Bertoche
5e6613958f removes ipv4 fallback constant 2021-10-31 09:00:43 -03:00
Bram Matthys
b29a9be288
** UnrealIRCd 6.0.0-beta1 ** 2021-10-31 08:40:09 +01:00
Bram Matthys
ca36a5256c
Some text updates UnrealIRCd 5 -> UnrealIRCd 6 2021-10-31 07:20:57 +01:00
Raphael Bertoche
1318ecbc63 removes ac products from repository 2021-10-31 03:02:55 -03:00
Raphael Bertoche
58c549ee8f Merge branch 'piss52' into piss60 - First attempt, didn't even try it 2021-10-30 22:10:30 -03:00
Raphael Bertoche
c0135c1300 Merge https://github.com/pissnet/pissircd into piss52 2021-10-25 23:51:21 -03:00
Ramiro Bou
ae7517f6a4 Rebranding! 2021-10-25 16:25:25 -03:00
Ramiro Bou
c82db5c429 Implementing IPv6 -> IPv4 fallback 2021-10-25 16:25:25 -03:00
Raphael Bertoche
dae083f269 removes ac products from repository 2021-10-21 02:26:29 -03:00
Bram Matthys
32aa4dc625
Metadata can stay a 3rd party module for now. 2021-10-10 09:39:55 +02:00
Bram Matthys
dbdac4e304
** UnrealIRCd 5.2.2 ** 2021-10-03 15:59:13 +02:00
Bram Matthys
520804edc2
Add set::whois-detail which allows you to configure which items
to expose to which users and in what detail.

The default configuration is as follows:

set {
	whois-details {
		basic		{ everyone full; }
		modes		{ everyone none;	self full;	oper full; }
		realhost	{ everyone none;	self full;	oper full; }
		registered-nick	{ everyone full; }
		channels	{ everyone limited;	self full;	oper full; }
		server		{ everyone full; }
		away		{ everyone full; }
		oper		{ everyone limited;	self full;	oper full; }
		secure		{ everyone limited;	self full;	oper full; }
		bot		{ everyone full; }
		services	{ everyone full; }
		reputation	{ everyone none;	self none;	oper full; }
		geo		{ everyone none;	self none;	oper full; }
		certfp		{ everyone full; }
		shunned		{ everyone none;	self none;	oper full; }
		account		{ everyone full; }
		swhois		{ everyone full; }
		idle		{ everyone limited;	self full;	oper full; }
	}
}

Oh, yeah, and for "secure" this also adds displaying of the TLS cipher
in /WHOIS for ircops and self by default. For all others it is limited
to just "is using a Secure Connection".

This also removes the newly added set::geoip::whois-for-anyone since
it is now configured via set::whois-details::geo.

Module coders: HOOKTYPE_WHOIS changed and you may no longer send
directly to the client from this hook. Instead, you should use
add to the NameValuePrioList, usually via the functions
add_nvplist_numeric() and add_nvplist_numeric_fmt().
For inspiration see bot_whois in src/modules/usermodes/bot.c
and reputation_whois in src/modules/reputation.c
2021-09-27 17:27:26 +02:00
Bram Matthys
c06f423643
Get rid of ExtBan_Table[] and use a linked list called extbans.
Just like already done for Usermode_Table[] and Channelmode_Table[].

This also adds support for ->unloading=1 and re-use etc etc,
something that seemed to be missing before (but also wasn't
an issue apparently...).
2021-09-26 13:11:21 +02:00
Bram Matthys
ee8cc0e8e2
Get rid of Usermode_Table[] and use a linked list called usermodes.
Just like already done for Channelmode_Table[] -> channelmodes.
2021-09-26 12:46:34 +02:00
Bram Matthys
e4b449adf8
Add set_channel_mode() which can be used to issue a server mode.
It's usage would be rare, but this is f.e. used from channeldb.
Other uses may be in some 3rd party module.
Example: set_channel_mode(channel, "+k", "key")
2021-09-25 17:42:21 +02:00
Bram Matthys
0e9d7a669f
Update HOOKTYPE_LOG to work with new logging system (lots of different args) 2021-09-25 17:33:02 +02:00
Bram Matthys
35ae1bcc42
Update a comment about a hook
[skip ci]
2021-09-25 17:23:52 +02:00
Bram Matthys
c6ef13b258
Remove HOOKTYPE_REQUIRE_SASL which was never called.
Apparently the other hooks were sufficient after all for authprompt ;D
2021-09-25 17:15:49 +02:00
Bram Matthys
834d38e904
Update HOOKTYPE_PRE_KNOCK to include reason (not used, though) 2021-09-25 17:08:53 +02:00
Bram Matthys
38e47b9b62
Rename find_person() to find_user() to be consistent in the naming that
we use since UnrealIRCd 5: we have users (IsUser) and servers (IsServer).
2021-09-25 16:44:11 +02:00
Bram Matthys
3033fd9b6d
Fix some todo items such as validating extban letter and names in ExtbanAdd() 2021-09-25 16:38:15 +02:00
Bram Matthys
73b908e413
Changes to BanContext struct (extended ban API):
* Now ban_check_types (previously checktype):
  this is one or more of BANCHK_* OR'd together, eg BANCHK_JOIN, BANCHK_MSG..
* Now ban_type (previously what2):
  this is the type of the ban, eg EXBTYPE_BAN, EXBTYPE_EXCEPT, etc.
* Now is_ok_check (previously is_ok_checktype)
  this is one of EXBCHK_* for is_ok, eg EXBCHK_PARAM to check parameter.
2021-09-25 16:28:10 +02:00
Bram Matthys
b37b190fdd
Add enums ExtbanCheck and ExtbanType for use in BanContext. 2021-09-25 16:16:42 +02:00
Bram Matthys
4a4d069f11
Get rid of ignore for -Wformat-nonliteral in two entire files,
now it is only in 5 functions in entire UnrealIRCd. Acceptable.
2021-09-25 15:16:45 +02:00
Bram Matthys
8603c2eb71
Update hunt_server() so command is really the command (eg "LUSERS") and
not a format string (eg ":%s LUSERS %s"). It now simply concats all parv[]'s.
That is, up to parc count. And it automatically does the :stuff for the
last parameter if it contains spaces or starts with a : etc.

This gets rid of a bit sketchy code with an arbitrary maximum etc.

Now it's just:
if (hunt_server(client, NULL, "REHASH", 1, parc, parv) != HUNTED_ISME)
	return;

This has one side effect, though:
Previously we used the format string, so it may be possible for S2S
traffic to now have more arguments then before here and there.
Eg:
* It could be that the caller was using a format string to
  intentionally cut off an extra parameter at the end.
  You can still do that if you call with eg parc-1 instead of parc.
  I don't think there were any such cases though, but hard to rule out.
* Extranous parameters may show up in S2S traffic where it was
  previously unexpected.
2021-09-25 14:49:19 +02:00
Bram Matthys
ec8f54ec26
Update cloaking key mismatch error and rename some stuff. 2021-09-25 11:19:15 +02:00
Bram Matthys
cac8c34bcc
JSON logging: expand operlogin and operclass for users who are ircop.
This uses the new get_operlogin() / get_operclass() functions.
Also updated whois code to use them too.
2021-09-25 10:58:39 +02:00
Bram Matthys
b95eb0b3b7
Add get_operlogin() and get_operclass() functions to make things easy.
This retrieves the oper login (/OPER thislogin ...) and operclass of
local and remote users.
2021-09-25 10:57:00 +02:00
Bram Matthys
ce5917e0d9
Expose operlogin and operclass via moddata so they can be seen in WHOIS
and used for auditting purposes across servers (assuming the servers
itself can be trusted).
This is done via the 'operlogin' module which is loaded by default.
Obviously for opers of U5 and below this information is not available.

This also changes the HOOKTYPE_LOCAL_OPER hook to include oper block info:
-int hooktype_local_oper(Client *client, int add);
+int hooktype_local_oper(Client *client, int add, ConfigItem_oper *oper_block);
2021-09-25 10:28:36 +02:00
Bram Matthys
b00743fa79
Bump moddata slots
[skip ci]
2021-09-25 10:24:32 +02:00
Bram Matthys
edbfaaf95d
JSON logging: expand user modes, snomasks, and oper login (if available)
This also adds a function get_usermode_string_r(), which requires
you to specify the buffer (and buffer length) for building the
umode string.
2021-09-25 09:45:30 +02:00
Bram Matthys
bf7a72a850
Usermode_Table[].flag -> Usermode_Table[].letter
just like how it is now in U6 in channel modes and extended bans
2021-09-25 09:13:34 +02:00
Bram Matthys
fbf3a51517
Add HOOKTYPE_CAN_SET_TOPIC, which works similar to HOOKTYPE_CAN_KICK.
Move checking of +t restrictions to chanmodes/topiclimit.
Move checking for +m restrictions to chanmodes/moderated.
Now the only check remaining in topic is for +b (banned users)
which is fine I think.
2021-09-25 09:04:19 +02:00
Bram Matthys
618049fca1
Add buildnumeric() function, which will only be used sporadically as you
would normally use sendnumeric() instead.

The buildnumeric() function prepares a buffer but does not send it.
It is used in eg CAN_KICK / CAN_SET_TOPIC, where you need to set an
'errbuf' with a full IRC protocol line to reject the request (which
then may or may not be sent depending on operoverride privileges).
2021-09-25 09:03:48 +02:00
Bram Matthys
c582a29f09
Update doxygen docs a bit (minimal) for channel access functions. 2021-09-25 08:13:18 +02:00
Bram Matthys
fabe16a95c
Get rid of has_voice(), is_half_op(), is_skochanop(), is_chan_op(), is_chanadmin(),
is_chanowner(). Using check_channel_access() instead now.
2021-09-25 08:00:57 +02:00