1
0
forked from aniani/gmnisrv
Commit Graph

28 Commits

Author SHA1 Message Date
René Wagner
32913c35cd implement handling of ROUTE_EXACT definitions
This patchset implements the handling of exact routes
as described in gmnisrvini(5).
2021-01-29 08:55:43 -05:00
Drew DeVault
dc6e4e80c0 Implement URL rewrites with regex capture groups 2020-11-01 11:19:51 -05:00
Drew DeVault
70fadc21b9 Drop most of the unicode tables 2020-10-29 23:30:49 -04:00
Drew DeVault
7e8a953794 Initial pass on regex routing support
All this does is parse the regexes out of the config file.

I've vendored libregexp from Bellard's quickjs project, because it's
reasonably small and self-contained, and POSIX regexes don't support
captures. We're eventually going to want captures for URL rewrites, so
this'll do for now.
2020-10-29 22:47:56 -04:00
Drew DeVault
becc4460b6 Implement MIME database support 2020-10-28 12:38:32 -04:00
Drew DeVault
cc1bd152e3 Initial support for CGI scripts 2020-10-25 23:16:50 -04:00
Drew DeVault
8baeb5a51c Initial implementation of a routing table 2020-10-25 21:46:01 -04:00
Drew DeVault
1fe107875b Overhaul network I/O to be async for real
Had to totally cut off OpenSSL from the network fd because obviously
OpenSSL is just going to wreck our shit
2020-10-25 14:50:07 -04:00
Kevin Sangeelee
cff1f71f1a Change assert to 2-param version to comply with C11. 2020-09-29 18:04:12 -04:00
Drew DeVault
fc036335eb Remove [:tls] email directive 2020-09-26 16:41:11 -04:00
Drew DeVault
50d21c03f5 Free up resources throughout 2020-09-26 16:10:10 -04:00
Drew DeVault
6bc9c4deb9 Implement autoindex option 2020-09-26 15:51:28 -04:00
Drew DeVault
165e3c02fc Rehome some logic from server.c -> serve.c 2020-09-26 15:08:25 -04:00
Drew DeVault
61bc033740 Okay, time to quit fucking around with BUFSIZ 2020-09-26 15:00:40 -04:00
Drew DeVault
d4d8ea646c Turns out BUFSIZ is small sometimes 2020-09-26 14:56:18 -04:00
Drew DeVault
48f75abcfd Bump client buffer size to BUFSIZ 2020-09-26 14:45:39 -04:00
Drew DeVault
9bed26b8d9 Log response body size in bytes 2020-09-26 14:41:17 -04:00
Drew DeVault
dfab99ace5 Serve files from root 2020-09-26 14:36:52 -04:00
Drew DeVault
ce467cebd3 Parse requests and serve simple responses 2020-09-26 13:39:37 -04:00
Drew DeVault
fa69887e52 Implement TLS exchange with clients
This probably leaves a bit to be desired tbh
2020-09-24 19:58:41 -04:00
Drew DeVault
7af04ea471 tls: move cert/key into host structure
We'll later want to set these on the SSL object (rather than SSL_CTX),
so move these into the host struct for later access.

We'll prefer to set it on the SSL object so that we can automatically
use an up-to-date certificate, per ~sircmpwn/gmni#26.
2020-09-24 17:55:10 -04:00
Drew DeVault
0d1137f987 Implement TLS store
Includes hands-free certificate generation and loading
2020-09-24 17:51:29 -04:00
Drew DeVault
b85c64b441 Generalize logging 2020-09-23 14:32:52 -04:00
Drew DeVault
da9db7bc46 Implement basic server event loop 2020-09-23 14:19:28 -04:00
Drew DeVault
65c2a56c6d Initialize sockets 2020-09-23 12:43:05 -04:00
Drew DeVault
9adc6f34c7 config: parse listen directives 2020-09-23 11:33:05 -04:00
Drew DeVault
58500c8e53 Initial config parser 2020-09-23 11:24:23 -04:00
Drew DeVault
ccae8ffd28 Vendor in some support code 2020-09-23 10:40:14 -04:00