Commit Graph

161 Commits

Author SHA1 Message Date
Omar Polo
9325f61db0 add regress for gg -n 2024-06-10 08:20:35 +00:00
Omar Polo
235f5e70ee regress: add a test for comments and blanks at the start of the file 2024-06-06 17:38:30 +00:00
Omar Polo
69cfd0a304 add a todo 2024-06-06 13:53:09 +00:00
Omar Polo
0a4a979ccb regress: add a check for `fastcgi off' handling across locations
Based on the bug report from Alex, thanks!
2024-06-03 16:14:40 +00:00
Omar Polo
c9ea70a36f regress: add test_ipv6_server 2024-05-29 09:06:45 +00:00
Omar Polo
7c723cf05f regress: add a knob to disable test_ipv6_addr
at least on the CI is failing with "can't connect to ::1:10965:
Address not available" which suggests IPv6 is broken there.
2024-05-29 09:05:06 +00:00
Omar Polo
b5dd7091ad typo 2024-05-29 08:58:12 +00:00
Omar Polo
5b549c2805 regress: rename ipv4 test and add another with ipv6 2024-05-29 08:56:10 +00:00
Omar Polo
b00f71ba97 iri: add support for raw IPv6 addresses 2024-05-29 08:52:25 +00:00
Omar Polo
9f675805d0 regress: run test_ip_addr with host=127.0.0.1 2024-05-29 08:33:36 +00:00
Omar Polo
610a4666cd regress: use the new gg -q to reduce the blabbering 2024-05-29 08:09:25 +00:00
Omar Polo
b2782022c9 add regress that hit gmid via a raw IPv4 address 2024-05-29 07:54:03 +00:00
Omar Polo
42235e3fc2 add a test for the config dumping 2024-04-04 13:07:09 +00:00
Omar Polo
bb5a25d287 rename the @common_opt macro back to @common
now common is no longer a reserved keyword
2024-01-30 09:31:09 +00:00
Omar Polo
3524375abe add a test that uses @-style macros
See Codeberg issue #1.
2024-01-26 15:34:46 +00:00
Omar Polo
80745f0411 regress: change naming scheme for certs, add GENCERT_FLAGS knob
Call the certificates .pem and the keys .key; use contrib/gencert
to generate the certificates and provide a GENCERT_FLAGS knob so
that regress can be run with EC keys (GENCERT_FLAGS=-e).  Still no
automatic way of testing with both RSA and EC keys.
2023-08-29 09:30:28 +00:00
Omar Polo
f9ab77a898 bundle libtls
gmid (like all other daemons that want to do privsep crypto) has a
very close relationship with libtls and need to stay in sync with
it.

OpenBSD' libtls was recently changed to use OpenSSL' EC_KEY_METHOD
instead of the older ECDSA_METHOD, on the gmid side we have to do
the same otherwise failures happens at runtime.  In a similar manner,
privsep crypto is silently broken in the current libretls (next
version should fix it.)

The proper solution would be to complete the signer APIs so that
applications don't need to dive into the library' internals, but
that's a mid-term goal, for the immediate bundling the 'little'
libtls is the lesser evil.

The configure script has gained a new (undocumented for the time
being) flag `--with-libtls=bundled|system' to control which libtls
to use.  It defaults to `bundled' except for OpenBSD where it uses
the `system' one.  Note that OpenBSD versions before 7.3 (inclusive)
ought to use --with-libtls=bundled too since they still do ECDSA_METHOD.
2023-08-23 17:38:49 +00:00
Omar Polo
56054fe197 use the legacy style in the tests for now 2023-08-03 22:37:05 +00:00
Omar Polo
f736c9579c fix test after log style condensed change 2023-08-03 22:35:49 +00:00
Omar Polo
98827de5ab use `log syslog off' in regress to avoid spamming syslog 2023-07-26 08:11:39 +00:00
Omar Polo
a84492b75f ge->gemexp forgotten in previous 2023-07-25 20:27:31 +00:00
Omar Polo
471a5250e3 rename ge -> gemexp in regress too 2023-07-25 20:26:26 +00:00
Omar Polo
abd261d25b allow to change the logging style; introduce some new ones
add `log style <style>'; The old default is called `legacy' now, a
new default format is added called `condensed', and `common' and
`combined' to mimick Apache httpd and nginx (respectively) are also
added.
2023-07-25 20:07:26 +00:00
Omar Polo
60b4efa1e2 add a test for the file logging 2023-07-24 08:51:35 +00:00
Omar Polo
60f4107da6 add a test with fastcgi, locations and forceful disabling 2023-07-23 19:04:53 +00:00
Omar Polo
fdd67729b4 adjust syntax in fastcgi test; add another test for the old syntax 2023-07-23 18:45:43 +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
57ee9057af add some ideas 2023-07-01 14:11:21 +00:00
Omar Polo
5a34572282 use REGRESS_HOST to specify the host to listen to; use in CI
some CI envs don't like `listen on localhost' but tolerate INADDR_ANY
or IN6ADDR_ANY_INIT.
2023-06-23 22:00:21 +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
1959cda3d8 more avoiding of void pointer arithmetics
This time with a temporary variable to avoid not to trigger
-Wpointer-sign, sigh.
2023-06-13 17:36:42 +00:00
Omar Polo
1610f9541d rework the configure script
now it resembles less oconfigure and more the configure scripts I'm
using in my recent projects.  I'd argue it's more easy to use it.
2023-06-13 16:36:10 +00:00
Omar Polo
611dffe816 remove regress/sha
we can use cmp to tell if two files are different, which also has
the benefit of being available everywhere and reporting the byte
offset of the first difference.  Reduces the test dependencies on
some systems.
2023-06-13 10:59:50 +00:00
Omar Polo
94893746ae use the default prefork in tests 2023-06-12 21:28:28 +00:00
Omar Polo
af1dab1870 don't have the config being a global 2023-06-09 17:18:04 +00:00
Omar Polo
d273c0648d ignore and clean fcgi.sock 2023-06-09 10:51:24 +00:00
Omar Polo
fe7cdaa479 fcgi-test: be less verbose 2023-06-09 10:47:20 +00:00
Omar Polo
9adeb26579 re-establish fastcgi test 2023-06-09 10:46:50 +00:00
Omar Polo
cd1ede6dd3 rework fcgi-test so that it binds a local socket
still not re-enabled.
2023-06-09 10:39:05 +00:00
Omar Polo
deadd9e131 readd proxy certs and `require client ca' support
Was temporarly disabled during the transition to real privsep.
While here, fix a memory leak when using `require client ca'.

Also, avoid leaking info about the parent address space layout to
server processes by not sending pointer values.
2023-06-09 09:28:26 +00:00
Omar Polo
797c4609a9 make ge work again 2023-06-08 16:22:03 +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
99f1fbb0c7 regress: use -P with an absolute path 2023-06-08 13:56:09 +00:00
Omar Polo
3a8c76eab2 rename PROC_MAX to PREFORK_MAX 2023-06-06 08:34:31 +00:00
Omar Polo
0ac785a6fa revert aae8f6bf2b
it's just not worth it to inflict this breaking change to the users.
2023-06-05 20:35:12 +00:00
Omar Polo
a4180f1d0b disable test_unknown_host temporarly
breaks on some distro and needs further investigations; it's not that
interesting fortunately.
2022-10-31 22:53:16 +00:00
Omar Polo
4b93be289b rework `make dist' 2022-10-31 22:53:16 +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
7bb80ca90d don't count twice the failing tests on gmid crash 2022-09-10 10:12:50 +00:00
Omar Polo
aae8f6bf2b change the flags to be consistent with other OpenBSD daemons
-d is `debug' (run in the foreground)
 -f to load the configuration file

adjust regress and contrib accordingly
2022-09-08 21:34:29 +00:00