show local ssh config

This commit is contained in:
AJ ONeal 2018-10-31 23:49:40 -06:00
parent 7f18482566
commit 142fb0942c
1 changed files with 21 additions and 16 deletions

View File

@ -628,22 +628,27 @@ function handleApi(req, res) {
function getStatus() { function getStatus() {
var now = Date.now(); var now = Date.now();
res.setHeader('Content-Type', 'application/json'); res.setHeader('Content-Type', 'application/json');
res.end(JSON.stringify( require('../lib/ssh.js').checkSecurity().then(function (ssh) {
{ module: 'status' res.end(JSON.stringify(
, version: pkg.version { module: 'status'
, port: (state.config.ipc && state.config.ipc.port || state._ipc.port || undefined) , version: pkg.version
, enabled: !state.config.disable , port: (state.config.ipc && state.config.ipc.port || state._ipc.port || undefined)
, active: !!myRemote , enabled: !state.config.disable
, initialized: (state.config.relay && state.config.token && state.config.agreeTos) ? true : false , active: !!myRemote
, connected: isConnected , initialized: (state.config.relay && state.config.token && state.config.agreeTos) ? true : false
, proctime: Math.round(process.uptime() * 1000) , connected: isConnected
, uptime: now - startTime , proctime: Math.round(process.uptime() * 1000)
, runtime: isConnected && connectTimes.length && (now - connectTimes[0]) || 0 , uptime: now - startTime
, reconnects: connectTimes.length , runtime: isConnected && connectTimes.length && (now - connectTimes[0]) || 0
, servernames: state.servernames , reconnects: connectTimes.length
, ssh: state.config.sshAuto , servernames: state.servernames
} , ssh: state.config.sshAuto
)); , ssh_permit_root_login: ssh.permit_root_login
, ssh_password_authentication: ssh.password_authentication
, ssh_requests_password: ssh.requests_password
}
));
});
} }
function route() { function route() {