~ysu/gemini-chatroom

ref: 91028756563599c78745ae4d5447ab09b88a7403 gemini-chatroom/bin/cgi.sh -rwxr-xr-x 808 bytes
91028756 — vps rewrote in c 6 months ago
                                                                                
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
65
66
#!/bin/sh

if [ "$QUERY_STRING" = "cert" ] && [ -z "$TLS_CLIENT_HASH" ]; then
    echo "60 Please supply a client certificate
"
    exit 0
fi

echo "20 text/gemini
"

cat <<EOF
# CGI Example

General variables:

* DOCUMENT_ROOT
  $DOCUMENT_ROOT

* GATEWAY_INTERFACE
  $GATEWAY_INTERFACE

* PATH_INFO
  $PATH_INFO

* PATH_TRANSLATED
  $PATH_TRANSLATED

* QUERY_STRING
  $QUERY_STRING

* SCRIPT_NAME
  $SCRIPT_NAME

* SERVER_NAME
  $SERVER_NAME

* SERVER_PROTOCOL
  $SERVER_PROTOCOL

* SERVER_SOFTWARE
  $SERVER_SOFTWARE

Gemini specific:

* GEMINI_URL
  $GEMINI_URL

EOF

if [ -z "$TLS_CLIENT_HASH" ]; then
    echo "=> /$SCRIPT_NAME?cert Request a client certificate"
else
    cat <<EOF
Client certificate:

* AUTH_TYPE
  $AUTH_TYPE

* REMOTE_USER
  $REMOTE_USER

* TLS_CLIENT_HASH
  $TLS_CLIENT_HASH
EOF
fi