Skip to content
Snippets Groups Projects
Commit 01207d79 authored by rswindell's avatar rswindell
Browse files

Merged binkit.ini and ftn_domains.ini into sbbsecho.ini (for BinkIT 2.0)

(note: some of the key names were changed), run "jsexec binkit upgrade"
to upgrade your existing .ini's (if you have them).
Removed support for sbbsecho.cfg.
parent 5f335d6f
No related branches found
No related tags found
No related merge requests found
/* /*
* Parse as much as needed from the SBBSEcho conifguration. * Parse as much as needed from the SBBSecho configuration.
* v2 uses sbbsecho.cfg and v3 uses sbbsecho.ini. * v3+ uses sbbsecho.ini.
* *
* SBBSEchoCfg Properties: * SBBSEchoCfg Properties:
* inbound non-secure default inbound directory path * inbound non-secure default inbound directory path
* TODO: SBBSEcho supports per-node inbound via fileboxes... a method to get the inbound for a node should exist * TODO: SBBSecho supports per-node inbound via fileboxes... a method to get the inbound for a node should exist
* secure_inbound secure inbound directory path * secure_inbound secure inbound directory path
* TODO: SBBSEcho supports per-node inbound via fileboxes... a method to get the inbound for a node should exist * TODO: SBBSecho supports per-node inbound via fileboxes... a method to get the inbound for a node should exist
* outbound default oubound path, may end with a path separator * outbound default oubound path, may end with a path separator
* TODO: SBBSEcho supports per-node outbound via fileboxes... a method to get the outbound for a node should exist * TODO: SBBSecho supports per-node outbound via fileboxes... a method to get the outbound for a node should exist
* is_flow boolean indicating it is a FLO style mailer... most things will require this to be true * is_flow boolean indicating it is a FLO style mailer... most things will require this to be true
* pktpass{} object with a separate property for each node addres (wildcards included as "ALL"). * pktpass{} object with a separate property for each node addres (wildcards included as "ALL").
* Should be accessed using get_pw() and match_pw() methods. * Should be accessed using get_pw() and match_pw() methods.
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
*/ */
function SBBSEchoCfg () function SBBSEchoCfg ()
{ {
var ecfg = new File(system.ctrl_dir+'sbbsecho.cfg');
var line; var line;
var m; var m;
...@@ -31,8 +30,7 @@ function SBBSEchoCfg () ...@@ -31,8 +30,7 @@ function SBBSEchoCfg ()
this.outbound = undefined; this.outbound = undefined;
var packer = undefined; var packer = undefined;
if (!ecfg.open("r")) { ecfg = new File(file_cfgname(system.ctrl_dir, 'sbbsecho.ini'));
ecfg = new File(system.ctrl_dir+'sbbsecho.ini');
if (!ecfg.open("r")) if (!ecfg.open("r"))
throw("Unable to open '"+ecfg.name+"'"); throw("Unable to open '"+ecfg.name+"'");
...@@ -57,50 +55,7 @@ function SBBSEchoCfg () ...@@ -57,50 +55,7 @@ function SBBSEchoCfg ()
this.packer[packer].pack = ecfg.iniGetValue(packer, 'Pack', ''); this.packer[packer].pack = ecfg.iniGetValue(packer, 'Pack', '');
this.packer[packer].unpack = ecfg.iniGetValue(packer, 'Unpack', ''); this.packer[packer].unpack = ecfg.iniGetValue(packer, 'Unpack', '');
}, this); }, this);
}
else {
while ((line=ecfg.readln(65535)) != undefined) {
if (packer !== undefined) {
if ((m = line.match(/^\s*PACK\s+(.*)$/i)) !== null)
this.packer[packer].pack = m[1];
if ((m = line.match(/^\s*UNPACK\s+(.*)$/i)) !== null)
this.packer[packer].unpack = m[1];
if (line.search(/^\s*END\s*$/i) != -1)
packer = undefined;
}
else {
m = line.match(/^\s*(secure_|)inbound\s+(.*)$/i);
if (m !== null) {
this.inb.push(backslash(m[2]));
this[m[1].toLowerCase()+'inbound'] = m[2];
}
m = line.match(/^\s*pktpwd\s+(.*?)\s+(.*)\s*$/i);
if (m !== null)
this.pktpass[m[1].toUpperCase()] = m[2].toUpperCase();
m = line.match(/^\s*ticpwd\s+(.*?)\s+(.*)\s*$/i);
if (m !== null)
this.ticpass[m[1].toUpperCase()] = m[2].toUpperCase();
m = line.match(/^\s*outbound\s+(.*?)\s*$/i);
if (m !== null)
this.outbound = m[1];
m = line.match(/^\s*flo_mailer\s*$/i);
if (m !== null)
this.is_flo = true;
m = line.match(/^\s*packer\s+([^\s]+)\s+([0-9]+)\s+([0-9a-f]+)\s*$/i);
if (m !== null) {
packer = m[1];
this.packer[packer] = {};
this.packer[packer].offset = parseInt(m[2]);
this.packer[packer].sig = m[3].toUpperCase();
}
}
}
}
ecfg.close(); ecfg.close();
} }
SBBSEchoCfg.prototype.get_ticpw = function(node) SBBSEchoCfg.prototype.get_ticpw = function(node)
...@@ -179,9 +134,10 @@ SBBSEchoCfg.prototype.match_pw = function(node, pw) ...@@ -179,9 +134,10 @@ SBBSEchoCfg.prototype.match_pw = function(node, pw)
function FTNDomains() function FTNDomains()
{ {
var f = new File(system.ctrl_dir+'ftn_domains.ini'); var f = new File(file_cfgname(system.ctrl_dir, 'sbbsecho.ini'));
var used_zones = {}; var used_zones = {};
var ecfg = new SBBSEchoCfg(); var ecfg = new SBBSEchoCfg();
var domains;
if (f.open("r")) { if (f.open("r")) {
this.domainMap = {}; this.domainMap = {};
...@@ -189,8 +145,8 @@ function FTNDomains() ...@@ -189,8 +145,8 @@ function FTNDomains()
this.outboundMap = {}; this.outboundMap = {};
this.nodeListFN = {}; this.nodeListFN = {};
this.nodeList = {}; this.nodeList = {};
var domains = f.iniGetSections().forEach(function(domain) { domains = f.iniGetSections("domain:").forEach(function(domain) {
var d = domain.toLowerCase().substr(0,8); var d = domain.toLowerCase().substr(7);
var zones = f.iniGetValue(domain, 'Zones', ''); var zones = f.iniGetValue(domain, 'Zones', '');
if (zones != undefined) { if (zones != undefined) {
zones.split(/\s*,\s*/).forEach(function(zone) { zones.split(/\s*,\s*/).forEach(function(zone) {
...@@ -213,7 +169,7 @@ function FTNDomains() ...@@ -213,7 +169,7 @@ function FTNDomains()
}, this); }, this);
f.close(); f.close();
} }
else { if(!domains) {
this.outboundMap = { this.outboundMap = {
'fidonet':ecfg.outbound.replace(/[\\\/]$/, '') 'fidonet':ecfg.outbound.replace(/[\\\/]$/, '')
}; };
......
...@@ -318,7 +318,7 @@ FREQITCfg.prototype.save = function() ...@@ -318,7 +318,7 @@ FREQITCfg.prototype.save = function()
function BinkITCfg() function BinkITCfg()
{ {
var f=new File(system.ctrl_dir+'binkit.ini'); var f=new File(file_cfgname(system.ctrl_dir, 'sbbsecho.ini'));
var sects; var sects;
this.node = {}; this.node = {};
...@@ -326,20 +326,24 @@ function BinkITCfg() ...@@ -326,20 +326,24 @@ function BinkITCfg()
log(LOG_ERROR, "Unable to open '"+f.name+"'"); log(LOG_ERROR, "Unable to open '"+f.name+"'");
} }
else { else {
this.caps = f.iniGetValue(null, 'Capabilities'); this.caps = f.iniGetValue('BinkP', 'Capabilities');
this.sysop = f.iniGetValue(null, 'Sysop', system.operator); this.sysop = f.iniGetValue('BinkP', 'Sysop', system.operator);
sects = f.iniGetSections(); sects = f.iniGetSections('node:');
sects.forEach(function(section) { sects.forEach(function(section) {
var sec = new FIDO.parse_addr(section.toLowerCase(), 1, 'fidonet'); var addr = section.substr(5);
try {
var sec = new FIDO.parse_addr(section.substr(5).toLowerCase(), 1, 'fidonet');
} catch(e) {
return; // Ignore addresses with wildcards (e.g. 'ALL')
}
this.node[sec] = {}; this.node[sec] = {};
this.node[sec].pass = f.iniGetValue(section, 'Password'); this.node[sec].pass = f.iniGetValue(section, 'SessionPwd');
this.node[sec].nomd5 = f.iniGetValue(section, 'AllowPlainPassword', false); this.node[sec].nomd5 = f.iniGetValue(section, 'BinkpAllowPlainAuth', false);
this.node[sec].nocrypt = f.iniGetValue(section, 'AllowUnencrypted', false); this.node[sec].nocrypt = f.iniGetValue(section, 'BinkpAllowPlainText', false);
this.node[sec].poll = f.iniGetValue(section, 'Poll', false); this.node[sec].poll = f.iniGetValue(section, 'BinkpPoll', false);
this.node[sec].port = f.iniGetValue(section, 'Port'); this.node[sec].port = f.iniGetValue(section, 'BinkpPort');
this.node[sec].src = f.iniGetValue(section, 'SourceAddress'); this.node[sec].src = f.iniGetValue(section, 'BinkpSourceAddress');
this.node[sec].host = f.iniGetValue(section, 'Host'); this.node[sec].host = f.iniGetValue(section, 'BinkpHost');
}, this); }, this);
f.close(); f.close();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment