From 94b1c6a5ee257dbd7d2a0cdd757719dfea7e6eae Mon Sep 17 00:00:00 2001 From: bordun Date: Sun, 8 Nov 2020 17:29:45 +0100 Subject: [PATCH] custom-module: document settings.appAddresses; restrict setting object access --- resources/docs/docs/custom-module/custom-module.md | 6 ++++++ src/server/custom-module.js | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/resources/docs/docs/custom-module/custom-module.md b/resources/docs/docs/custom-module/custom-module.md index 40e2b465..f36dcb0c 100644 --- a/resources/docs/docs/custom-module/custom-module.md +++ b/resources/docs/docs/custom-module/custom-module.md @@ -81,6 +81,12 @@ Returns specified server option. `name` must be the option's long name without t ---- +#### `settings.appAddresses()` + +Returns the server's http addresses. + +---- + #### `options` `Array` containing the extra options passed to `--custom-module` after the filename diff --git a/src/server/custom-module.js b/src/server/custom-module.js index 86b7f6f1..982fb8b3 100644 --- a/src/server/custom-module.js +++ b/src/server/custom-module.js @@ -52,7 +52,10 @@ class CustomModule { } }, console: console, - settings: settings, + settings: { + read: settings.read, + appAddresses: settings.appAddresses, + }, setTimeout: this.setTimeout.bind(this), clearTimeout: this.clearTimeout.bind(this), setInterval: this.setInterval.bind(this),