Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

clussh

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clussh - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

6

bin/clussh.js

@@ -65,2 +65,8 @@ #!/usr/bin/env node

})
.option('port-control', {
description: 'Open repl controller at given port',
type: 'number',
alias: 'p',
default: 0
})
.parse()

@@ -67,0 +73,0 @@

@@ -5,2 +5,12 @@ # Change Log

<a name="2.2.0"></a>
# [2.2.0](https://github.com/nodys/clussh/compare/v2.1.0...v2.2.0) (2018-05-02)
### Features
* Add controller ([56ecb0d](https://github.com/nodys/clussh/commit/56ecb0d))
<a name="2.1.0"></a>

@@ -7,0 +17,0 @@ # [2.1.0](https://github.com/nodys/clussh/compare/v2.0.0...v2.1.0) (2018-04-30)

54

lib/clussh.js

@@ -6,2 +6,6 @@ const miss = require('mississippi')

const ms = require('ms')
const net = require('net')
const replico = require('replico')
const pkg = require('../package.json')
const chalk = require('chalk')

@@ -22,3 +26,4 @@ module.exports = clussh

scale: 1,
identity: []
identity: [],
portControl: 0
}, config)

@@ -65,2 +70,6 @@

if (config.portControl) {
openControl(config.portControl)
}
function ensureWorker (uri) {

@@ -202,3 +211,46 @@ let worker = workers.find(w => w.uri === uri)

function openControl (portControl) {
writeStream.log({ type: 'repl', msg: 'Call openControl', portControl: portControl })
// Repl
net.createServer((socket) => {
writeStream.log({ type: 'repl', msg: 'New control client', remoteAddress: socket.remoteAddress })
socket.write(chalk`{bold Clussh v${pkg.version}}`)
let replServer = replico({
input: socket,
output: socket,
terminal: true
})
function extendContext (context) {
context.workers = workers
context.config = config
context.ensureWorker = ensureWorker
context.bufferize = bufferize
context.dispatch = dispatch
}
extendContext(replServer.context)
replServer.on('reset', extendContext)
replServer.on('exit', () => {
socket.end()
})
// replServer.defineCommand('chist', {
// help: 'Clear history',
// action: function () {
// replServer.history = []
// this.displayPrompt()
// }
// })
// replServer.context.admin()
}).listen(portControl, function () {
writeStream.log({ type: 'repl', msg: `Server repl on port ${portControl} - pid: ${process.pid}`, port: portControl, pid: process.pid })
})
}
return duplexStream
}

@@ -128,2 +128,3 @@ const PQueue = require('p-queue')

this.stats.done++
this.server.down = false
log({ type: 'success' })

@@ -130,0 +131,0 @@ })

3

package.json
{
"name": "clussh",
"version": "2.1.0",
"version": "2.2.0",
"description": "Stream tasks to shell workers through ssh",

@@ -64,2 +64,3 @@ "main": "index.js",

"rc": "^1.2.3",
"replico": "^0.1.1",
"split2": "^2.2.0",

@@ -66,0 +67,0 @@ "yargs": "^10.1.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc