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

2314 Commits

Author SHA1 Message Date
k4be ca3bbfeadf Improve handling of missing files 2021-08-27 12:20:36 +02:00
k4be f1bc9f37e1 Change watch notification hook to callback.
This fixes duplicate AWAY message with extended-monitor.
2021-08-25 09:02:24 +02:00
k4be e7e82ad493 Move host-change-related code to chghost.c 2021-08-24 20:37:02 +02:00
k4be f4a915bbb7 Update watch_notification argument name
Fix WATCH crash caused by that argument
2021-08-24 20:19:50 +02:00
k4be fe51aaf357 Add wATCH_EVENT defines 2021-08-24 19:58:05 +02:00
k4be 502def9401 Add extended-monitor (work in progress) 2021-08-24 19:42:38 +02:00
k4be d40853b71c Add basic metadata module (no moderation) 2021-08-22 21:17:19 +02:00
Bram Matthys 52b4a44e94 Massively rename Cmode.flag to Cmode.letter.
(similar to 5a387f9c0b)
2021-08-22 18:45:13 +02:00
Bram Matthys 9838378550 Massive rename of:
* channel->mode.extmode to channel->mode.mode
* channel->mode.extmodeparams to channel->mode.mode_params

This because all channel modes that are set there are extended channel
modes, only lists are still in core atm and they never get set here.
2021-08-22 18:36:00 +02:00
Bram Matthys e0504b2e52 Remove Mode.mode, it now only contains Mode.extmode and Mode.extmodeparams
Also make MODES_ON_JOIN point to iConf.modes_on_join.extmodes instead
of iConf.modes_on_join.mode

Actually in next commit I may reorder again...
2021-08-22 18:33:25 +02:00
Bram Matthys 783cc3ff5b Cmode API: change from Channelmode_Table[<num>] to channelmodes linked list.
And now we can easily sort the channel modes too, makes it easier for
our test cases.
2021-08-22 17:57:14 +02:00
k4be 50ae1ca2df Proxy validation by IP address.
TODO: add optional password too.
2021-08-22 16:46:52 +02:00
Bram Matthys 96b290536e Rename Channelmode_Table.slot to .param_slot since this is only
about parameter slot mapping.
2021-08-22 16:37:18 +02:00
Bram Matthys d35a90c80f Fix various channel modes showing up as duplicate in 004 and 005.
Yeah I forgot we hardcoded these somewhere, now they are gone.. poof!
2021-08-22 14:06:51 +02:00
k4be a2cdb8ff89 Merge branch 'unreal60_dev' of github.com:syzop/unrealircd-next into unreal60_dev 2021-08-22 13:36:06 +02:00
k4be be78ecebfc Parse "Forwarded:" header from proxy.
Not (yet) checking source address nor getting a hostname.
2021-08-22 13:34:54 +02:00
Bram Matthys 8a5a0723e9 Fix the default set::modes-on-join (+nt) not working anymore, since
at the time of setting the default settings the channel mode modules
are not fully initialized yet.
2021-08-22 13:12:55 +02:00
Bram Matthys 1a19de2de9 Move channel mode +r to module chanmodes/isregistered 2021-08-22 12:19:07 +02:00
Bram Matthys 57ec565051 Move channel mode +t to module chanmodes/topiclimit
TODO: move code from "topic" module to here, some hook call.
2021-08-22 12:09:53 +02:00
Bram Matthys 6dd539d760 Move channel mode +m to module chanmodes/moderated
(and nearly all the code related to it)
2021-08-22 12:01:54 +02:00
Bram Matthys 24f73c28e4 Move channel mode +l to module chanmodes/limit
(and all the code related to it)
2021-08-22 11:45:08 +02:00
Bram Matthys 1533c6431e Move channel mode +n to module chanmodes/noexternalmsgs
(and all the code related to it)
2021-08-22 11:22:33 +02:00
Bram Matthys 8066c13876 Move +s/+p to chanmodes/secret and chanmodes/private.
To be honest, the modules don't do much other than handling the
mode stuff, but.. we can look at that again later.
2021-08-22 11:11:26 +02:00
Bram Matthys 295b3505ef Move channel mode +i to module chanmodes/inviteonly 2021-08-22 10:37:37 +02:00
Bram Matthys c403a47daf Move channel mode +k to module chanmodes/key 2021-08-22 10:06:51 +02:00
Bram Matthys 1e8c5da6aa Add ERR_INVALIDMODEPARAM which is a bit more informative than
ERR_CANNOTCHANGECHANMODE since it makes clear the problem is the
parameter and not a permissions issue..
2021-08-22 10:05:49 +02:00
Bram Matthys 5b90fd0c0d Get rid of old MOTD downloading code and several USE_LIBCURL defines
that are no longer needed.
2021-08-21 14:13:24 +02:00
Bram Matthys 89b9c2ec32 Deal with HTTP redirects, and add DOWNLOAD_MAX_REDIRECTS to include/config.h
which defaults to 2. Make it use this value for both curl and non-curl.
Previously (with curl) it was set to 1, and nobody complained...
2021-08-21 14:05:43 +02:00
Bram Matthys 090fe76739 URL: Make the curl and non-curl implementation use the same timeouts.
These are set in include/config.h to what they already were before:
15 seconds for the connect timeout, 45 for the complete transfer.
2021-08-21 09:37:14 +02:00
Bram Matthys c9e98137a4 Get rid of url.h and stuff the 6 functions there (which were not even
declared as extern) in include/h.h like the rest.
2021-08-21 09:32:17 +02:00
Bram Matthys 182cc7eab4 HTTPS client: add support for timeouts 2021-08-21 09:19:29 +02:00
Bram Matthys 00f3f300f0 Put downloads in a list. 2021-08-21 08:31:30 +02:00
Bram Matthys dcfe0885a6 Add functions to conver to/from RFC2616 timestamps, as used in HTTP
in last modified headers.
2021-08-21 08:24:22 +02:00
Bram Matthys d6a074aa34 Support for remote includes without cURL (https only).
This is work in progress. It current lacks a number of features
that we would like to have, but most of them are relatively easy
now that most of the work has been done:
1) Support for caching based on timestamps, like curl ("not modified")
2) IPv6 support
3) HTTP redirects (with limit)
4) Timeouts for connect and reads (15 / 45 for curl atm)
5) HTTP downgrades
6) Chunked transfer encoding
7) Verify openssl hostname check
8) SNI
9) Ideally some progressbar for large transfers such as the geoip db
   (for cURL too by the way)

And.. finally we should use this stuff from the modulemanager so we
don't have duplicate code.
2021-08-20 19:19:04 +02:00
Bram Matthys 5321dcb81b ConfigResource: get rid of rs->flag.type stuff and just use rs->type.
Also replace local variables 'inc' with 'rs'.
2021-08-19 09:37:28 +02:00
Bram Matthys ae6222e329 Get rid of errorbuf in ConfigResource as this is not used. 2021-08-19 09:34:33 +02:00
Bram Matthys 4e53bf874a Make remote includes caching work again. Both on-boot and on-rehash. 2021-08-19 09:33:46 +02:00
Bram Matthys 7b3c1165f8 Make tld::mask use the generic masks that we use everywhere
(and hence support multiple masks and server bans matching etc)
2021-08-18 18:45:23 +02:00
Bram Matthys e503ad4fd5 Reorder members in ConfigEntry struct a bit (optimize for L1/L2 cache)
Obviously name, value and next should be at the top.
2021-08-18 18:32:05 +02:00
Bram Matthys a60b9f3176 Handle duplicate URLs/downloads (only download once) 2021-08-18 16:43:42 +02:00
Bram Matthys ce3e23a5d2 Get rid of unnecessary included_from and included_from_line
members in ConfigResource (previously ConfigItem_include).
2021-08-18 16:31:48 +02:00
Bram Matthys d8c3da7698 Get rid of download_file(), the synchronous version, is no longer used. 2021-08-18 15:14:14 +02:00
Bram Matthys 756fee58cb Rename ConfigItem_include to ConfigResource and also use it for non-includes
such as other items in the configuration file that are URLs.
2021-08-18 14:54:41 +02:00
Bram Matthys b74d15595b Change int rehash() to void request_rehash(), which is a better name
as it REQUESTS to rehash the server, but it may not be done immediately.
And making it void makes sure nobody relies on some sort of return
value which will differ between with vs without remote includes.

Also get rid of sig and loop.rehash_save_sig, as a NULL client
already indicates the same (or at least does so now).
2021-08-18 13:28:56 +02:00
Bram Matthys 675c1cab55 Rename loop struct members:
* loop.ircd_rehashing -> loop.rehashing
* loop.ircd_terminating -> loop.terminating
* loop.ircd_booted -> loop.booted
* loop.ircd_forked -> loop.forked
2021-08-18 13:08:42 +02:00
Bram Matthys f184472781 Get rid of argument to config_test(), as we have loop.ircd_rehashing for that. 2021-08-18 13:03:31 +02:00
Bram Matthys fe2c834080 Rename lots of config functions (internally used ones, most likely
not used by 3rd party authors):
* conf_start() -> config_read_start()
* conf_check_complete() -> is_config_read_finished()
* load_conf() -> config_read_file()
* config_test() -> config_test_blocks()
* config_run() -> config_run_blocks()
* init_conf() -> config_test()
* run_configuration() -> config_run()

This so things look like:

if (config_read_start() < 0)
        exit(-1);
while (!is_config_read_finished())
	; // do something
if (config_test(1) == 0)
        config_run();
2021-08-18 12:57:38 +02:00
Bram Matthys 7321a66196 Make failed include loading fatal again. And fix a crash related to that. 2021-08-18 12:46:11 +02:00
Bram Matthys 685e0ee073 In ConfigItem_include include->url now always exists, and src/url.c is now
always compiled in, both regardless of cURL support or not.
Obviously the cURL functions are not available without cURL and there
are now some #ifdef USE_LIBCURL in url.c

This also fixes the current build to work without cURL
2021-08-18 12:27:13 +02:00
Bram Matthys 03423a2eb7 Get rid of INCLUDE_NOTLOADED and INCLUDE_USED which AFAICT are
unnecessary. Get rid of load_includes() which did the marking
and unload_notloaded_includes() and unload_loaded_includes()
accordingly. There's now one single free_all_includes().
2021-08-18 11:52:53 +02:00