* Use per-network outbound for NetMail just like EchoMail
* Use BSO style FLO file for NetMail * Some code cleanup
This commit is contained in:
parent
fc40641eeb
commit
11a19d899e
|
@ -2,7 +2,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
// ENiGMA½
|
// ENiGMA½
|
||||||
const miscUtil = require('./misc_util.js');
|
|
||||||
|
|
||||||
// deps
|
// deps
|
||||||
const fs = require('graceful-fs');
|
const fs = require('graceful-fs');
|
||||||
|
@ -32,7 +31,7 @@ function hasMessageConferenceAndArea(config) {
|
||||||
_.forEach(nonInternalConfs, confTag => {
|
_.forEach(nonInternalConfs, confTag => {
|
||||||
if(_.has(config.messageConferences[confTag], 'areas') &&
|
if(_.has(config.messageConferences[confTag], 'areas') &&
|
||||||
Object.keys(config.messageConferences[confTag].areas) > 0)
|
Object.keys(config.messageConferences[confTag].areas) > 0)
|
||||||
{
|
{
|
||||||
result = true;
|
result = true;
|
||||||
return false; // stop iteration
|
return false; // stop iteration
|
||||||
}
|
}
|
||||||
|
@ -67,12 +66,12 @@ function init(configPath, options, cb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return callback(null, configJson);
|
return callback(null, configJson);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function mergeWithDefaultConfig(configJson, callback) {
|
function mergeWithDefaultConfig(configJson, callback) {
|
||||||
|
|
||||||
const mergedConfig = _.mergeWith(
|
const mergedConfig = _.mergeWith(
|
||||||
getDefaultConfig(),
|
getDefaultConfig(),
|
||||||
configJson, (conf1, conf2) => {
|
configJson, (conf1, conf2) => {
|
||||||
// Arrays should always concat
|
// Arrays should always concat
|
||||||
if(_.isArray(conf1)) {
|
if(_.isArray(conf1)) {
|
||||||
|
@ -147,15 +146,13 @@ function getDefaultConfig() {
|
||||||
webMax : 255,
|
webMax : 255,
|
||||||
|
|
||||||
requireActivation : false, // require SysOp activation? false = auto-activate
|
requireActivation : false, // require SysOp activation? false = auto-activate
|
||||||
invalidUsernames : [],
|
|
||||||
|
|
||||||
groups : [ 'users', 'sysops' ], // built in groups
|
groups : [ 'users', 'sysops' ], // built in groups
|
||||||
defaultGroups : [ 'users' ], // default groups new users belong to
|
defaultGroups : [ 'users' ], // default groups new users belong to
|
||||||
|
|
||||||
newUserNames : [ 'new', 'apply' ], // Names reserved for applying
|
newUserNames : [ 'new', 'apply' ], // Names reserved for applying
|
||||||
|
|
||||||
// :TODO: Mystic uses TRASHCAN.DAT for this -- is there a reason to support something like that?
|
badUserNames : [
|
||||||
badUserNames : [
|
|
||||||
'sysop', 'admin', 'administrator', 'root', 'all',
|
'sysop', 'admin', 'administrator', 'root', 'all',
|
||||||
'areamgr', 'filemgr', 'filefix', 'areafix', 'allfix'
|
'areamgr', 'filemgr', 'filefix', 'areafix', 'allfix'
|
||||||
],
|
],
|
||||||
|
@ -187,7 +184,7 @@ function getDefaultConfig() {
|
||||||
|
|
||||||
menus : {
|
menus : {
|
||||||
cls : true, // Clear screen before each menu by default?
|
cls : true, // Clear screen before each menu by default?
|
||||||
},
|
},
|
||||||
|
|
||||||
paths : {
|
paths : {
|
||||||
config : paths.join(__dirname, './../config/'),
|
config : paths.join(__dirname, './../config/'),
|
||||||
|
@ -202,11 +199,11 @@ function getDefaultConfig() {
|
||||||
themes : paths.join(__dirname, './../art/themes/'),
|
themes : paths.join(__dirname, './../art/themes/'),
|
||||||
logs : paths.join(__dirname, './../logs/'), // :TODO: set up based on system, e.g. /var/logs/enigmabbs or such
|
logs : paths.join(__dirname, './../logs/'), // :TODO: set up based on system, e.g. /var/logs/enigmabbs or such
|
||||||
db : paths.join(__dirname, './../db/'),
|
db : paths.join(__dirname, './../db/'),
|
||||||
modsDb : paths.join(__dirname, './../db/mods/'),
|
modsDb : paths.join(__dirname, './../db/mods/'),
|
||||||
dropFiles : paths.join(__dirname, './../dropfiles/'), // + "/node<x>/
|
dropFiles : paths.join(__dirname, './../dropfiles/'), // + "/node<x>/
|
||||||
misc : paths.join(__dirname, './../misc/'),
|
misc : paths.join(__dirname, './../misc/'),
|
||||||
},
|
},
|
||||||
|
|
||||||
loginServers : {
|
loginServers : {
|
||||||
telnet : {
|
telnet : {
|
||||||
port : 8888,
|
port : 8888,
|
||||||
|
@ -219,7 +216,7 @@ function getDefaultConfig() {
|
||||||
|
|
||||||
//
|
//
|
||||||
// Private key in PEM format
|
// Private key in PEM format
|
||||||
//
|
//
|
||||||
// Generating your PK:
|
// Generating your PK:
|
||||||
// > openssl genrsa -des3 -out ./config/ssh_private_key.pem 2048
|
// > openssl genrsa -des3 -out ./config/ssh_private_key.pem 2048
|
||||||
//
|
//
|
||||||
|
@ -248,7 +245,7 @@ function getDefaultConfig() {
|
||||||
resetPassword : {
|
resetPassword : {
|
||||||
//
|
//
|
||||||
// The following templates have these variables available to them:
|
// The following templates have these variables available to them:
|
||||||
//
|
//
|
||||||
// * %BOARDNAME% : Name of BBS
|
// * %BOARDNAME% : Name of BBS
|
||||||
// * %USERNAME% : Username of whom to reset password
|
// * %USERNAME% : Username of whom to reset password
|
||||||
// * %TOKEN% : Reset token
|
// * %TOKEN% : Reset token
|
||||||
|
@ -263,10 +260,10 @@ function getDefaultConfig() {
|
||||||
//
|
//
|
||||||
resetPageTemplate : paths.join(__dirname, './../www/reset_password.template.html'),
|
resetPageTemplate : paths.join(__dirname, './../www/reset_password.template.html'),
|
||||||
},
|
},
|
||||||
|
|
||||||
http : {
|
http : {
|
||||||
enabled : false,
|
enabled : false,
|
||||||
port : 8080,
|
port : 8080,
|
||||||
},
|
},
|
||||||
https : {
|
https : {
|
||||||
enabled : false,
|
enabled : false,
|
||||||
|
@ -283,10 +280,10 @@ function getDefaultConfig() {
|
||||||
},
|
},
|
||||||
Exiftool : {
|
Exiftool : {
|
||||||
cmd : 'exiftool',
|
cmd : 'exiftool',
|
||||||
args : [
|
args : [
|
||||||
'-charset', 'utf8', '{filePath}',
|
'-charset', 'utf8', '{filePath}',
|
||||||
// exclude the following:
|
// exclude the following:
|
||||||
'--directory', '--filepermissions', '--exiftoolversion', '--filename', '--filesize',
|
'--directory', '--filepermissions', '--exiftoolversion', '--filename', '--filesize',
|
||||||
'--filemodifydate', '--fileaccessdate', '--fileinodechangedate', '--createdate', '--modifydate',
|
'--filemodifydate', '--fileaccessdate', '--fileinodechangedate', '--createdate', '--modifydate',
|
||||||
'--metadatadate', '--xmptoolkit'
|
'--metadatadate', '--xmptoolkit'
|
||||||
]
|
]
|
||||||
|
@ -305,7 +302,7 @@ function getDefaultConfig() {
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// :TODO: text/x-ansi -> SAUCE extraction for .ans uploads
|
// :TODO: text/x-ansi -> SAUCE extraction for .ans uploads
|
||||||
// :TODO: textual : bool -- if text, we can view.
|
// :TODO: textual : bool -- if text, we can view.
|
||||||
// :TODO: asText : { cmd, args[] } -> viewable text
|
// :TODO: asText : { cmd, args[] } -> viewable text
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -388,7 +385,7 @@ function getDefaultConfig() {
|
||||||
sig : '526172211a0700',
|
sig : '526172211a0700',
|
||||||
offset : 0,
|
offset : 0,
|
||||||
archiveHandler : 'Rar',
|
archiveHandler : 'Rar',
|
||||||
},
|
},
|
||||||
'application/gzip' : {
|
'application/gzip' : {
|
||||||
desc : 'Gzip Archive',
|
desc : 'Gzip Archive',
|
||||||
sig : '1f8b',
|
sig : '1f8b',
|
||||||
|
@ -400,28 +397,28 @@ function getDefaultConfig() {
|
||||||
desc : 'BZip2 Archive',
|
desc : 'BZip2 Archive',
|
||||||
sig : '425a68',
|
sig : '425a68',
|
||||||
offset : 0,
|
offset : 0,
|
||||||
archiveHandler : '7Zip',
|
archiveHandler : '7Zip',
|
||||||
},
|
},
|
||||||
'application/x-lzh-compressed' : {
|
'application/x-lzh-compressed' : {
|
||||||
desc : 'LHArc Archive',
|
desc : 'LHArc Archive',
|
||||||
sig : '2d6c68',
|
sig : '2d6c68',
|
||||||
offset : 2,
|
offset : 2,
|
||||||
archiveHandler : 'Lha',
|
archiveHandler : 'Lha',
|
||||||
},
|
},
|
||||||
'application/x-7z-compressed' : {
|
'application/x-7z-compressed' : {
|
||||||
desc : '7-Zip Archive',
|
desc : '7-Zip Archive',
|
||||||
sig : '377abcaf271c',
|
sig : '377abcaf271c',
|
||||||
offset : 0,
|
offset : 0,
|
||||||
archiveHandler : '7Zip',
|
archiveHandler : '7Zip',
|
||||||
}
|
}
|
||||||
|
|
||||||
// :TODO: update archives::formats to fall here
|
// :TODO: update archives::formats to fall here
|
||||||
// * archive handler -> archiveHandler (consider archive if archiveHandler present)
|
// * archive handler -> archiveHandler (consider archive if archiveHandler present)
|
||||||
// * sig, offset, ...
|
// * sig, offset, ...
|
||||||
// * mime-db -> exts lookup
|
// * mime-db -> exts lookup
|
||||||
// *
|
// *
|
||||||
},
|
},
|
||||||
|
|
||||||
archives : {
|
archives : {
|
||||||
archivers : {
|
archivers : {
|
||||||
'7Zip' : {
|
'7Zip' : {
|
||||||
|
@ -514,7 +511,7 @@ function getDefaultConfig() {
|
||||||
list : {
|
list : {
|
||||||
cmd : 'tar',
|
cmd : 'tar',
|
||||||
args : [ '-tvf', '{archivePath}' ],
|
args : [ '-tvf', '{archivePath}' ],
|
||||||
entryMatch : '^[drwx\\-]{10}\\s[A-Za-z0-9\\/]+\\s+([0-9]+)\\s[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}\\s[0-9]{2}\\:[0-9]{2}\\s([^\\r\\n]+)$',
|
entryMatch : '^[drwx\\-]{10}\\s[A-Za-z0-9\\/]+\\s+([0-9]+)\\s[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}\\s[0-9]{2}\\:[0-9]{2}\\s([^\\r\\n]+)$',
|
||||||
},
|
},
|
||||||
extract : {
|
extract : {
|
||||||
cmd : 'tar',
|
cmd : 'tar',
|
||||||
|
@ -523,7 +520,7 @@ function getDefaultConfig() {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
fileTransferProtocols : {
|
fileTransferProtocols : {
|
||||||
//
|
//
|
||||||
// See http://www.synchro.net/docs/sexyz.txt for information on SEXYZ
|
// See http://www.synchro.net/docs/sexyz.txt for information on SEXYZ
|
||||||
|
@ -539,7 +536,7 @@ function getDefaultConfig() {
|
||||||
recvCmd : 'sexyz',
|
recvCmd : 'sexyz',
|
||||||
recvArgs : [ '-telnet', '-8', 'rz', '{uploadDir}' ],
|
recvArgs : [ '-telnet', '-8', 'rz', '{uploadDir}' ],
|
||||||
recvArgsNonBatch : [ '-telnet', '-8', 'rz', '{fileName}' ],
|
recvArgsNonBatch : [ '-telnet', '-8', 'rz', '{fileName}' ],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
xmodemSexyz : {
|
xmodemSexyz : {
|
||||||
|
@ -570,7 +567,7 @@ function getDefaultConfig() {
|
||||||
name : 'ZModem 8k',
|
name : 'ZModem 8k',
|
||||||
type : 'external',
|
type : 'external',
|
||||||
sort : 2,
|
sort : 2,
|
||||||
external : {
|
external : {
|
||||||
sendCmd : 'sz', // Avail on Debian/Ubuntu based systems as the package "lrzsz"
|
sendCmd : 'sz', // Avail on Debian/Ubuntu based systems as the package "lrzsz"
|
||||||
sendArgs : [
|
sendArgs : [
|
||||||
// :TODO: try -q
|
// :TODO: try -q
|
||||||
|
@ -581,11 +578,11 @@ function getDefaultConfig() {
|
||||||
'--zmodem', '--binary', '--restricted', '--keep-uppercase', // dumps to CWD which is set to {uploadDir}
|
'--zmodem', '--binary', '--restricted', '--keep-uppercase', // dumps to CWD which is set to {uploadDir}
|
||||||
],
|
],
|
||||||
// :TODO: can we not just use --escape ?
|
// :TODO: can we not just use --escape ?
|
||||||
escapeTelnet : true, // set to true to escape Telnet codes such as IAC
|
escapeTelnet : true, // set to true to escape Telnet codes such as IAC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
messageAreaDefaults : {
|
messageAreaDefaults : {
|
||||||
//
|
//
|
||||||
// The following can be override per-area as well
|
// The following can be override per-area as well
|
||||||
|
@ -594,11 +591,11 @@ function getDefaultConfig() {
|
||||||
maxAgeDays : 0, // 0 = unlimited
|
maxAgeDays : 0, // 0 = unlimited
|
||||||
},
|
},
|
||||||
|
|
||||||
messageConferences : {
|
messageConferences : {
|
||||||
system_internal : {
|
system_internal : {
|
||||||
name : 'System Internal',
|
name : 'System Internal',
|
||||||
desc : 'Built in conference for private messages, bulletins, etc.',
|
desc : 'Built in conference for private messages, bulletins, etc.',
|
||||||
|
|
||||||
areas : {
|
areas : {
|
||||||
private_mail : {
|
private_mail : {
|
||||||
name : 'Private Mail',
|
name : 'Private Mail',
|
||||||
|
@ -612,7 +609,7 @@ function getDefaultConfig() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
scannerTossers : {
|
scannerTossers : {
|
||||||
ftn_bso : {
|
ftn_bso : {
|
||||||
paths : {
|
paths : {
|
||||||
|
@ -620,7 +617,7 @@ function getDefaultConfig() {
|
||||||
inbound : paths.join(__dirname, './../mail/ftn_in/'),
|
inbound : paths.join(__dirname, './../mail/ftn_in/'),
|
||||||
secInbound : paths.join(__dirname, './../mail/ftn_secin/'),
|
secInbound : paths.join(__dirname, './../mail/ftn_secin/'),
|
||||||
reject : paths.join(__dirname, './../mail/reject/'), // bad pkt, bundles, TIC attachments that fail any check, etc.
|
reject : paths.join(__dirname, './../mail/reject/'), // bad pkt, bundles, TIC attachments that fail any check, etc.
|
||||||
outboundNetMail : paths.join(__dirname, './../mail/ftn_netmail_out/'),
|
//outboundNetMail : paths.join(__dirname, './../mail/ftn_netmail_out/'),
|
||||||
// set 'retain' to a valid path to keep good pkt files
|
// set 'retain' to a valid path to keep good pkt files
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -644,7 +641,7 @@ function getDefaultConfig() {
|
||||||
},
|
},
|
||||||
|
|
||||||
fileBase: {
|
fileBase: {
|
||||||
// areas with an explicit |storageDir| will be stored relative to |areaStoragePrefix|:
|
// areas with an explicit |storageDir| will be stored relative to |areaStoragePrefix|:
|
||||||
areaStoragePrefix : paths.join(__dirname, './../file_base/'),
|
areaStoragePrefix : paths.join(__dirname, './../file_base/'),
|
||||||
|
|
||||||
maxDescFileByteSize : 471859, // ~1/4 MB
|
maxDescFileByteSize : 471859, // ~1/4 MB
|
||||||
|
@ -654,12 +651,12 @@ function getDefaultConfig() {
|
||||||
// These are NOT case sensitive
|
// These are NOT case sensitive
|
||||||
// FILE_ID.DIZ - https://en.wikipedia.org/wiki/FILE_ID.DIZ
|
// FILE_ID.DIZ - https://en.wikipedia.org/wiki/FILE_ID.DIZ
|
||||||
// Some groups include a FILE_ID.ANS. We try to use that over FILE_ID.DIZ if available.
|
// Some groups include a FILE_ID.ANS. We try to use that over FILE_ID.DIZ if available.
|
||||||
desc : [
|
desc : [
|
||||||
'^[^/\]*FILE_ID\.ANS$', '^[^/\]*FILE_ID\.DIZ$', '^[^/\]*DESC\.SDI$', '^[^/\]*DESCRIPT\.ION$', '^[^/\]*FILE\.DES$', '^[^/\]*FILE\.SDI$', '^[^/\]*DISK\.ID$'
|
'^[^/\]*FILE_ID\.ANS$', '^[^/\]*FILE_ID\.DIZ$', '^[^/\]*DESC\.SDI$', '^[^/\]*DESCRIPT\.ION$', '^[^/\]*FILE\.DES$', '^[^/\]*FILE\.SDI$', '^[^/\]*DISK\.ID$'
|
||||||
],
|
],
|
||||||
|
|
||||||
// common README filename - https://en.wikipedia.org/wiki/README
|
// common README filename - https://en.wikipedia.org/wiki/README
|
||||||
descLong : [
|
descLong : [
|
||||||
'^[^/\]*\.NFO$', '^[^/\]*README\.1ST$', '^[^/\]*README\.NOW$', '^[^/\]*README\.TXT$', '^[^/\]*READ\.ME$', '^[^/\]*README$', '^[^/\]*README\.md$'
|
'^[^/\]*\.NFO$', '^[^/\]*README\.1ST$', '^[^/\]*README\.NOW$', '^[^/\]*README\.TXT$', '^[^/\]*READ\.ME$', '^[^/\]*README$', '^[^/\]*README\.md$'
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -675,7 +672,7 @@ function getDefaultConfig() {
|
||||||
'\\b[0-3]?[0-9][\\-\\/\\.][0-3]?[0-9][\\-\\/\\.]((?:[1789][0-9]))\\b', // mm-dd-yy, mm/dd/yy, ...
|
'\\b[0-3]?[0-9][\\-\\/\\.][0-3]?[0-9][\\-\\/\\.]((?:[1789][0-9]))\\b', // mm-dd-yy, mm/dd/yy, ...
|
||||||
//'\\b((?:[1-2][0-9][0-9]{2}))[\\-\\/\\.][0-3]?[0-9][\\-\\/\\.][0-3]?[0-9]|[0-3]?[0-9][\\-\\/\\.][0-3]?[0-9][\\-\\/\\.]((?:[0-9]{2})?[0-9]{2})\\b', // yyyy-mm-dd, m/d/yyyy, mm-dd-yyyy, etc.
|
//'\\b((?:[1-2][0-9][0-9]{2}))[\\-\\/\\.][0-3]?[0-9][\\-\\/\\.][0-3]?[0-9]|[0-3]?[0-9][\\-\\/\\.][0-3]?[0-9][\\-\\/\\.]((?:[0-9]{2})?[0-9]{2})\\b', // yyyy-mm-dd, m/d/yyyy, mm-dd-yyyy, etc.
|
||||||
//"\\b('[1789][0-9])\\b", // eslint-disable-line quotes
|
//"\\b('[1789][0-9])\\b", // eslint-disable-line quotes
|
||||||
'\\b[0-3]?[0-9][\\-\\/\\.](?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|january|february|march|april|may|june|july|august|september|october|november|december)[\\-\\/\\.]((?:[0-9]{2})?[0-9]{2})\\b',
|
'\\b[0-3]?[0-9][\\-\\/\\.](?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|january|february|march|april|may|june|july|august|september|october|november|december)[\\-\\/\\.]((?:[0-9]{2})?[0-9]{2})\\b',
|
||||||
'\\b(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|january|february|march|april|may|june|july|august|september|october|november|december),?\\s[0-9]+(?:st|nd|rd|th)?,?\\s((?:[0-9]{2})?[0-9]{2})\\b', // November 29th, 1997
|
'\\b(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec|january|february|march|april|may|june|july|august|september|october|november|december),?\\s[0-9]+(?:st|nd|rd|th)?,?\\s((?:[0-9]{2})?[0-9]{2})\\b', // November 29th, 1997
|
||||||
'\\(((?:19|20)[0-9]{2})\\)', // (19xx) or (20xx) -- with parens -- do this before 19xx 20xx such that this has priority
|
'\\(((?:19|20)[0-9]{2})\\)', // (19xx) or (20xx) -- with parens -- do this before 19xx 20xx such that this has priority
|
||||||
'\\b((?:19|20)[0-9]{2})\\b', // simple 19xx or 20xx with word boundaries
|
'\\b((?:19|20)[0-9]{2})\\b', // simple 19xx or 20xx with word boundaries
|
||||||
|
@ -692,7 +689,7 @@ function getDefaultConfig() {
|
||||||
//
|
//
|
||||||
// File area storage location tag/value pairs.
|
// File area storage location tag/value pairs.
|
||||||
// Non-absolute paths are relative to |areaStoragePrefix|.
|
// Non-absolute paths are relative to |areaStoragePrefix|.
|
||||||
//
|
//
|
||||||
storageTags : {
|
storageTags : {
|
||||||
sys_msg_attach : 'sys_msg_attach',
|
sys_msg_attach : 'sys_msg_attach',
|
||||||
sys_temp_download : 'sys_temp_download',
|
sys_temp_download : 'sys_temp_download',
|
||||||
|
@ -712,20 +709,20 @@ function getDefaultConfig() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
eventScheduler : {
|
eventScheduler : {
|
||||||
|
|
||||||
events : {
|
events : {
|
||||||
trimMessageAreas : {
|
trimMessageAreas : {
|
||||||
// may optionally use [or ]@watch:/path/to/file
|
// may optionally use [or ]@watch:/path/to/file
|
||||||
schedule : 'every 24 hours',
|
schedule : 'every 24 hours',
|
||||||
|
|
||||||
// action:
|
// action:
|
||||||
// - @method:path/to/module.js:theMethodName
|
// - @method:path/to/module.js:theMethodName
|
||||||
// (path is relative to engima base dir)
|
// (path is relative to engima base dir)
|
||||||
//
|
//
|
||||||
// - @execute:/path/to/something/executable.sh
|
// - @execute:/path/to/something/executable.sh
|
||||||
//
|
//
|
||||||
action : '@method:core/message_area.js:trimMessageAreasScheduledEvent',
|
action : '@method:core/message_area.js:trimMessageAreasScheduledEvent',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -739,7 +736,7 @@ function getDefaultConfig() {
|
||||||
action : '@method:core/web_password_reset.js:performMaintenanceTask',
|
action : '@method:core/web_password_reset.js:performMaintenanceTask',
|
||||||
args : [ '24 hours' ] // items older than this will be removed
|
args : [ '24 hours' ] // items older than this will be removed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
misc : {
|
misc : {
|
||||||
|
|
|
@ -893,6 +893,8 @@ function FTNMessageScanTossModule() {
|
||||||
exportOpts.fileCase = config.fileCase || 'lower';
|
exportOpts.fileCase = config.fileCase || 'lower';
|
||||||
exportOpts.network = Config.messageNetworks.ftn.networks[networkName];
|
exportOpts.network = Config.messageNetworks.ftn.networks[networkName];
|
||||||
exportOpts.networkName = networkName;
|
exportOpts.networkName = networkName;
|
||||||
|
exportOpts.outgoingDir = self.getOutgoingEchoMailPacketDir(exportOpts.networkName, exportOpts.destAddress);
|
||||||
|
exportOpts.exportType = self.getExportType(config);
|
||||||
|
|
||||||
if(!exportOpts.network) {
|
if(!exportOpts.network) {
|
||||||
return callback(Errors.DoesNotExist(`No configuration found for network ${networkName}`));
|
return callback(Errors.DoesNotExist(`No configuration found for network ${networkName}`));
|
||||||
|
@ -902,20 +904,33 @@ function FTNMessageScanTossModule() {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function createOutgoingDir(callback) {
|
function createOutgoingDir(callback) {
|
||||||
// ensure outgoing NetMail directory exists
|
// ensure outgoing NetMail directory exists
|
||||||
return fse.mkdirs(Config.scannerTossers.ftn_bso.paths.outboundNetMail, callback);
|
return fse.mkdirs(exportOpts.outgoingDir, callback);
|
||||||
|
//return fse.mkdirs(Config.scannerTossers.ftn_bso.paths.outboundNetMail, callback);
|
||||||
},
|
},
|
||||||
function exportPacket(callback) {
|
function exportPacket(callback) {
|
||||||
return self.exportNetMailMessagePacket(message, exportOpts, callback);
|
return self.exportNetMailMessagePacket(message, exportOpts, callback);
|
||||||
},
|
},
|
||||||
function moveToOutgoing(callback) {
|
function moveToOutgoing(callback) {
|
||||||
const newExt = exportOpts.fileCase === 'lower' ? '.pkt' : '.PKT';
|
const newExt = exportOpts.fileCase === 'lower' ? '.pkt' : '.PKT';
|
||||||
const newPath = paths.join(
|
exportOpts.exportedToPath = paths.join(
|
||||||
Config.scannerTossers.ftn_bso.paths.outboundNetMail,
|
exportOpts.outgoingDir,
|
||||||
|
//Config.scannerTossers.ftn_bso.paths.outboundNetMail,
|
||||||
`${paths.basename(exportOpts.pktFileName, paths.extname(exportOpts.pktFileName))}${newExt}`
|
`${paths.basename(exportOpts.pktFileName, paths.extname(exportOpts.pktFileName))}${newExt}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return fse.move(exportOpts.pktFileName, newPath, callback);
|
return fse.move(exportOpts.pktFileName, exportOpts.exportedToPath, callback);
|
||||||
|
},
|
||||||
|
function prepareFloFile(callback) {
|
||||||
|
const flowFilePath = self.getOutgoingFlowFileName(
|
||||||
|
exportOpts.outgoingDir,
|
||||||
|
exportOpts.destAddress,
|
||||||
|
'ref',
|
||||||
|
exportOpts.exportType,
|
||||||
|
exportOpts.fileCase
|
||||||
|
);
|
||||||
|
|
||||||
|
return self.flowFileAppendRefs(flowFilePath, [ exportOpts.exportedToPath ], '^', callback);
|
||||||
},
|
},
|
||||||
function storeStateFlags0Meta(callback) {
|
function storeStateFlags0Meta(callback) {
|
||||||
return message.persistMetaValue('System', 'state_flags0', Message.StateFlags0.Exported.toString(), callback);
|
return message.persistMetaValue('System', 'state_flags0', Message.StateFlags0.Exported.toString(), callback);
|
||||||
|
|
Loading…
Reference in New Issue