summaryrefslogtreecommitdiff
path: root/example.conf
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-10-10 14:49:08 -0600
committertjpcc <tjp@ctrl-c.club>2023-10-10 16:51:24 -0600
commit38a195c6e62dfebed3c0c642ec9e3fcc89516097 (patch)
tree699dd50488c8bf948ddc8d16757eeee619a884f5 /example.conf
parent7efb04b5d7b5c5363a8a0d95fce5513cd125ede9 (diff)
"cmd" modifier to override CGI executable
fixes #6
Diffstat (limited to 'example.conf')
-rw-r--r--example.conf9
1 files changed, 8 insertions, 1 deletions
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 <path>.atom.