aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-07-09typoOmar Polo
2021-07-09sync readme.md with sandbox.cOmar Polo
2021-07-09`param' is forbidden inside `location's tooOmar Polo
and while there sort the list of disallowed rules.
2021-07-09misc improvements to the manualOmar Polo
2021-07-09change (again) the env/param separator: use '='Omar Polo
Given that env/param are new features of this release, no support for the "old" syntax is needed.
2021-07-09add => in env/param and `port' between hostname and port for fastcgiOmar Polo
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-09typo...Omar Polo
2021-07-09rename `mime MIME EXT' to `map MIME to-ext EXT'Omar Polo
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-09use bsearch to match the keywordsOmar Polo
not that it's a bottleneck, but it's fancier this way.
2021-07-08provide a means to skip the runtime testsOmar Polo
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-08replace add_{cflags,ldflags} with add_libraryAnna “CyberTailor”
2021-07-08check freedesktop's libbsdAnna “CyberTailor”
2021-07-08regress/Makefile: add missing LDFLAGSAnna “CyberTailor”
2021-07-08PF_UNIX is not a valid protocol for socketpairOmar Polo
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-08don't leak a file descriptorOmar Polo
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-07style(9)-ifyOmar Polo
2021-07-07always append -W flags to CFLAGSOmar Polo
2021-07-07initialize the logger earlyOmar Polo
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-07refactor add_{cflags,ldflags}Omar Polo
2021-07-07add --enable-sandboxOmar Polo
patch from Anna "CyberTailor" It's handy for helpers like ebuild's use_enable. (the sandbox is still always enabled by default)
2021-07-07check libimsg tooOmar Polo
patch from Anna "CyberTailor"
2021-07-07always append LDFLAGS and CFLAGSOmar Polo
Initial patch from Anna "CyberTailor", tweaked by me (drop guessing_* and always append CFLAGS)
2021-07-06add -T timeout to gg; don't let the regress test hangOmar Polo
2021-07-06try to preserve as much as possible CFLAGS and LDFLAGS from envOmar Polo
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-06explain the OpenBSD bitOmar Polo
2021-07-06don't log too much by defaultOmar Polo
2021-07-06test macro expansion tooOmar Polo
2021-07-06show macro usage in the exampleOmar Polo
2021-07-06fmtOmar Polo
2021-07-06fmtOmar Polo
2021-07-06gracefully shut down fastcgi backendsOmar Polo
we need to delete the events associated with the backends, otherwise the server process won't ever quit. Here, we add a pending counter to every backend and shut down immediately if they aren't handling any client; otherwise we try to close them as soon as possible (i.e. when they close the connection to the last connected client.)
2021-07-06don't let CGI scripts inherit our stderrOmar Polo
our stderr could have been sent to the logger process, so it may be invalid. Furthermore, in the future we may want to capture also the stderr of the processes.
2021-07-06reset fcgi array in free_configOmar Polo
otherwise path, port and/or prog could become an invalid pointer.
2021-07-03typoOmar Polo
2021-07-03fix seccomp filter for ppc64leOmar Polo
before we matched ppc64le as ppc64 (which is big ending I presume), so the seccomp filter would always kill gmid #4 related
2021-07-03use -subj /CN=name when generating the keys for the testsOmar Polo
`printf | openssl` is ugly :/
2021-07-02configure: add --disable-sandboxOmar Polo
Calling `configure' with --disable-sandbox will disable the sandbox support *completely* at compile time. gmid will still complain at compile time and during the startup. Users shouldn't disable the sandbox if possible, but instead report problem upstream so they get fixed (hopefully.) #4 related
2021-07-02reworked seccomp filterOmar Polo
* SECCOMP_AUDIT_ARCH extended to support more architectures * relax fcntl policy: allow the syscall regardless of the flags * wrap every syscall in a ifdef, and add some (statx, fcntl64, ...) used in x86 Some bits were taken from dhcpcd[0], thanks! #4 related [0]: https://roy.marples.name/git/dhcpcd/blob/HEAD:/src/privsep-linux.c
2021-07-02revert 2c16dbd5486 -- macro names can't be reserved wordsOmar Polo
While one can define a macro using a reserved word as name using -Dname=val, inside the configuration file it'll fail.
2021-06-29macro names can be reserved wordsOmar Polo
2021-06-29fix macro exampleOmar Polo
2021-06-29document the c-like handling of stringsOmar Polo
2021-06-29don't expand macros inside the quotesOmar Polo
Now that we have this auto concat string thingy, macros can simply expand to standalone strings in place, as single words. Forgot to point it out in previous commits, but now we can cert = "/etc/keys" server "foo" { cert $cert "/foo.crt" ... }
2021-06-29alignOmar Polo
2021-06-29[config] concat two or more strings next to each othersOmar Polo
2021-06-29document macros: both -D and syntaxOmar Polo
2021-06-29don't require the strict order macro > options > serversOmar Polo
2021-06-29add -D to define macros from the cmd lineOmar Polo
2021-06-29allow to define macros in the config fileOmar Polo
Macros can be defined at the top of the configuration file: dir = "/var/gemini" cert = "/etc/keys" and re-used later, for example server "foo" { root "$dir/foo" # -> /var/gemini/foo cert "$cert/foo.pem" # -> /etc/keys/foo.pem }
2021-06-29trailing whitespacesOmar Polo