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
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
374069914e
Fix memory leak in find_invex() due to extban recode from a few
...
weeks ago.
2021-08-22 10:44:29 +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
021ba807bd
Fix memory leaks in built-in https client and only build SSL_CTX once.
2021-08-21 20:29:38 +02:00
Bram Matthys
ec5f9ee6c3
Add check for missing HTTP/1.X response. Shouldn't happen, but,
...
otherwise the error would be confusing wrt redirects, this is better.
2021-08-21 18:33:14 +02:00
Bram Matthys
8344327cb4
HTTPS client: support Basic authorization
2021-08-21 16:57:38 +02:00
Bram Matthys
6f087093df
Create some more notes regarding the release notes
2021-08-21 16:36:33 +02:00
Bram Matthys
ccc0b3397e
For a remote include, use the URL[*] in any error messages instead
...
of the temporary file. That is, ce->file->name contains the URL.
[*] Any user:pass is censored from the URL via displayurl()
2021-08-21 16:15:41 +02:00
Bram Matthys
ecc3ffe1e2
Parse error in remote include must be a fatal error. It is now (again).
2021-08-21 16:04:55 +02:00
Bram Matthys
24dec75576
Rename the current cloaking module to 'oldcloak'
2021-08-21 14:32:49 +02:00
Bram Matthys
8dc316bd8d
Use SHA256 instead of MD5 in add_entropy_configfile()
2021-08-21 14:28:01 +02:00
Bram Matthys
c821efa477
Get rid of old remote include stuff in windows gui.c, we don't
...
track this anymore.
[skip ci]
2021-08-21 14:14:03 +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
e28cbb6041
Differentiate between DNS/connect timeout (15s) and transfer timeout (45s).
...
Already done in curl code, now also in non-curl-code.
2021-08-21 13:36:03 +02:00
Bram Matthys
fe08d58dbc
Add SNI support. Verify TLS certificate belongs to the host.
...
(Those were items 7 and 8 on the previously mentioned TODO list)
2021-08-21 13:30:36 +02:00
Bram Matthys
6a6f4120ee
Built-in https client: Deal with Transfer-Encoding: chunked
...
(and also fix a crash if using non-https url)
2021-08-21 13:23:33 +02:00
Bram Matthys
c9c2106bb9
Use SHA256 hash for cache/<object> instead of old MD5
2021-08-21 09:45:44 +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
9fe3b3f4d5
Use https_cancel() and get rid of goto's.
2021-08-21 09:09:10 +02:00
Bram Matthys
2a762ee68b
Use handle->errorbuf instead of local errorbuf everywhere.
2021-08-21 08:52:47 +02:00
Bram Matthys
2c7d2c8f86
Split url.c into url_curl.c (curl implementation) and url_unreal
...
(the new fallback https-only implementation).
./configure will set URL= to either url_curl.o or url_unreal.o
depending on whether curl is enabled or not.
The 3 functions that both implementations had in common are now in
src/misc.c: url_is_valid(), displayurl() and url_getfilename().
2021-08-21 08:47:38 +02:00
Bram Matthys
00f3f300f0
Put downloads in a list.
2021-08-21 08:31:30 +02:00
Bram Matthys
1752844824
Built in HTTPS support: support http caching (If-Modified-Since, 304)
2021-08-21 08:24:52 +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
f95e799397
For failed downloads, where we have a cached copy present, i forgot
...
to read the (cached) remote include file so it did not check if it
included another remote include.
2021-08-19 09:57:08 +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
cdff69db7a
Allow people to include the same file multiple times. This will no
...
longer raise an error and we will simply load the include only once.
I left some tracing code in case we have a bug in the code that
handles this, but testing shows it works well both for files and
URLs.
2021-08-18 17:04:45 +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
0b5fab1617
Some cleanups in src/url.c and added error message for the very unusual
...
case where curl may fail to create a handle.
2021-08-18 15:19:51 +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
6d56145f60
Remove URL support from staff module now that main conf.c already does this.
...
And re-enable the module, as it was #if'd out.
2021-08-18 15:11:37 +02:00
Bram Matthys
e296464b97
Get rid of update_config_resource() and just set the appropriate
...
values at the four places that used it.
2021-08-18 15:02:18 +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
d897ecbc86
Get rid of some if (need_34_upgrade) upgrade_conf_to_34(); stuff
...
We probably want to get rid of that at all?
Maybe defer until we know whether we want/need it for U5->U6...
2021-08-18 13:36:55 +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