base, shell: jQuery promises can be used recursively and with targets

jQuery promises can be used recursively, and with targets, so it's
important to carefully craft extending promises with additional methods.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
doc: Refer to them as jQuery promises and not deferreds

This is the correct name for the interface

Closes #1448
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
tools: Use a consistent mock build directory mock/

Previously we would create a new mock/ directory wherever the current
directory was when the make-rpms tool was run.

Closes #1449
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws, bridge: Add some debug output to launch of processes

Some more debugging output when launching dbus-daemon or cockpit-session

Closes #1450
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
test: Fix check-terminal race in integration test

Closes #1453
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Fix problem using batch after free in CockpitDbusCache

Related to assertion related on #1444

Closes #1454
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Return a full CockpitTransport from completed authentication

Instead of just a pipe. This allows us to substitute in other
transports than pipe based ones.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Add ignore-key property on CockpitSSHTransport

This is to be used when we are sure we can ignore the host key. Such as
when connecting to 127.0.0.1

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Add a "result" signal to CockpitSshTransport

This signal is emitted when the connection finishes, whether success
or failure. In the success case it means that cockpit protocol messages
will start being relayed to the other end. In the failure case it
means that the transport will close shortly.

But this is meant to have a bound over the connection aspect of an
SSH transport, that can be relied on to emit when done.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Refator CockpitAuth to put cockpit-session stuff together

This will make it easier to clearly see what's what once the other
SSH loopback based authentication is in place.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Use an alternate loopback SSH based login when running in container

When running in a privileged container systemd and selinux are both
very very confused if we try to run a user session from a descendant
of a daemon like docker.

So for login and starting the user session, we instead SSH into
127.0.0.1 and use that for authentication too.

Note that because we are connecting to 127.0.0.1 we can ignore host
keys.

Closes #1444
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Remove incorrect unthread-safe deprecated test

This was already broken, running channels in a thread is not
something we can do. The way that idle handlers, for example
are added to the wrong GMainContext is just the beginning of
issues here.

This code is deprecated so just remove the test.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Simpler handling of closing channels during open

When opening a new channel, we need to wait until after the
mainloop has run before emitting signals, so that signal handlers
can be connected.

Previously each channel would do this in its own way. This puts
that in the base class so it's consistent.

Closes #1421
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
daemon: Don't hang if AccountsService cannot be reached

And also don't export the accounts object when AccountsService
is not available.
tools: Add a Dockerfile for building docker containers

For now these build WIP builds rather than a specific version
of Cockpit.

To run in a container:

 * We use SSH to log back into the host
 * We use the host net namespace to be able to:
   - Listen on port 9090
   - Connect to 127.0.0.1 on the host
   - Connect to the system journal
 * Copy the cockpit-bridge and dependencies into the host
   at /opt/cockpit for the user session
 * Drop necessary files in /usr/local on host to make it run

Closes #1446