Commit Graph

1134 Commits

Author SHA1 Message Date
Omar Polo 81bab00246 split out iri.h from gmid.h 2023-07-22 13:49:07 +00:00
Omar Polo 6a996ec20f fmt 2023-07-22 08:19:26 +00:00
Omar Polo bd23307690 drop engine support 2023-07-22 08:17:02 +00:00
Omar Polo 21617eda73 remove the useless logging methods
it makes more clear where the magic is.  adapted from the smtpd'
ca.c diff.
2023-07-22 08:13:15 +00:00
Omar Polo 5d2f4b1611 add compat for endian (now required by imsg) 2023-07-02 09:14:44 +00:00
Omar Polo c9c44c6571 update imsg 2023-07-02 08:55:38 +00:00
Omar Polo 71b02f6390 rename do_accept() -> server_accept() 2023-07-01 22:00:08 +00:00
Omar Polo 2b0b2661ea enrich the description of the server process 2023-07-01 18:44:42 +00:00
Omar Polo 1134ea149a typo 2023-07-01 18:42:16 +00:00
Omar Polo 2c3810687f change log_request to take the code and meta unpacked
don't know what i was smoking when I wrote log_request() like that...
2023-07-01 18:41:46 +00:00
Omar Polo 2247b66842 improve fcgi test: send more than one chunk of data 2023-07-01 18:38:22 +00:00
Omar Polo 0f7fdd2105 parse (and log) the header from fastcgi 2023-07-01 18:37:59 +00:00
Omar Polo a6f2cfe792 multiple -v don't make it more verbose anymore 2023-07-01 14:28:12 +00:00
Omar Polo e3ce19dcc1 change on fatalx -> log_warnx
we already check the validity of the format string, but still avoid a
gratious fatal() at runtime.
2023-07-01 14:22:26 +00:00
Omar Polo 80192f4589 rename fmt_sbuf -> fmtbuf; make the buffer explicit 2023-07-01 14:21:41 +00:00
Omar Polo 57ee9057af add some ideas 2023-07-01 14:11:21 +00:00
Omar Polo 994fc034e5 avoid needless strlen() 2023-07-01 14:11:21 +00:00
Omar Polo e2003e7e30 simplify request handling
get rid of check_path(), it's overly complicated.  Instead, inline
open_file() in client_read() and rework open_dir() to just use
openat() instead of the complicate dance it was doing.

Simplify open_dir() too in the process: if the directory entry for the
index is not a regular file, pretend it doesn't exist.
2023-07-01 14:11:18 +00:00
Omar Polo 2339a71178 use a function-local buffer for the canonical redirect 2023-07-01 13:13:04 +00:00
Omar Polo fef06f06ac remove the fcgi debug code 2023-07-01 13:07:18 +00:00
Omar Polo 911156fb95 make `listen on' defaults on port 1965 2023-06-29 15:01:16 +00:00
Omar Polo c9e878d6a4 use snprintf() instead of chain of strlcpy/cat 2023-06-26 10:17:43 +00:00
Omar Polo ed164e7221 call getnameinfo() only once per request 2023-06-26 09:44:46 +00:00
Omar Polo da0821b6cb avoid gratious strlen; evbuffer_readln returns the length 2023-06-24 20:19:33 +00:00
Omar Polo a452496a96 rework check 2023-06-24 19:42:31 +00:00
Omar Polo 287ab86538 default chroot to user' home if unset 2023-06-24 19:42:31 +00:00
Omar Polo 0fc92ad2fd update changelog 2023-06-24 14:25:12 +00:00
Omar Polo 841633cfec plug memory leak in client_close_ev 2023-06-24 14:22:12 +00:00
Omar Polo ddf7a437de fix client_close_ev when tls_close() returns TLS_WANT_POLLIN/OUT
in those cases we need to reschedule the function and return, instead
of going on with the cleanup.
2023-06-24 14:21:57 +00:00
Omar Polo c5edb15740 properly handle handshake failures
If a TLS handshake fails there's nothing we can do, so don't attempt
to reply an error (the connected client is not speaking Gemini as
it's not using TLS at all) and instead just close the connection.

Fixes issue #13
2023-06-24 14:15:57 +00:00
Omar Polo 53bdae38fe update changelog 2023-06-24 13:30:13 +00:00
Omar Polo 23f0ac49ed fix previous 2023-06-24 13:20:51 +00:00
Omar Polo 6a60134c64 mention gg and ge 2023-06-24 13:19:26 +00:00
Omar Polo fea6a85623 update the README after recent developments 2023-06-24 13:17:44 +00:00
Omar Polo 24f644dbb6 there's no more any `static' target 2023-06-24 13:10:31 +00:00
Omar Polo 3a877237a7 gg.1: improve -d description 2023-06-24 13:04:40 +00:00
Omar Polo 7edcf2b341 update gmid.conf.5: drop old rules and add news
- minor improvements to the wording - drop the removed global options
ipv6 and port - remove config-less mention - document `listen on'
- update examples

While `ipv6' and `port' are still supported for backward compatibility,
it's better to not document them anymore.
2023-06-24 13:04:15 +00:00
Omar Polo b3010dbbaf update gmid.8
- it doesn't run anymore without a config file - a reload is enough
to re-open the directories.

This last point in particular was done this way to allow using
capsicum(4) on FreeBSD, something that is currently impossible.  I
may just remove it.
2023-06-24 13:02:44 +00:00
Omar Polo c3d502d455 add a `lint' maintainer target to check the manpages 2023-06-24 13:01:31 +00:00
Omar Polo eac9287d29 copyright years++ 2023-06-24 10:07:17 +00:00
Omar Polo df6282815f remove unused global flag 2023-06-24 10:03:03 +00:00
Omar Polo aa30aaedc8 don't match host if connecting from the wrong socket
limit how one given virtual host can be reached based on its `listen
on' lists
2023-06-24 10:02:46 +00:00
Omar Polo 35dd3fc8ce typo 2023-06-24 09:51:05 +00:00
Omar Polo e50f85adcb load the certs per listening address 2023-06-24 09:50:30 +00:00
Omar Polo a0a42860d2 send host addresses to the server process 2023-06-24 09:14:35 +00:00
Omar Polo 9fda962861 better fd rampage avoidance
flush imsg right in config_send_file()
2023-06-24 09:04:21 +00:00
Omar Polo 2c0716fd7d hopefully fix the macos ci 2023-06-23 22:40:58 +00:00
Omar Polo 2d0a2b21f5 add missing include of ../config.h in regress/*.c
otherwise we get a nice 'no previous prototype' due to
-Wmissing-prototypes.
2023-06-23 22:40:09 +00:00
Omar Polo 5134078414 macos' clang is retarded
thinks rsa and ecdsa may be used un-initialized... if we enter the
branch with fatalx().

sigh
2023-06-23 22:39:37 +00:00
Omar Polo 3d0204e7ef don't quote $5 when calling pkg-config
otherwise we fail the openssl test 'libcrypto libssl'
2023-06-23 22:38:10 +00:00