tools: Distribute jsl.sed in the tarball

Closes #1344
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Respect non-standard --prefix when looking for packages

When built with a non-standard --prefix=/xxxx then override the
$XDG_DATA_DIRS environment variable in cockpit-agent so that
we find our packages in the installed location.

Fixes #1342
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
configure: Add --enable-prefix-only option to restrict to prefix

Restrict 'make install' to --prefix when '--enable-prefix-only'
is used. This will result in a cockpit that doesn't work without
further tweaking, but is an advanced tool for advanced use cases.

Fixes #1343
Closes #1346
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Rename error code 'no-agent' to 'no-cockpit'

And update its message, since it was a bit confusing.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Rename cockpit_ws_agent_timeout to cockpit_ws_session_timeout

That's really what it's watching, various sessions and is related
to the CockpitSession structs that live in cockpitwebservice.c

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
bridge: Rename 'agent' -> 'bridge' and install to $PATH

This is done for a couple reasons.

 1. This really is a bridge into the system, and not an agent doing
    things on its own. It merely conveys the commands that the web
    interface sends its way. There is a lot of confusion about what
    Cockpit does, and this is one step towards clearing that up.

 2. The path to the bridge is public API, and will need to be
    usable across all future versions of Cockpit across different
    machines. Various distros can't agree on /usr/libexec so we
    can't really use it in such a public API guarantee.

 3. Name is similar to 'systemd-stdio-bridge' which does a similar
    task, but it much much simpler.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
man: Cleanup manual building automake foo

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
man: Add manual page for 'cockpit-bridge'

Closes #1349
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Send and expect 'init' control messages over each transport

Each transport when opened sends 'init' control messages to each
other. This is initially used to double check that the same protocol
version is in use. But this will be expanded in later commits.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Don't complain if SSH connection already closed when writing

When closing an SSH connection, don't complain if it's already
closed. libssh returns SSH_REQUEST_DENIED in this case.

This happens when the remote has closed but libssh hasn't let us
know yet. We assume that the notification will come soon.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Send a 'channel-seed' in the WebSocket init message

This allows various web sockets to generate unique channels, without
having to get into NAT'ing everything in CockpitWebService.

This is necessary once various frames are the source of channels.
They'll need to be seeded appropriately so that they pick unique
channel ids.

The way that channels get their id, also needs to change a bit.
The id can't be allocated until the transport is open. So queueing
of messages happens at the channel level now.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
session: Rename 'passwd' to 'password' for clarity

In the cases we're dealing with an actual password instead
of a struct passwd, use the full word 'password'

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
session: Lookup user info earlier and use it consistently

Lookup user info via getpwnam() right after authenticating and
use it consistently as the full user name, etc.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
session: Lookup the user's full name in session

This can be a blocking operation, don't look it up in
cockpit-ws where we can't be blocking waiting for an
LDAP server or something like that.

Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Send user info in the 'init' control channel message

Rather than filling in the user into the index page environment,
send it in the 'init' control message, along with the cockpit
setup info.

The index page will be changing, and this is much cleaner.

Closes #1332
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
ws: Show a login page for any .html resource being accessed

For other resources besides the main page, show a login page if user
doesn't have a cookie.

One big difference, we now refresh the page after completing a
sucessful login.
static: Change the styles of login page when shown inline

When not logging into cockpit as a whole, just show a basic login
screen on a white background. This will help not confuse users as
to what they're logging into.
tools: Ignore another glib leak
examples: Add example for embedding terminal
examples: Add example for pinging the server