global.fs = fs;
global.sshConfig = sshConfig;
global.docker = docker;
+global.createError = createError;
// noinspection JSCheckFunctionSignatures
app.use( bodyParser.json( {
const { Client } = require( 'ssh2' );
-const createError = require('http-errors');
/**
*
// Split once and reuse
const lines = output.split( '\n' ).map( line => line.trim() ).filter( Boolean );
- const lValues = [ 'lines:', lines ].join( ' ' );
- logger.debug( lValues );
- logger.warn( lValues );
- logger.error( lValues );
// Find indices using a single pass
let sIndex = -1, mIndex = -1, eIndex = -1;
lines.forEach( ( line, i ) => {
} ).connect( sshConfig );
},
getClients:async ( req, res, next ) => {
+ const error = new Error( 'Not implemented yet' );
+ next( error );
const conn = new Client();
conn.on( 'ready', () => {
const command = `cat /var/log/openvpn/openvpn-status.log`;