tweaked the readme a bit

This commit is contained in:
Omar Polo 2021-04-29 19:46:51 +00:00
parent d06d6f4bba
commit 08ce6f5273
1 changed files with 38 additions and 25 deletions

View File

@ -9,23 +9,18 @@ featureful server.
(random order) (random order)
- sandboxed by default on OpenBSD, Linux and FreeBSD
- reconfiguration: reload the running configuration without - reconfiguration: reload the running configuration without
interruption interruption
- sandboxed by default on OpenBSD, Linux and FreeBSD
- automatic redirect/error pages (see `block return`) - automatic redirect/error pages (see `block return`)
- IRI support (RFC3987) - IRI support (RFC3987)
- punycode support
- dual stack (IPv4 and IPv6)
- automatic certificate generation for config-less mode - automatic certificate generation for config-less mode
- CGI scripts - CGI scripts
- low memory footprint
- event-based asynchronous I/O model
- small codebase, easily hackable
- virtual hosts - virtual hosts
- per-location rules - location rules
- optional directory listings - event-based asynchronous I/O model
- configurable mime types - low memory footprint
- chroot support - small codebase, easily hackable
## Internationalisation (IRIs, UNICODE, punycode, all that stuff) ## Internationalisation (IRIs, UNICODE, punycode, all that stuff)
@ -50,28 +45,46 @@ doesn't do that (yet).
## Configuration ## Configuration
gmid has a rich configuration file, heavily inspired by OpenBSD' gmid has a rich configuration file, heavily inspired by OpenBSD'
httpd. While you should definitely check the manpage because it httpd, with every detail carefully documented in the manpage. Here's
documents every option in depth, here's a small example of how a a minimal example of a config file:
configuration file looks like.
```conf
server "example.com" {
cert "/path/to/cert.pem"
key "/path/to/key.pem"
root "/var/gemini/example.com"
}
```
and a slightly complex one
```conf ```conf
ipv6 on # enable ipv6 ipv6 on # enable ipv6
server "example.com" { server "example.com" {
cert "/path/to/cert.pem" alias "foobar.com"
key "/path/to/key.pem"
root "/var/gemini/example.com"
lang "it"
cgi "/cgi/*"
location "/files/*" { cert "/path/to/cert.pem"
auto index on key "/path/to/key.pem"
} root "/var/gemini/example.com"
location "/repo/*" { # lang for text/gemini files
# change the index file name lang "it"
index "README.gmi"
} # execute CGI scripts in /cgi/
cgi "/cgi/*"
# only for locations that matches /files/*
location "/files/*" {
# generate directory listings
auto index on
}
location "/repo/*" {
# change the index file name
index "README.gmi"
lang "en"
}
} }
``` ```