From 38a195c6e62dfebed3c0c642ec9e3fcc89516097 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Tue, 10 Oct 2023 14:49:08 -0600 Subject: "cmd" modifier to override CGI executable fixes #6 --- example.conf | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'example.conf') diff --git a/example.conf b/example.conf index 6181fcf..18f58f7 100644 --- a/example.conf +++ b/example.conf @@ -86,7 +86,14 @@ gemini 0.0.0.0:1965 { # "static" and "cgi" directives work much like in gopher servers. # There is no "extendedgophermap" modifier in gemini, however. static /var/gemini/docs at / with dirdefault index.gmi, dirlist, exec - cgi /var/gemini/cgi at /cgi-bin + + # The "cmd" directive modifier can apply to any "cgi" or "static ... with exec" directives. + # It specifies a filesystem path to an executable file, which will be executed in place of the CGI script. + # Even with "cmd" in use, it will only be invoked if the request path points to a world-executable file + # and with the working directory and environment variables of the requested script. + # So generally "cmd" scripts can end with something like "exec $SCRIPT_PATH", perhaps after imposing + # resource limits or some other security sandbox around it first. + cgi /var/gemini/cgi at /cgi-bin with cmd /var/runcgi # The "autoatom" modifier is allowed on directives in a gemini server. # It causes any text/gemini responses to be available as atom at .atom. -- cgit v1.2.3