Add note about LetsEncrypt to webserver docs

This commit is contained in:
David Stephens 2017-10-29 12:50:25 +00:00
parent 6c4745ee22
commit 7f18f3d614
1 changed files with 13 additions and 5 deletions

View File

@ -1,8 +1,10 @@
# Web Server # Web Server
ENiGMA½ comes with a built in *content server* for supporting both HTTP and HTTPS. Currently the [File Bases](file_base.md) registers routes for file downloads, and static files can also be served for your BBS. Other features will likely come in the future or you can easily write your own! ENiGMA½ comes with a built in *content server* for supporting both HTTP and HTTPS. Currently the
[File Bases](file_base.md) registers routes for file downloads, and static files can also be served for your BBS. Other features will likely come in the future or you can easily write your own!
## Configuration ## Configuration
By default the web server is not enabled. To enable it, you will need to at a minimum configure two keys in the `contentServers::web` section of `config.hjson`: By default the web server is not enabled. To enable it, you will need to at a minimum configure two keys in
the `contentServers::web` section of `config.hjson`:
```hjson ```hjson
contentServers: { contentServers: {
@ -16,7 +18,12 @@ contentServers: {
} }
``` ```
This will configure HTTP for port 8080 (override with `port`). To additionally enable HTTPS, you will need a PEM encoded SSL certificate and private key. Once obtained, simply enable the HTTPS server: This will configure HTTP for port 8080 (override with `port`). To additionally enable HTTPS, you will need a
PEM encoded SSL certificate and private key. [LetsEncrypt](https://letsencrypt.org/) supply free trusted
certificates that work perfectly with ENiGMA½.
Once obtained, simply enable the HTTPS server:
```hjson ```hjson
contentServers: { contentServers: {
web: { web: {
@ -37,4 +44,5 @@ contentServers: {
Static files live relative to the `contentServers::web::staticRoot` path which defaults to `enigma-bbs/www`. Static files live relative to the `contentServers::web::staticRoot` path which defaults to `enigma-bbs/www`.
### Custom Error Pages ### Custom Error Pages
Customized error pages can be created for [HTTP error codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error) by providing a `<error_code>.html` file in the *static routes* area. For example: `404.html`. Customized error pages can be created for [HTTP error codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_Error)
by providing a `<error_code>.html` file in the *static routes* area. For example: `404.html`.