Commit Graph

38 Commits

Author SHA1 Message Date
Omar Polo
ac46710a4b fix ge^W gemexp version string 2024-01-08 08:34:36 +00:00
Omar Polo
bab32701fb gemexp: add -R to generate an RSA (4096) key instead of an EC one (default) 2023-10-18 18:06:08 +00:00
Omar Polo
adaae5163c rework gencert(); make gemexp generate EC certs
Taking inspiration from acme-client.
2023-10-18 17:47:29 +00:00
Omar Polo
60ff0ebcb5 gemexp doesn't have -v; remove from getopt and usage() 2023-08-29 10:44:08 +00:00
Omar Polo
96515efd27 tweak gemexp logs
gemexp is meant for local testing so I'm not too worried about
changing its log format if it makes sense to do so.
2023-08-29 09:35:07 +00:00
Omar Polo
a6d07f09e0 gemexp: save certs to $XDG_DATA_HOME/gemexp, not /gmid 2023-08-29 09:26:14 +00:00
Omar Polo
f31289a8ac gemexp: change the naming scheme for the certificates
Using what the manpage advertised.  The regress adaptations will
follow.  The directory will also change (and the key type too.)
2023-08-29 09:24:14 +00:00
Omar Polo
ddbcd3c13f use the subject' common name as the user field in log 2023-08-07 14:04:47 +00:00
Omar Polo
857635a107 use the condensed logging style in ge too 2023-07-25 20:10:53 +00:00
Omar Polo
71b02f6390 rename do_accept() -> server_accept() 2023-07-01 22:00:08 +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
ed164e7221 call getnameinfo() only once per request 2023-06-26 09:44:46 +00:00
Omar Polo
eac9287d29 copyright years++ 2023-06-24 10:07:17 +00:00
Omar Polo
e50f85adcb load the certs per listening address 2023-06-24 09:50:30 +00:00
Omar Polo
509d0509a5 implement `listen on'
Listening by default on all the addresses is so bad I don't know
why I haven't changed this before.  Anyway.

Add a `listen on $hostname port $port' syntax to the config file
and deprecate the old "port" and "ipv6" global setting.  Still try
to honour them when no "listen on" directive is used for backward
compatibily, but this will go away in the next next version hopefully.

At the moment the `listen on' in server context don't filter the
host, i.e. one can still reach a host from a address not specified
in the corresponding `liste on', this will be added later.
2023-06-23 21:03:29 +00:00
Omar Polo
37df23d183 rename client->addr to raddr (remote address) and keep original length 2023-06-23 21:03:29 +00:00
Omar Polo
ab55c7815e typo; use the l' variable not len' 2023-06-23 21:03:24 +00:00
Omar Polo
ba290ef3af disable the privsep crypto engine on !OpenBSD
it fails bandly at runtime on various linux distros and on freebsd.
Until a fix is found, disable it so I can move forward.
2023-06-11 12:18:27 +00:00
Omar Polo
af1dab1870 don't have the config being a global 2023-06-09 17:18:04 +00:00
Omar Polo
e45334e6ae move hosts into the config struct 2023-06-09 16:54:04 +00:00
Omar Polo
5d22294a59 move fastcgi from global var to the config struct
while here also make them a list rather than a fixed-size array.
2023-06-09 10:42:36 +00:00
Omar Polo
49bd46a150 fix ge build 2023-06-08 19:30:26 +00:00
Omar Polo
8eeb992206 less logger.h 2023-06-08 19:30:10 +00:00
Omar Polo
797c4609a9 make ge work again 2023-06-08 16:22:03 +00:00
Omar Polo
61febd28af remove now unused ibuf variable 2023-06-08 15:44:34 +00:00
Omar Polo
c26f2460e4 rework the daemon to do fork+exec
It uses the 'common' proc.c from various OpenBSD-daemons.

gmid grew organically bit by bit and it was also the first place where I
tried to implement privsep.  It wasn't done very well, in fact the
parent process (that retains root privileges) just fork()s a generation
of servers, all sharing *exactly* the same address space.  No good!

Now, we fork() and re-exec() ourselves, so that each process has a fresh
address space.

Some features (require client ca for example) are temporarly disabled,
will be fixed in subsequent commits.  The "ge" program is also
temporarly disabled as it needs tweaks to do privsep too.
2023-06-08 13:59:31 +00:00
Omar Polo
2dd5994ae1 use fatal() in code used in the daemon 2023-06-06 11:52:43 +00:00
Omar Polo
eae52ad493 switch to the more usual log.c 2023-06-06 11:46:40 +00:00
Omar Polo
281a8852b3 rename log.[ch] to logger.[ch] 2023-06-06 08:50:54 +00:00
Omar Polo
4267093e37 nitpick: fix snprintf check 2023-06-06 08:22:18 +00:00
Omar Polo
c68baad22a move config-related code to config.c
reuse it in ge too.
2023-06-06 08:18:57 +00:00
Omar Polo
0046c1fe9c call setlocale() 2023-06-06 08:11:30 +00:00
Omar Polo
070b32952c move and dedup the tls initalization in server.c 2023-06-05 21:10:18 +00:00
Omar Polo
df5058c919 provide a more usual fatal
fatal usually appends the error string.  Add 'fatalx' that doesn't.
Fix callers and move the prototypes to log.h
2023-06-05 17:07:52 +00:00
Omar Polo
a01a91db06 move some server-related code to server.c 2023-06-05 16:18:57 +00:00
Omar Polo
534afd0ddc make the various strings in the config fixed-length
will help in future restructuring to have fixed-size objects.
2022-10-05 15:10:44 +00:00
Omar Polo
c5b4db930e specify custom version strings for the various cmds 2022-09-10 14:29:40 +00:00
Omar Polo
0126d91d1d add ge: gemini export! 2022-09-07 20:47:33 +00:00