web: Don't auto-navigate when user has navigated explicitly.

Fixes #369
Closes #638

Reviewed-by: Stef Walter <stefw@redhat.com>
ws: Don't rely on Fedora specific make-dummy-cert script

The script was non-portable, not-flexible, and caused problems
with SELinux.

Fixes #205
Closes #655
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
tools: Don't fail TAP tests due to EAGAIN

It seems that in certain situations the stdout or stderr passed to
tap-driver returns EAGAIN on write(). So handle that by waiting
and trying again.

Closes #654
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Fix race condition during ssh transport shutdown

Without this change on certain machines, in certain environments
we would see messages like the following:

cockpit-protocol-Message: 127.0.0.1: failed to process channel: Socket error: Success

Closes #657
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
selinux: Allow accepting connections on sockets passed from systemd

Closes #659
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: First give libssh chance to handle socket errors

We handle them as a last resort, but let libssh at the errors
first so we can hopefully get more intelligent errors based on
its state.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Flush EOF and close packets better during mock-sshd shutdown

Trying to fix various shutdown races here.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: New cockpit.location() object for navigating

This will prevent navigation if methods on the resulting object
are called after the user has already navigated.

Signed-off-by: Stef Walter <stefw@redhat.com>
 - Renamed to location and Location
 - Make .navcount an implementation detail, don't expose
web: Use a Location to go up after container operations

Fixes #369.
Closes #638

Signed-off-by: Stef Walter <stefw@redhat.com>
 - Renamed page_navigator to location
web: Added cockpit.util.parse_words and cockpit.util.quote_words.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Properly quote/parse container commands.

By using the new cockpit_quote_words and cockpit_parse_words
functions, and also by avoiding the container.Command property
reported by Docker.

Fixes #451
Fixes #280
Closes #633

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Factor out the DBusClient and DockerClient object caches.

We will use this pattern also for the upcoming NetworkManager code.

Close #628

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Correctly check client channel for validity.

It might also be null.

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Use correct client when getting max memory for docker

Previously an error would occur if the run dialog wasn't shown before
the container details page.

Fixes #661
Closes #662
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Fix issue where remote channel is closed when sending data

Should fix errors like this:

couldn't write: Remote channel is closed

Closes #664
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Release version 0.10
ws: Better debug logging when removing a channel from session
agent: Split out MockTransport into its own file

And move some tests to start using it.
WIP cockpitresource
WIP cockpitwebservice resources as http