From 941e7d0a03b50aa9df96c6584a48d5704c4d79e0 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 14 Nov 2018 19:53:14 -0700 Subject: [PATCH 1/6] Fix ./main.js --version --- core/bbs.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/bbs.js b/core/bbs.js index f3d59200..b4f88296 100644 --- a/core/bbs.js +++ b/core/bbs.js @@ -45,6 +45,10 @@ function printHelpAndExit() { process.exit(); } +function printVersionAndExit() { + console.info(require('../package.json').version); +} + function main() { async.waterfall( [ @@ -52,7 +56,11 @@ function main() { const argv = require('minimist')(process.argv.slice(2)); if(argv.help) { - printHelpAndExit(); + return printHelpAndExit(); + } + + if(argv.version) { + return printVersionAndExit(); } const configOverridePath = argv.config; From ea4fb090e25ff2c1c6543d450e3a2d1aa1ddcf66 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 14 Nov 2018 21:00:21 -0700 Subject: [PATCH 2/6] Better error report from spawn() fail in extractTo() --- core/archive_util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/archive_util.js b/core/archive_util.js index 6a58f935..b10f364f 100644 --- a/core/archive_util.js +++ b/core/archive_util.js @@ -272,7 +272,9 @@ module.exports = class ArchiveUtil { try { proc = pty.spawn(archiver[action].cmd, args, this.getPtyOpts(extractPath)); } catch(e) { - return cb(e); + return cb(Errors.ExternalProcess( + `Error spawning archiver process "${archiver[action].cmd}" with args "${args.join(' ')}": ${e.message}`) + ); } return this.spawnHandler(proc, (haveFileList ? 'Extraction' : 'Decompression'), cb); From b48f3f3d420c130102602ef0fd41c8c3f6c39ba6 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 14 Nov 2018 21:05:48 -0700 Subject: [PATCH 3/6] Better reject/retain notes --- docs/messageareas/message-networks.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/messageareas/message-networks.md b/docs/messageareas/message-networks.md index fec31a08..1c251712 100644 --- a/docs/messageareas/message-networks.md +++ b/docs/messageareas/message-networks.md @@ -72,6 +72,7 @@ Example: | `packetMsgEncoding` | :-1: | Override default `utf8` encoding. | `defaultNetwork` | :-1: | Explicitly set default network (by tag in `messageNetworks.ftn.networks`). If not set, the first found is used. | | `nodes` | :+1: | Per-node settings. Entries (keys) here support wildcards for a portion of the FTN-style address (e.g.: `21:1/*`). `archiveType` may be set to a FTN supported archive extention that the system supports (TODO); if unset, only .PKT files are produced. `encoding` may be set to override `packetMsgEncoding` on a per-node basis. If the node requires a packet password, set `packetPassword` | +| `paths` | :-1: | An optional configuration block that can set a `retain` path and/or a `reject` path. These will be used for archiving processed packets. | Example: ```hjson @@ -85,6 +86,12 @@ scannerTossers: { export: every 15 minutes or @immediate } + // optional + paths: { + reject: /path/to/store/bad/packets/ + retain: /path/to/store/good/packets/ + } + // Override default FTN/BSO packet encoding. Defaults to 'utf8' packetMsgEncoding: utf8 From e4cb93a17c224c0aa9fc2ed5e8238560204e76f1 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 14 Nov 2018 21:24:15 -0700 Subject: [PATCH 4/6] Use better logging for archiver spawn() --- core/archive_util.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/archive_util.js b/core/archive_util.js index b10f364f..8549cd12 100644 --- a/core/archive_util.js +++ b/core/archive_util.js @@ -222,7 +222,9 @@ module.exports = class ArchiveUtil { try { proc = pty.spawn(archiver.compress.cmd, args, this.getPtyOpts()); } catch(e) { - return cb(e); + return cb(Errors.ExternalProcess( + `Error spawning archiver process "${archiver.compress.cmd}" with args "${args.join(' ')}": ${e.message}`) + ); } return this.spawnHandler(proc, 'Compression', cb); @@ -297,7 +299,9 @@ module.exports = class ArchiveUtil { try { proc = pty.spawn(archiver.list.cmd, args, this.getPtyOpts()); } catch(e) { - return cb(e); + return cb(Errors.ExternalProcess( + `Error spawning archiver process "${archiver.list.cmd}" with args "${args.join(' ')}": ${e.message}`) + ); } let output = ''; From 2c6ba680dc0acec2a62ee38fd4262d0274a1d598 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 14 Nov 2018 21:45:20 -0700 Subject: [PATCH 5/6] Fix up FTN/BSO vs Message Network docs a bit more --- docs/messageareas/bso-import-export.md | 85 ++++++++++++++++++++------ docs/messageareas/message-networks.md | 13 +--- 2 files changed, 69 insertions(+), 29 deletions(-) diff --git a/docs/messageareas/bso-import-export.md b/docs/messageareas/bso-import-export.md index 49e533d8..106fd65a 100644 --- a/docs/messageareas/bso-import-export.md +++ b/docs/messageareas/bso-import-export.md @@ -2,24 +2,24 @@ layout: page title: BSO Import / Export --- -The scanner/tosser module `ftn_bso` provides **B**inkley **S**tyle **O**utbound (BSO) import/toss and -scan/export of messages EchoMail and NetMail messages. Configuration is supplied in `config.hjson` -under `scannerTossers::ftn_bso`. +The scanner/tosser module `ftn_bso` provides **B**inkley **S**tyle **O**utbound (BSO) import/toss and scan/export of messages EchoMail and NetMail messages. Configuration is supplied in `config.hjson` under `scannerTossers.ftn_bso`. -| Config Item | Required | Description | -|-------------------------|----------|---------------------------------------------------------------------------------| -| `defaultZone` | :+1: | Sets the default BSO outbound zone -| `defaultNetwork` | :-1: | Sets the default network name from `messageNetworks.ftn.networks`. **Required if more than one network is defined**. -| `paths` | :-1: | Override default paths set by the system. This section may contain `outbound`, `inbound`, and `secInbound`. -| `packetTargetByteSize` | :-1: | Overrides the system *target* packet (.pkt) size of 512000 bytes (512k) -| `bundleTargetByteSize` | :-1: | Overrides the system *target* ArcMail bundle size of 2048000 bytes (2M) -| `schedule` | :+1: | See Scheduling -| `nodes` | :+1: | See Nodes +:information_source: ENiGMA½'s `ftn_bso` module is not a mailer and **makes no attempts** to perfrom packet transport! An external utility such as Binkd is required for this! + +Let's look at some of the basic configuration: + +| Config Item | Required | Description | +|-------------|----------|----------------------------------------------------------| +| `schedule` | :+1: | Sets `import` and `export` schedules. [Later style text parsing](https://bunkat.github.io/later/parsers.html#text) supported. `import` also can utilize a `@watch:` syntax while `export` additionally supports `@immediate`. | +| `packetMsgEncoding` | :-1: | Override default `utf8` encoding. +| `defaultNetwork` | :-1: | Explicitly set default network (by tag in `messageNetworks.ftn.networks`). If not set, the first found is used. | +| `nodes` | :+1: | Per-node settings. Entries (keys) here support wildcards for a portion of the FTN-style address (e.g.: `21:1/*`). `archiveType` may be set to a FTN supported archive extention that the system supports (TODO); if unset, only .PKT files are produced. `encoding` may be set to override `packetMsgEncoding` on a per-node basis. If the node requires a packet password, set `packetPassword` | +| `paths` | :-1: | An optional configuration block that can set a `retain` path and/or a `reject` path. These will be used for archiving processed packets. You may additionally override the default `outbound`, `inbound`, and `secInbound` (secure inbound) *base* paths for packet processing. | +| `packetTargetByteSize` | :-1: | Overrides the system *target* packet (.pkt) size of 512000 bytes (512k) | +| `bundleTargetByteSize` | :-1: | Overrides the system *target* ArcMail bundle size of 2048000 bytes (2M) | ## Scheduling -Schedules can be defined for importing and exporting via `import` and `export` under `schedule`. -Each entry is allowed a "free form" text and/or special indicators for immediate export or watch -file triggers. +Schedules can be defined for importing and exporting via `import` and `export` under `schedule`. Each entry is allowed a "free form" text and/or special indicators for immediate export or watch file triggers. * `@immediate`: A message will be immediately exported if this trigger is defined in a schedule. Only used for `export`. * `@watch:/path/to/file`: This trigger watches the path specified for changes and will trigger an import or export when such events occur. Only used for `import`. @@ -27,7 +27,7 @@ file triggers. See [Later text parsing documentation](http://bunkat.github.io/later/parsers.html#text) for more information. -### Example Configuration +### Example Schedule Configuration ```hjson { @@ -45,8 +45,7 @@ See [Later text parsing documentation](http://bunkat.github.io/later/parsers.htm ## Nodes The `nodes` section defines how to export messages for one or more uplinks. -A node entry starts with a FTN style address (up to 5D) **as a key** in `config.hjson`. This key may -contain wildcard(s) for net/zone/node/point/domain. +A node entry starts with a FTN style address (up to 5D) **as a key** in `config.hjson`. This key may contain wildcard(s) for net/zone/node/point/domain. | Config Item | Required | Description | |------------------|----------|---------------------------------------------------------------------------------| @@ -61,7 +60,7 @@ contain wildcard(s) for net/zone/node/point/domain. scannerTossers: { ftn_bso: { nodes: { - "46:*": { + "21:*": { packetType: 2+ packetPassword: mypass encoding: cp437 @@ -71,4 +70,52 @@ contain wildcard(s) for net/zone/node/point/domain. } } } +``` + +## A More Complete Example +Below is a more complete example showing the sections described above. + +```hjson +scannerTossers: { + ftn_bso: { + schedule: { + // Check every 30m, or whenever the "toss!.now" file is touched (ie: by Binkd) + import: every 30 minutes or @watch:/enigma-bbs/mail/ftn_in/toss!.now + + // Export immediately, but also check every 15m to be sure + export: every 15 minutes or @immediate + } + + // optional + paths: { + reject: /path/to/store/bad/packets/ + retain: /path/to/store/good/packets/ + } + + // Override default FTN/BSO packet encoding. Defaults to 'utf8' + packetMsgEncoding: utf8 + + defaultNetwork: fsxnet + + nodes: { + "21:1/100" : { // May also contain wildcards, ie: "21:1/*" + archiveType: ZIP // By-ext archive type: ZIP, ARJ, ..., optional. + encoding: utf8 // Encoding for exported messages + packetPassword: MUHPA55 // FTN .PKT password, optional + + tic: { + // See TIC docs + } + } + } + + netMail: { + // See NetMail docs + } + + ticAreas: { + // See TIC docs + } + } +} ``` \ No newline at end of file diff --git a/docs/messageareas/message-networks.md b/docs/messageareas/message-networks.md index 1c251712..10904cab 100644 --- a/docs/messageareas/message-networks.md +++ b/docs/messageareas/message-networks.md @@ -9,9 +9,9 @@ ENiGMA½ considers all non-ENiGMA½, non-local messages (and their networks, suc 3. `scannerTossers.`: general configuration for the scanner/tosser (import/export). This is also where we configure per-node settings. ## FTN Networks -FidoNet and FidoNet style (FTN) networks as well as a FTN/BSO scanner/tosser (`ftn_bso` module) are configured via the `messageNetworks.ftn` and `scannerTossers.ftn_bso` blocks in `config.hjson`. +FidoNet and FidoNet style (FTN) networks as well as a [FTN/BSO scanner/tosser](bso-import-export.md) (`ftn_bso` module) are configured via the `messageNetworks.ftn` and `scannerTossers.ftn_bso` blocks in `config.hjson`. -:information_source: ENiGMA½'s `ftn_bso` module is not a mailer and **makes no attempts** to perfrom packet transport! An external utility such as Binkd is required for this +:information_source: ENiGMA½'s `ftn_bso` module is not a mailer and **makes no attempts** to perfrom packet transport! An external utility such as Binkd is required for this! ### Networks The `networks` block a per-network configuration where each entry's key may be referenced elswhere in `config.hjson`. @@ -65,14 +65,7 @@ Example: ``` ### FTN/BSO Scanner Tosser - -| Config Item | Required | Description | -|-------------|----------|----------------------------------------------------------| -| `schedule` | :+1: | Sets `import` and `export` schedules. [Later style text parsing](https://bunkat.github.io/later/parsers.html#text) supported. `import` also can utilize a `@watch:` syntax while `export` additionally supports `@immediate`. | -| `packetMsgEncoding` | :-1: | Override default `utf8` encoding. -| `defaultNetwork` | :-1: | Explicitly set default network (by tag in `messageNetworks.ftn.networks`). If not set, the first found is used. | -| `nodes` | :+1: | Per-node settings. Entries (keys) here support wildcards for a portion of the FTN-style address (e.g.: `21:1/*`). `archiveType` may be set to a FTN supported archive extention that the system supports (TODO); if unset, only .PKT files are produced. `encoding` may be set to override `packetMsgEncoding` on a per-node basis. If the node requires a packet password, set `packetPassword` | -| `paths` | :-1: | An optional configuration block that can set a `retain` path and/or a `reject` path. These will be used for archiving processed packets. | +Please see the [FTN/BSO Scanner/Tosser](bso-import-export.md) documentation for information on this area. Example: ```hjson From c5100d741a8349b0fdd85ccbc4505e11ebfd2110 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Wed, 14 Nov 2018 22:05:05 -0700 Subject: [PATCH 6/6] Del dupe config example --- docs/messageareas/message-networks.md | 46 --------------------------- 1 file changed, 46 deletions(-) diff --git a/docs/messageareas/message-networks.md b/docs/messageareas/message-networks.md index 10904cab..84b7859e 100644 --- a/docs/messageareas/message-networks.md +++ b/docs/messageareas/message-networks.md @@ -66,49 +66,3 @@ Example: ### FTN/BSO Scanner Tosser Please see the [FTN/BSO Scanner/Tosser](bso-import-export.md) documentation for information on this area. - -Example: -```hjson -scannerTossers: { - ftn_bso: { - schedule: { - // Check every 30m, or whenever the "toss!.now" file is touched (ie: by Binkd) - import: every 30 minutes or @watch:/enigma-bbs/mail/ftn_in/toss!.now - - // Export immediately, but also check every 15m to be sure - export: every 15 minutes or @immediate - } - - // optional - paths: { - reject: /path/to/store/bad/packets/ - retain: /path/to/store/good/packets/ - } - - // Override default FTN/BSO packet encoding. Defaults to 'utf8' - packetMsgEncoding: utf8 - - defaultNetwork: fsxnet - - nodes: { - "21:1/100" : { // May also contain wildcards, ie: "21:1/*" - archiveType: ZIP // By-ext archive type: ZIP, ARJ, ..., optional. - encoding: utf8 // Encoding for exported messages - packetPassword: MUHPA55 // FTN .PKT password, optional - - tic: { - // See TIC docs - } - } - } - - netMail: { - // See NetMail docs - } - - ticAreas: { - // See TIC docs - } - } -} -``` \ No newline at end of file