blob: d7e2e12aa6331b14655f151ffa73bd15a07ba7cf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#!/bin/sh
set -e
printf "20 text/plain; lang=en\r\n"
cat <<EOF
The Common Gateway Interface for Gemini
It really seems that the Common Gateway Interface (CGI, RFC-3875)
can be adapted for the Gemini protocol easily!
This is a test page for the CGI implementation in gmid[0], a small
and secure Gemini server. When in doubt, I'm trying to follow the
GLV-1.12556[1] behaviour. Sean Conner provides a similar page at [2].
CGI Environment Variables
<unspec> means "not set".
EOF
echo GATEWAY_INTERFACE=$GATEWAY_INTERFACE
echo GEMINI_DOCUMENT_ROOT=$GEMINI_DOCUMENT_ROOT
echo GEMINI_SCRIPT_FILENAME=$GEMINI_SCRIPT_FILENAME
echo GEMINI_URL=$GEMINI_URL
echo GEMINI_URL_PATH=$GEMINI_URL_PATH
echo PWD=$PWD
echo PATH_INFO=${PATH_INFO:-"<unspec>"}
echo PATH_TRANSLATED=${PATH_TRANSLATED:-"<unspec>"}
echo QUERY_STRING=$QUERY_STRING
echo REMOTE_ADDR=$REMOTE_ADDR
echo REMOTE_HOST=$REMOTE_HOST
echo REQUEST_METHOD=$REQUEST_METHOD
echo SCRIPT_NAME=$SCRIPT_NAME
echo SERVER_NAME=$SERVER_NAME
echo SERVER_PORT=$SERVER_PORT
echo SERVER_PROTOCOL=$SERVER_PROTOCOL
echo SERVER_SOFTWARE=$SERVER_SOFTWARE
echo AUTH_TYPE=$AUTH_TYPE
echo REMOTE_USER=$REMOTE_USER
echo TLS_CLIENT_ISSUER=$TLS_CLIENT_ISSUER
echo TLS_CLIENT_HASH=$TLS_CLIENT_HASH
echo TLS_CLIENT_NOT_AFTER=$TLS_CLIENT_NOT_AFTER
echo TLS_CLIENT_NOT_BEFORE=$TLS_CLIENT_NOT_BEFORE
echo
echo
echo " CGI Argument List"
echo
echo "- $0"
for i in "$@"; do
echo "- $i"
done
cat <<EOF
notes
[0]: https://github.com/omar-polo/gmid
[1]: https://github.com/spc476/GLV-1.12556
[2]: gemini://gemini.conman.org/cgi
EOF
|