logo

gemini-space

What lives at gemini://hacktivis.me/ git clone https://hacktivis.me/git/gemini-space.git
commit: e6738b3db544c26f82835493ce796e62df658f1c
parent 0d27ab36210c0daf60ddf8fceb397560fb14da67
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sun, 21 Feb 2021 16:13:44 +0100

server.sh: Add /cgi-bin/ support

Diffstat:

Mserver.sh12+++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/server.sh b/server.sh @@ -36,7 +36,17 @@ then cat "$path" 2>/dev/null elif [ -r "$path" -a -d "$path" ] then - if echo $path | egrep -q '/$' + if echo $path | egrep -q '^/cgi-bin/' + then + if [ -x "$path" -a -f "$path" ] + then + env -i PATH="${GEMDIR}/cgi-bin/" "${a/#\/cgi-bin\//./}" + status="x$?" + else + status="50" + printf '50 File not executable or non-existent\r\n' + fi + elif echo $path | egrep -q '/$' then if [ -r "$path/index.gmi" -a -f "$path/index.gmi" ] then