From 4ab08287a256c14f0200552bd2c56d5a9a1c85c7 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Thu, 9 Feb 2017 20:33:49 -0700 Subject: [PATCH] Additional doc/updates --- docs/file_base.md | 22 ++++++++++++++++++---- docs/web_server.md | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 docs/web_server.md diff --git a/docs/file_base.md b/docs/file_base.md index 3a10ed97..c35c0280 100644 --- a/docs/file_base.md +++ b/docs/file_base.md @@ -4,10 +4,11 @@ Starting with version 0.0.4-alpha, ENiGMA½ has support for File Bases! Document ## A Different Appoach ENiGMA½ has strayed away from the old familure setup here and instead takes a more modern approach: * [Gazelle](https://whatcd.github.io/Gazelle/) inspired system for searching & browsing files -* No File Conferences -* File Areas are still around but should generally be used less. Instead, files can have one or more tags. Think things like `dos.retro`, `pc.warez`, `game`, etc. +* No File Conferences (just areas!) +* File Areas are still around but should generally be used less. Instead, files can have one or more tags. Think things like `dos.retro`, `pc.warez`, `games`, etc. * Temporary web (http:// or https://) download links in additional to standard X/Y/Z protocol support * Users can star rate files & search/filter by ratings +* Concept of user defined filters ## Other bells and whistles * A given area can span one to many physical storage locations @@ -17,7 +18,7 @@ ENiGMA½ has strayed away from the old familure setup here and instead takes a m * Duplicates validated by SHA-256 ## Configuration -Like many things in ENiGMA½, configuration of file base(s) is handled via `config.hjson` entries in the `fileBase` section. +Like many things in ENiGMA½, configuration of file base(s) is handled via `config.hjson` -- specifically in the `fileBase` section. ```hjson fileBase: { @@ -33,6 +34,8 @@ fileBase: { } ``` +(Take a look at `core/config.js` for additional keys that may be overridden) + ### Storage tags **Storage Tags** define paths to a physical (file) storage location that can later be referenced in a file *Area* entry. Each entry may be either a fully qualified path or a relative path. Relative paths are relative to the value set by the `areaStoragePrefix` key. Below is an example defining a both a relative and fully qualified path each attached to a storage tag: @@ -71,5 +74,16 @@ To override read and/or write ACS, supply a valid `acs` member. #### Uploads Note that `storageTags` may contain *1:n* storage tag references. **Uploads in a particular area are stored in the first storage tag path**. +## Web Access +Temporary web HTTP(S) URLs can be used to download files using the built in web server. Temporary links expire after `fileBase::web::expireMinutes`. The full URL given to users is built using `contentServers::web::domain` and will default to HTTPS (http://) if enabled with a fallback to HTTP. The end result is users are given a temporary web link that may look something like this: `https://xibalba.l33t.codes:44512/f/h7JK` + +See [Web Server](web_server.md) for more information. + ## oputil -The `oputil.js` +op utilty `file-base` command has tools for managing file bases. See `oputil.js file-base --help`. \ No newline at end of file +The `oputil.js` +op utilty `file-base` command has tools for managing file bases. For example, to import existing files found within **all** storage locations tied to an area: + +```bash +oputil.js file-base --scan some_area +``` + +See `oputil.js file-base --help` for additional information. \ No newline at end of file diff --git a/docs/web_server.md b/docs/web_server.md new file mode 100644 index 00000000..5e28ea95 --- /dev/null +++ b/docs/web_server.md @@ -0,0 +1,39 @@ +# Web Server +ENiGMA½ comes with a built in *content server* for supporting both HTTP and HTTPS. Currently the [File Bases](file_base.md) registeres 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 +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 +contentServers: { + web: { + domain: bbs.yourdomain.com + + http: { + enabled: true + } + } +} +``` + +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: +```hjson +contentServers: { + web: { + domain: bbs.yourdomain.com + + https: { + enabled: true + port: 8443 + certPem: /path/to/your/cert.pem + keyPem: /path/to/your/cert_private_key.pem + } + } +} +``` + +### Static Routes +Static files live relative to the `contentServers::web::staticRoot` path which defaults to `enigma-bbs/www`. + +### 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 `.html` file in the *static routes* area. For example: `404.html`.