Commit Graph

590 Commits

Author SHA1 Message Date
Omar Polo 3b0eff06ff fix the dockerfile 2021-07-11 20:58:42 +00:00
Omar Polo 02ccd9d940 move the Dockerfile to contrib/ 2021-07-11 18:43:24 +00:00
Omar Polo e8b8003098 add an example systemd unit file 2021-07-11 15:44:44 +00:00
Omar Polo e2d3a8f222 add missing `env' keyword 2021-07-11 14:49:20 +00:00
Anna “CyberTailor” 1a115616cb add simple vim syntax file 2021-07-11 14:27:31 +02:00
Omar Polo 8068d2ff33 tag v1.7.1
This version includes two bugfixes:

 - use ${MAKE} to recursively call make
 - fix the misleading example in the man page: macros name may not be
 reserved words

Both bugs found and fixed by Anna “CyberTailor”, thanks!
2021-07-11 09:50:26 +02:00
Omar Polo 094bdacd40 sync 2021-07-11 09:48:29 +02:00
Omar Polo ad15003be8 align 2021-07-11 09:47:19 +02:00
Anna “CyberTailor” 2d06ae62ae fix misleading example in man page
> Macros names may not be reserved words
2021-07-11 09:23:56 +02:00
Anna “CyberTailor” 8518014cb9 fix "warning: jobserver unavailable: using -j1"
https://www.gnu.org/software/make/manual/html_node/Error-Messages.html
2021-07-11 09:23:53 +02:00
Omar Polo b79b2d811b tag v1.7 2021-07-10 09:22:19 +00:00
Omar Polo f361f79979 move version number to configure script 2021-07-10 09:19: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 9f075bd689 sync 2021-07-09 13:36:22 +00:00
Omar Polo 391825e360 move parse_portno to gmid.c
it's used only to parse the -p flag.  While there add check_port_num
to check the range for the port.
2021-07-09 13:06:58 +00:00
Omar Polo e3b2a0f8de missing newline in deprecation notice 2021-07-09 12:57:58 +00:00
Omar Polo 1bd706dc41 drop unsigned
it causes a cascade of warnings on some architectures.  Also, for what
we're doing here, the signed/unsigned property isn't important.
2021-07-09 12:56:59 +00:00
Omar Polo 528f37cd2d sync macro usage and mention the `include' keyword 2021-07-09 12:50:24 +00:00
Omar Polo 67f494057a @-macros, rollback changes to strings and optional semicolons
* expand $-macros as string, only the new @-macros get expanded as-is
* rollback changes to characters allowed in bare strings
* optional semicolons in optnl, useful for readable @-macros
2021-07-09 12:49:15 +00:00
Omar Polo c39be742cf parsing: bring lots of goodies from OpenBSD' parse.y
This allows to solve the problem with the \n in the grammar (before
two following macro declaration were treated as invalid.  This also
brings in a nice `include' keyword.
2021-07-09 11:25:25 +00:00
Omar Polo a5d822e542 typo 2021-07-09 08:12:05 +00:00
Omar Polo be52e954c1 sync readme.md with sandbox.c 2021-07-09 08:11:57 +00:00
Omar Polo 3d132b2833 `param' is forbidden inside `location's too
and while there sort the list of disallowed rules.
2021-07-09 08:04:12 +00:00
Omar Polo 2b520ad595 misc improvements to the manual 2021-07-09 08:01:22 +00:00
Omar Polo efacb859a7 change (again) the env/param separator: use '='
Given that env/param are new features of this release, no support for
the "old" syntax is needed.
2021-07-09 07:27:15 +00:00
Omar Polo 762b9b991f add => in env/param and `port' between hostname and port for fastcgi
In the same spite of the last commit, add the missing separators
between strings to avoid the auto-concat pitfalls.  `=>' is used to
separate between `env' and `param' arguments, while for `fastcgi' the
keyword `port' is required between the hostname/ip address and the
port (if provided).

Since `env', `param' and `fastcgi' are all new stuff, there's no need
to keep compatibility.
2021-07-09 08:30:55 +02:00
Omar Polo ff954a3e76 typo... 2021-07-09 08:30:55 +02: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
Omar Polo d93c819182 use bsearch to match the keywords
not that it's a bottleneck, but it's fancier this way.
2021-07-09 08:30:55 +02:00
Omar Polo bffa7daab8 provide a means to skip the runtime tests
Setting the environment variable SKIP_RUNTIME_TESTS to 1 will prevent
the runtime tests.  This is useful when running the tests inside a
sandbox.

based on a similar diff by Anna "CyberTailor"
2021-07-08 17:13:17 +02:00
Anna “CyberTailor” 8c9b8f487e replace add_{cflags,ldflags} with add_library 2021-07-08 16:56:29 +02:00
Anna “CyberTailor” 9c84a04f9c check freedesktop's libbsd 2021-07-08 16:55:58 +02:00
Anna “CyberTailor” 9797799ad4 regress/Makefile: add missing LDFLAGS 2021-07-08 16:55:08 +02:00
Omar Polo 2e2e189b01 PF_UNIX is not a valid protocol for socketpair
OpenBSD accept it, but FreeBSD disallows it.  PF_UNSPEC (or 0) should
be used instead.  The FastCGI bit in the regress suite still doesn't
work on FreeBSD, but at least now it starts.
2021-07-08 10:09:24 +00:00
Omar Polo e7c6502bf3 don't leak a file descriptor
make sure we always close every fd in every possible code path; while
there, also add a log_err if fork(2) failed.
2021-07-08 09:40:23 +00:00
Omar Polo a8a1f43921 style(9)-ify 2021-07-07 09:46:37 +00:00
Omar Polo 68ef117092 always append -W flags to CFLAGS 2021-07-07 09:19:24 +00:00
Omar Polo 8a50fc0330 initialize the logger early
Initialize the logger as soon as possible and log by default to
stderr.  With this, some (common?) errors are printed early instead of
ending up in syslog.

	# NB: this is in configless mode
	% ./gmid -p 80
	[2021-07-07 11:05:57] bind: Address already in use
	% ./gmid -p 81
	[2021-07-07 11:13:53] bind: Permission denied
	%
2021-07-07 09:18:24 +00:00
Omar Polo d336aeafd4 refactor add_{cflags,ldflags} 2021-07-07 08:46:23 +00:00
Omar Polo 489e1655a0 add --enable-sandbox
patch from Anna "CyberTailor"

It's handy for helpers like ebuild's use_enable.

(the sandbox is still always enabled by default)
2021-07-07 08:43:33 +00:00
Omar Polo 1a572d4221 check libimsg too
patch from Anna "CyberTailor"
2021-07-07 08:41:27 +00:00
Omar Polo af15474448 always append LDFLAGS and CFLAGS
Initial patch from Anna "CyberTailor", tweaked by me (drop guessing_*
and always append CFLAGS)
2021-07-07 08:38:19 +00:00
Omar Polo 321341f6c0 add -T timeout to gg; don't let the regress test hang 2021-07-06 13:09:24 +00:00
Omar Polo 6edcfca97f try to preserve as much as possible CFLAGS and LDFLAGS from env
but still try to autodetect with pkg-config if they aren't provided.

Passing CFLAGS/LDFLAGS from the command line will still override the
guessed ones.
2021-07-06 13:01:11 +00:00
Omar Polo eb877bffaa explain the OpenBSD bit 2021-07-06 12:18:53 +00:00
Omar Polo ca3f67564c don't log too much by default 2021-07-06 11:53:24 +00:00
Omar Polo fb4102a5ff test macro expansion too 2021-07-06 11:52:28 +00:00
Omar Polo 3759d3eb56 show macro usage in the example 2021-07-06 11:41:24 +00:00
Omar Polo 7700ab07d3 fmt 2021-07-06 10:56:13 +00:00
Omar Polo 59c7ee13b4 fmt 2021-07-06 10:56:01 +00:00