web: Add warning message to login page

Closes #476
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Add proper patternfly alert warning icon to docker page

This is shown when something goes wrong, and has been missing
from the warnings so far.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
daemon: Don't sync block during demon startup waiting for hostname

Besides being fragile, this is the reason we can't currently log
in when selinux is enabled.

Closes #478
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Don't do DBus calls for unauthenticated users

We don't use the hostname information for unauthenticated users
so we shouldn't need to do DBus calls to try and access it.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
daemon: Fallback to gethostname when hostnamed can't be reached.
agent: Add cockpit_channel_get_generator() function

Returns a cached generator from the channel, which can be shared by
both implementations and the channel itself for efficiency.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Add the cockpit_channel_close_option() function

This adds an string option to the close message for the channel.
It must be called before the channel close message is sent.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Add the cockpit_channel_close_int_option() function

This adds an integer option to the close message for the channel.
It must be called before the channel close message is sent.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Expose channel close options in Channel.on("close")

Instead of having a reason argument to the event, there's now the
full options, so handlers can access any field of the close message.
This is symettrical with the Channel(@options) constructor.

In addition accept @options instead of a @reason in Channel.close()

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Send exit-status and exit-signal in text-stream

If a text-stream is a spawn type text-stream then send the
exit-status and/or exit-signal in the close options.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Implement $cockpit.spawn() method

This creates a deferred jQuery object on which you can listen for
output from a process, send data to the proces, etc...

Internally uses the text-stream channel with a "spawn" open
option.

Documentation in spawn.js

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
daemon: Remove Manager.Run() dbus method

Use the $cockpit.spawn() channel instead to run commands.

Closes #474
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Release version 0.5
ws: Fix up mock-sshd to handle retrying non-blocking writes

There were corner cases in our testing where we would expect
all data to be written out. In reality not all data is expected
to be written during a write() or ssh_channel_write() so,
buffer it appropriately and only write when we are ready for it.
ws: Add --broken-auth argument to mock-sshd

This lets us start mock-sshd in a way that ssh authentication should
always fail. We don't have host-based auth or public key auth, so
use those as our way of forcing failure.
ws: Don't mix stderr and stdout in mock-sshd

In fact for testing purposes, just leave it connected to our normal
stderr so we can see failures.
ws: Send exit termination signals from children of mock-sshd

We'll want to test these cases, even though we don't currently
do that.
ws: Add CockpitSshTransport which uses libssh

We'll migrate from our current sshpass + openssh client based
approach to libssh.

This doesn't use libgssh. libgssh unfortunately doesn't have a
pollable model (such as GPollableOutputStream and friends) which
is what we need to implement a CockpitTransport.

In addition the mechanism that it uses to do async work with
libssh (ie: eagain non-blocing based async) doesn't work well with
libssh 0.6.x upstream. Certain functions to make the corner cases
work are completely missing.

Lastly we need to authenticate in a thread, so we can support
kerberos (ie: GSSAPI). So implemented it this way in
CockpitSshTransport.

Part of fix for #69
ws: Use CockpitSshTransport for connecting to other hosts

Uses libssh instead of the openssh client for connecting to other
hosts.

We also remove some complexity from cockpit_pipe_transport_spawn()
which can no longer fail immedediately, but will close if failure.

Note that although the tests pass with this commit, running actual
webservice requires that you put known_hosts in the standard
format in the following file, for any hosts that you want to connect to:

  /var/lib/cockpit/known_hosts

This commit removes sshpass dependency.

Fixes #69
ws: Expose host key for CockpitSshTransport

This allows us to look at the host key that the server offered,
regardless of whether verification succeeded or failed. Via
cockpit_ssh_transport_get_host_key() and the 'host-key' property.

In addition we want to be able to tell CockpitSshTransport to
explicitly expect a certain key and ignore other host verification
via the known-hosts file. This happens via 'host-key' construct
property.