Skip to content

Juise w Mixer

Phil Shafer edited this page Jul 9, 2013 · 3 revisions

Background

Juise is the command line tool used to invoke SLAX scripts. It is also invoke from lighttpd in response to web requests.

Mixer is the connection manager for CLIRA, which accepts a web socket from the browser and manages a very simple RPC/framing protocol over the web socket.

Javascript running in the browser talks to mixer to request NETCONF operations from connected devices. Mixer opens SSH sessions and channels with support for telling the browser when to prompt for issues with host keys, passwords and passphrases.

Juise, in contrast, forks an ssh binary to handle the connection, making prompting a non-issue. When prompting it needed (in JUNOS), we use a "juise-askpass" binary to pass the requests back to the juise program.

Problem Description

Juise does not currently take advantage of mixer. For the command line version, this is missed opportunity, and prevents us from keeping connections open between (and among) scripts. But it's not a bug.

But when juise is invoked from lighttpd, there's no mechanism for (a) reuse of mixer content, configured device, or groups, and (b) prompting the user for hostkey and pass* issues.

Solution

  1. The browser will pass an identifier in any lighttpd URL that invokes a SLAX script.
  2. lighttpd will forward that identifier to juise
  3. juise will open an AF_UNIX socket to mixer on the first call to jcs:open/jcs:invoke
  4. juise will use the protocol already in use over websockets to allow it to talk to mixer
  5. juise will pass the browser's identifier to mixer
  6. when juise invokes an RPC, mixer will have access to sessions, channels, and config (sqlite)
  7. when a juise-requested RPC needs interactivity, it will use browser identifier to find the browser's websocket, over which it will send the request
  8. when a command line juise makes a request, mixer will send those interactive messages to juise, who will interactive with the user.
Clone this wiki locally