GPG changes for Windows, External pages

This commit is contained in:
Deon George
2019-10-27 12:04:22 +11:00
parent 11bb2848c8
commit 564ea50646
10 changed files with 48 additions and 12 deletions

View File

@@ -14,14 +14,17 @@ while(bbs.online) {
var mode = false; // Initial mode
var next_page = { frame: 98,index: 'b' }; // Start Frame
var action = ACTION_GOTO; // Initial action
var inkey_timeout = 0; // Timeout waiting for input @todo required? check if idle timetout occurs
var inkey_timeout = 600000; // Timeout waiting for input @todo required? check if idle timetout occurs
var fo = null; // Current Frame
var history = []; // Page history
ansiterm.send('ext_mode','clear','cursor');
while (action != ACTION_TERMINATE) {
bbs.nodesync(false); // @todo Stop the display of telegrams
read = console.inkey(K_NONE,inkey_timeout);
read = '';
if (action == false) {
read = console.inkey(K_NONE,inkey_timeout);
}
system.node_list[bbs.node_num-1].action=0xff; // to ensure our node status is updated correctly
inkey_timeout = 60000; // Set our key timeout to 60s
log(LOG_DEBUG,'READ: ['+read+']');
@@ -152,7 +155,7 @@ while(bbs.online) {
action = ACTION_BACKUP;
} else if (cmd == '0') {
next_page = { frame: 1 }; // @todo specificy home page in config
next_page = { frame: 1 }; // @todo specify home page in config
action = ACTION_GOTO;
// Edit frame
@@ -277,23 +280,49 @@ while(bbs.online) {
// $current['baseline'] = '';
console.line_counter=0; // @todo fix to suppress a pause that is occurring before clear()
console.clear();
console.putmsg(fo.render());
switch(fo.type) {
// Terminate frame
case FRAME_TYPE_TERMINATE:
console.putmsg(fo.render());
bbs.hangup();
exit();
// External Frame
case FRAME_TYPE_EXTERNAL:
log(LOG_DEBUG,'- ACTION_GOTO: EXTERNAL ['+JSON.stringify(fo.raw())+']');
switch(fo.raw()) {
case 'bbs.user_config()':
case 'bbs.read_mail(MAIL_YOUR)':
eval(fo.raw());
// Check and see if our shell was changed
if (user.command_shell != 'ansitex') {
exit();
}
break;
default:
console.putmsg(JSON.stringify(fo.raw()));
sendBaseline(ERR_ROUTE,false);
break;
}
mode = false;
action = ACTION_BACKUP;
break;
// Standard Frame
case FRAME_TYPE_INFO:
default:
console.putmsg(fo.render());
mode = action = false;
break;
// Active frame
}
bbs.replace_text(NodeActionMain,'\1h%s \1nViewing \1h*'+fo.frame+'#\1n ['+fo.index+']');
bbs.log_str(fo.page+'|');
bbs.node_action=NODE_MAIN;
break;
}

View File

@@ -162,7 +162,7 @@ function msgBaseExport(msgbase) {
file_remove(system.temp_dir+'videotex.tex')
// Check that the signature is allowed to author the frames
result = system.exec('gpg --homedir '+system.mods_dir+'/keys --batch --status-fd 3 -o '+system.temp_dir+'videotex.tex '+system.temp_dir+'videotex.gpg 3>'+system.temp_dir+'videotex.log');
result = system.exec('gpg --homedir '+system.mods_dir+'/keys --batch --status-fd 2 -o '+system.temp_dir+'videotex.tex '+system.temp_dir+'videotex.gpg 2>'+system.temp_dir+'videotex.log');
if (result !== 0 ) {
log(LOG_ERROR,'! ERROR: Failed to extract message offset ['+i+'] in ['+msgbase.file+']');

View File

@@ -94,11 +94,11 @@ if (send == 1 && options.gpg_key) {
exit(1);
}
if (file_exists(file+'.gpg'))
file_remove(file+'.gpg')
if (file_exists(file+'.asc'))
file_remove(file+'.asc')
result = system.exec('gpg --homedir '+system.mods_dir+'/keys --batch --local-user '+options.gpg_key+' -s '+file);
w = new File(file+'.gpg');
result = system.exec('gpg --homedir '+system.mods_dir+'/keys --clearsign --batch --local-user '+options.gpg_key+' -s '+file);
w = new File(file+'.asc');
if (w.open('r')) {
msg = base64_encode(w.read());

View File

@@ -21,6 +21,7 @@ var FRAME_COSTUNIT ='c'; /* Unit of cost
var FRAME_TYPE_INFO ='i';
var FRAME_TYPE_TERMINATE ='t';
var FRAME_TYPE_EXTERNAL ='x';
var ERR_NOT_IMPLEMENTED = '\1RNOT IMPLEMENTED YET?';
var ERR_ROUTE = '\1n\1h\1WMISTAKE? \1GTRY AGAIN OR TELL US ON *08';
@@ -44,6 +45,9 @@ function Frame(frame,index) {
this.isAccessible=false; // @todo
this.type = FRAME_TYPE_INFO;
this.key=[ null,null,null,null,null,null,null,null,null,null ];
this.raw=function() {
return base64_decode(this.content).replace(/(\r\n|\n|\r)/gm,'');
}
this.render=function() {
owner = base64_decode(this.owner);

View File

@@ -102,6 +102,7 @@ function getFrame(page) {
frame = JSON.parse(f.read());
x = new Frame(0);
frame.render = x.render;
frame.raw = x.raw;
// @todo Figure out how to delete this duplicate code
Object.defineProperty(frame,'page', {

View File

@@ -9,7 +9,7 @@
require("sbbsdefs.js", 'SS_RLOGIN');
require("nodedefs.js", 'NODE_QUIET');
if (user.command_shell == 'ansitex') {
system.settings |= SYS_NOSYSINFO;
system.settings |= (SYS_NOSYSINFO | SYS_QVALKEYS);
exit();
}