Commit Graph

112 Commits

Author SHA1 Message Date
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
Omar Polo a5fb2593a9 adjust regress to use `ge' for the old configless test 2022-09-08 20:45:12 +00:00
Omar Polo d29a2ee224 get rid of the CGI support
I really want to get rid of the `executor' process hack for CGI scripts
and its escalation to allow fastcgi and proxying to work on non-OpenBSD.

This drops the CGI support and the `executor' process entirely and is
the first step towards gmid 2.0.  It also allows to have more secure
defaults.

On non-OpenBSD systems this means that the sandbox will be deactivated
as soon as fastcgi or proxying are used: you can't open sockets under
FreeBSD' capsicum(4) and I don't want to go thru the pain of making it
work under linux' seccomp/landlock.  Patches are always welcome however.

For folks using CGI scripts (hey, I'm one of you!) not all hope is lost:
fcgiwrap or OpenBSD' slowcgi(8) are ways to run CGI scripts as they were
FastCGI applications.

fixes for the documentation and to the non-OpenBSD sandboxes will
follow.
2022-09-06 16:11:09 +00:00
Omar Polo 5df699d1ab count ran/failed tests number 2022-08-29 16:44:07 +00:00
Omar Polo d45d5306e3 fix test_auto_index 2022-07-04 14:33:45 +00:00
Omar Polo 96e3c01314 refactor the makefile / configure
steal more (good) stuff from mandoc-portable :)
2022-07-04 13:44:38 +00:00
Omar Polo a555e0d67b copyright years 2022-07-04 09:48:39 +00:00
Omar Polo 617ae38546 add some more regress for the encodings 2022-07-04 09:36:55 +00:00
Omar Polo 475205fa0f check for the expected page in test_auto_index
not just the number of lines, check the full page!
2022-07-04 09:36:31 +00:00
Omar Polo 5e41063f1b bugfix: allow @ and : in paths
gmid would disallow the '@' and ':' characters in paths (unless
percent-encoded.)  Issue reported by freezr.
2022-07-04 08:15:39 +00:00
Omar Polo 93cab6dc78 document the implicit mapping for text/gemini
and remove the explicit mapping from the documentation and test files.
2022-04-08 15:36:59 +00:00
Omar Polo fde8750859 fix test_include_mime after `types' change 2022-04-08 13:52:48 +00:00
Omar Polo 9448a01fdb use the types block instead of `map' in the tests too 2022-04-07 16:21:56 +00:00
Omar Polo 91971201e5 break out if check_reply fails
it's not a problem when we have only one check_reply at then end,
since $? is kept across function boundaries, but when we have multiple
checks we need to quit on the first error.
2022-03-26 10:56:06 +00:00
Omar Polo e5d82d9472 const-ify some tables
matches found with

	% grep -R '=[	 ]*{' . | fgrep -v const
2022-03-19 11:02:42 +00:00
Omar Polo 12fcba2f80 use shell built-in `command' instead of which(1)
it's specified by POSIX AFAIK and requires less redirections.
2022-02-27 16:24:45 +00:00
Omar Polo fb1212266f add tests for the type block 2022-02-26 14:02:45 +00:00
Anna “CyberTailor” c1a72dab7a typo 2022-02-03 11:13:43 +01:00
Anna “CyberTailor” 1ca7a0f3bf don't skip unit tests when SKIP_RUNTIME_TESTS is set
IRI and Punycode tests don't run gmid binary and can be safely executed.
2022-02-03 11:13:41 +01:00
Omar Polo 5266f50060 posixify lib.sh: use = instead of == for test(1) 2022-01-30 13:31:29 +00:00
Omar Polo 964686ce0b remove unused function 2022-01-27 10:57:45 +00:00
Omar Polo 901905e0cf bail out of client_read if we've already decide what to do
libevent2 can still somehowe call client_read even in code paths
that never enable reading from the evbuffer.  Can't reproduce on
the libevent in base on OpenBSD.  It's a bit ugly, but it's a small
workaround for something that otherwise *always* make gmid crash
when linked against libevent2.  (client_read works under the
assumption that c->host != NULL, matched_proxy crashes otherwise.)
2022-01-05 18:58:01 +00:00
Omar Polo 92a9f41d3d add set_proxy to simplify testing + more checks in test_proxy_with_certs 2022-01-03 13:31:34 +00:00
Omar Polo 7b7def0a8f set prefork to 1 during regress 2022-01-03 13:31:34 +00:00
Omar Polo dd208aa2cf don't print `config OK' 2022-01-03 13:31:34 +00:00
Omar Polo e19f21f5a6 parethesize `proxy', I'm about to change the syntax 2022-01-02 13:48:32 +00:00
Omar Polo c064f3de1d add proxying with client certificate test 2022-01-01 16:33:44 +00:00
Omar Polo e6ab6b25fc typo 2022-01-01 16:33:44 +00:00
Omar Polo 4b5b1e82a9 add a test for the `proxy relay-to' rule 2021-12-29 20:36:54 +00:00
Omar Polo a62c63f261 retire the old gg 2021-12-29 18:18:41 +00:00
Omar Polo 7a4ae106ec switch to the new gg for the regress suite 2021-12-29 18:16:00 +00:00
Omar Polo ce09569f7b typo 2021-12-29 18:13:55 +00:00
Omar Polo ae0d3cdbbe typo
forgot to rename variable in lib.sh: dont_check ->
dont_check_server_alive.
2021-12-09 19:13:30 +00:00
Omar Polo e5285d5422 rename `runtime' to `regress'
while there also kill an unused rule `regress', it's now redundant since
all the tests are run together.
2021-12-09 20:06:38 +01:00
Omar Polo a721c233ee rename variable 2021-12-09 19:03:18 +00:00
Omar Polo 5741561d57 run all kinds of tests via tests.sh/runtime
while there also change the dependency in the makefile: iri_test should
be alone, not as deps of `data'.
2021-12-09 19:02:09 +00:00
Omar Polo ea47a245aa add ocs stapling checking for gg 2021-12-09 18:51:02 +00:00
Omar Polo 3096da4ef4 allow to run only a subset of the runtime tests
with
	make TESTS='test_1 test_2 ...' regress

now it's possible to run only that specified subset of tests.  It's
really useful during debugging :)
2021-10-07 08:55:44 +00:00
Omar Polo 6e0f14d51e re-add sha script; it's used in the Makefile
While there, use it in the tests too
2021-10-04 09:40:05 +00:00
Omar Polo 260becda9c reduced the timeout time for single checks 2021-10-04 09:34:39 +00:00
Omar Polo 4a2a525d7c allow running only specific tests
It's now possible to run only a subset of the tests with:

	./runtime test1 test2 ...
2021-10-04 09:30:18 +00:00
Omar Polo 99c91b4a51 remove unused script 2021-10-04 09:07:42 +00:00
Omar Polo 176179b2a9 rework the regression suite
The tests are still there, the suite is equivalent to the old one, but
this one is better structured.

The biggest annoyance I had with the old one was that it wasn't
straightforward to test only a specific set of tests.  It's still
impossible, but it's way easier to do it now.

This extract all the tests to their own functions.  It's overall
better in all possible regards.
2021-10-04 09:04:33 +00:00
Omar Polo c28994868e update clean target 2021-10-02 19:35:30 +00:00
Omar Polo 827cc37cff update tests
* we don't add a space before the lang anymore
* we're more strict in CGI handling: the `invalid' CGI script now
  triggers a 42 CGI ERROR
2021-10-02 17:20:56 +00:00
Omar Polo 3571854e94 fix possible out-of-bound access
While computing the parent directory it an out-of-bound access can
occur, which usually means the server process dies.

In particular, it can be triggered by making a request for a
non-existent file in the root of a virtual host if the path matches
the `cgi` pattern.

Thanks cage for helping in debugging!
2021-09-24 10:48:51 +00:00
Omar Polo 3e0164f4c3 use certs from regress/ 2021-07-19 11:37:01 +00:00
Omar Polo 735336b21e unbreak configless mode
An un-initialized field in the configless code path leads to a crash
on the first request.
2021-07-19 11:15:44 +00:00
Omar Polo a82d4dfa25 provide a fallback value for SKIP_RUNTIME_TESTS
some [ implementation will warn about "bad number"
2021-07-10 09:09:26 +00:00
Omar Polo d19951cf03 rename `mime MIME EXT' to `map MIME to-ext EXT'
With the newish automatic string concatenation, options like `mime'
that accepts two strings as parameter start to become ambiguous: which
strings gets concatenated?  Instead of trying to document in the
manpage which argument(s) is subject to string concatenation, do the
concat always and introduce a separator.  In the case of mime,
`to-ext' now acts as a separator to distinguish.  While there, also
use a new keyword because it sounds better.

It's dead-easy to upgrade to the new configuration, possibly with some
sed magic, but for the moment the old `mime' form is preserved: (with
a warning!)  Will be dropped in the next release.
2021-07-09 08:30:55 +02:00