Updating section on CGI
This commit is contained in:
parent
626c4916dd
commit
feb388220a
42
README.md
42
README.md
|
@ -66,12 +66,12 @@ optional arguments:
|
||||||
page (default: index.gmi)
|
page (default: index.gmi)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Hostname
|
### Setting the ``hostname``
|
||||||
|
|
||||||
Because the gemini protocol sends the whole URL in the request, it's necessary
|
Because the gemini protocol sends the whole URL in the request, it's necessary
|
||||||
to declare the hostname that your server is expecting to receive traffic under.
|
to declare the hostname that your server is expecting to receive traffic under.
|
||||||
Jetforce will reject any request that doesn't match your hostname with a status
|
Jetforce will reject any request that doesn't match your hostname with a status
|
||||||
of ``Proxy Request Refused``.
|
of ``50 PERMENANT FAILURE``.
|
||||||
|
|
||||||
### TLS Certificates
|
### TLS Certificates
|
||||||
|
|
||||||
|
@ -116,21 +116,35 @@ Jetforce will serve static files in the ``/var/gemini/`` directory:
|
||||||
|
|
||||||
### CGI Scripts
|
### CGI Scripts
|
||||||
|
|
||||||
Jetforce implements a slightly modified version of the official CGI
|
Jetforce implements a simplified version of the CGI specification. It doesn't
|
||||||
specification. Because Gemini is a less complex than HTTP, the CGI interface is
|
conform to the CGI [RFC 3875](https://tools.ietf.org/html/rfc3875)
|
||||||
also inherently easier and more straightforward to use.
|
specification, but it gets the job done for Gemini.
|
||||||
|
|
||||||
The main difference in jetforce's implementation is that the CGI script is
|
Any executable file placed in the server's ``cgi-bin/`` directory will be
|
||||||
expected to write the entire gemini response *verbatim* to stdout:
|
considered a CGI script. When a CGI script is requested by a gemini client,
|
||||||
|
the jetforce server will execute the script and pass in information about the
|
||||||
|
request using environment variables:
|
||||||
|
|
||||||
1. The status code and meta on the first line
|
| Environment Variable | Example Value |
|
||||||
2. The optional response body on subsequent lines
|
| --- | --- |
|
||||||
|
| GATEWAY_INTERFACE | GCI/1.1 |
|
||||||
|
| GEMINI_URL | gemini://mozz.us/cgi-bin/debug.cgi?foobar
|
||||||
|
| HOSTNAME | mozz.us |
|
||||||
|
| PATH_INFO | /cgi-bin/debug.cgi |
|
||||||
|
| QUERY_STRING | foobar |
|
||||||
|
| REMOTE_ADDR | 10.10.0.2 |
|
||||||
|
| REMOTE_HOST | 10.10.0.2 |
|
||||||
|
| SCRIPT_NAME | /usr/local/www/mozz/gemini/cgi-bin/debug.cgi |
|
||||||
|
| SERVER_NAME | mozz.us |
|
||||||
|
| SERVER_PORT | 1965 |
|
||||||
|
| SERVER_PROTOCOL | GEMINI |
|
||||||
|
| SERVER_SOFTWARE | jetforce/0.0.7 |
|
||||||
|
|
||||||
The script is not allowed to respond with HTTP headers like ``Content-Type``,
|
The CGI script must then write the entire gemini response to the standard
|
||||||
or any other special CGI headers like internal file redirects.
|
output stream. This includes the status code and meta string on the first
|
||||||
|
line, and the optional response body on subsequent lines. The CGI script should
|
||||||
Some of the HTTP specific environment variables like ``REQUEST_METHOD`` are not
|
not attempt to output the special header lines that are defined in the CGI
|
||||||
used, because they don't make sense in the context of a Gemini request.
|
specification and geared towards HTTP servers.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue