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
agent: Lookup introspect data asyncronously in CockpitDBusJson

We can't block the rest of the agent while talking out to other
DBus services.

This also removes the big leak of cached introspect data which
used to be global and never released until the agent went away.

Fixes #203
Closes #470
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
cockpit: Don't close sessions that receive for unknown channels

When a channel closes from the session side (eg: due to an error)
then cockpit-web can't possibly know it shouldn't send a message
to that channel until it receives the close message.

There's a race where a channel closes just before a message that
was already in transit gets delivered to it.

Currently we cause a failure in the transport due to a message
with an unknown channel. However this is inherently racy and breaks
the entire application (ie: logout).

We have to just ignore messages with bad channels in this situation.

Note that we still don't allow sessions to lie about which channels
they're sending messages from. This would be a security risk, and
is still handled strictly (by closing the session).

Closes #477
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
test: Don't ignore obsolete journal messages

They are not warnings anymore.

Reviewed-by: Stef Walter <stefw@redhat.com>
agent: Don't distribute compiled dbus sources

This causes build problems due to gdbus-codegen's brokenness.

Closes #480
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
common: Add missing dirent.h header

This caused build failures on some non-Fedora systems.

Closes #481
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Ignore broken pipe errors when sending http errors

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Be const correct in cockpit_web_server_return_content()

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>