Skip to content

Commit

Permalink
Transition from ports.json to listen.json
Browse files Browse the repository at this point in the history
This commit changes the name of the ports.json file to listen.json. The rationale for this change is that IP addresses for Aluminum to use may also be specified in the file; hence, the term "listening address" is more suitable than "port." The documentation for the ports.json file has also been updated to use the new filename. Additionally, a warning that Wire does not yet include HTTPS support has been added below the description of `listenAddresses.wirePorts.HTTPS`.

This change is backwards-incompatible.
  • Loading branch information
ZelnickB committed Sep 3, 2020
1 parent 124f729 commit 63ae54d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 25 deletions.
6 changes: 6 additions & 0 deletions defaults/prefs/listen.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"wire": {
"HTTP": "80",
"HTTPS": "443"
}
}
6 changes: 0 additions & 6 deletions defaults/prefs/ports.json

This file was deleted.

19 changes: 19 additions & 0 deletions docs/general/listen-json.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
********************
The listen.json file
********************

The ``listen.json`` file, located at ``/usr/prefs/listen.json`` determines which listening addresses Aluminum uses for different features. The file contains a single ``listenAddresses`` object, described below.

A default configuration of ``listen.json`` is located at ``/defaults/prefs/listen.json``.

.. json:object:: listenAddresses
:property wire: Listening address for Aluminum Wire
:proptype wire: :json:object:`wirePorts`

.. json:object:: wirePorts
:property String HTTP: Port to use for Aluminum Wire over HTTP
:property String HTTPS: Port to use for Aluminum Wire over HTTPS

.. warning:: Wire does not yet support HTTPS.
17 changes: 0 additions & 17 deletions docs/general/ports.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Aluminum is controlled by configuration files written in JSON. These files are i
:numbered:
:hidden:

general/ports
general/listen-json


Features
Expand Down
2 changes: 1 addition & 1 deletion src/wire/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const os = require('os') // For retrieving operating system information (for err
const path = require('path') // For manipulating request paths
const mimeTypes = require('mime-types') // For sending the correct Content-Type HTTP header

const ports = JSON.parse(fs.readFileSync('../../usr/prefs/ports.json', 'utf8')).wire
const ports = JSON.parse(fs.readFileSync('../../usr/prefs/listen.json', 'utf8')).wire
const errorPage = fs.readFileSync('../../defaults/errors/404.html', 'utf8') // Default error page content
const logo = fs.readFileSync('../../logo.svg', 'utf8')

Expand Down

0 comments on commit 63ae54d

Please sign in to comment.