web: Fix leave handler of networking page.

Closes #545

Reviewed-by: Stef Walter <stefw@redhat.com>
test: Clearer code assertions in check-login

Readable output when the HTTP error codes don't match.

Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
reauthorize: Fix a number of bugs caught by Coverity

Closes #555

Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
test: Don't polute user's known hosts file

If you run ./VERIFY as a local user, it will use that known hosts
file and add all sorts of entries for 10.111.111.X to it.

Closes #554

Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
- Removed stray t from git log
Ignore .a and .so files, and cockpit-polkit
Use strings as channel identifiers instead of numbers

This is done for three reasons:

 * Much much more flexible going forward, since this is an integral
   part of our protocol, it can never be changed.
 * We can allow routing multiple WebSockets to one agent, without
   trying to coordinate the channel number space of those WebSockets.
   This is not implemented in this patch.
 * We can implement internal channels that don't get routed to a
   WebSocket (necessary for implementing resource loading).

This is an alternative to the signed channel number patch that was
floating around.

Closes #546
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Signed-off-by: Marius Vollmer <marius.vollmer@redhat.com>
* Cosmetic fixes to protocol.md
ws: Clear login passwords from memory when freeing

Try to defeat compiler optimizations here too by having
side effects of our password clearing.

Closes #559

Signed-off-by: Stef Walter <stefw@redhat.com>
 * Made comment a gtk-doc style function comment
agent: Fix bash argument in textstream test

Closes #547
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
websocket: Log the chosen websocket protocol correctly

Closes #548
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
Quieten down travis notifications into IRC

 * Make them one line
 * No joining and leaving

Closes #549
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: Rename $cockpit.xxx to cockpit.xxx

Since $zzz is often used to indicate a jQuery selector, and
the usual convention is for global API like document.yyyy
or window.vvv is just in lower case.

Closes #558
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
web: IPv4 input control

Added to STYLE.html

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Actually close the panel-default div and fix indentation

Reviewed-by: Stef Walter <stefw@redhat.com>
web: Make sure IPv4 octet numbers are between 1 and 255

Reviewed-by: Stef Walter <stefw@redhat.com>
Release version 0.6
ws: Implement CockpitWebServer without threads

The main difference here is that things are no longer threaded
when serving HTTP requests.

This is necessary because we'll have some HTTP requests accessing
WebSocket channels in the future and locking everything will be
a major pain.

In addition the following fixes and benefits:

 * Don't waste a whole thread on unauthenticated requests.
 * Enforce a default 30 second timeout for reading HTTP requests.
 * Hard 4096 byte size limit for HTTP request input.
 * Don't leak so much internal state into error messages.
 * Better setup for queuing and returning responses and guaranteeing
   that they're correct.
 * Simpler to read POST input.
 * Simpler handlers.
 * No memory leak of per request signal detail (ie: the path).
 * No expensive GIO for serving files, just use mmap.
 * Use proper HTTP status codes for invalid requests
 * Fix various races and multi-threading issues due to
   main context usage.
 * Fix breaking out of the HTTP document root with double dots.

Although not implemented yet, set the ground work for:

 * Chunked Encoding
 * Correct HTTP version responses
 * Persistent connections (with multiple requests)

Fixes #551
Fixes #550
Closes #556
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Fix use after free in CockpitDBusJson

This would occur when the CockpitDBusJson was closed while
servicing some dbus calls.

Closes #564
Reviewed-by: Marius Vollmer <marius.vollmer@redhat.com>
agent: Fix another use after free in CockpitDBusJson
agent: Fork CockpitDBusJson into the old CockpitDBusJson1

We'll be implementing a new dbus-json2 protocol and migrating
away from dbus-json1

The javascript code which calls into the old protocol is rather
ugly, requiring explicit use of { protocol: "dbus-json1" }
everywhere. That's intentional.

The first change to the new dbus-json2 is that we include the
signature along with variants like this:

 { "sig": "u", "val": 1234 }

Closes: #568
FIXUP