summaryrefslogtreecommitdiff
path: root/src/journal/journal-gatewayd.c
Commit message (Collapse)AuthorAgeFilesLines
* microhttpd-util: use static buffer for static messagesZbigniew Jędrzejewski-Szmek2014-03-171-19/+19
| | | | | | | | | | | Most of the messages we send do not require a allocating and freeing a buffer, to optimize this by using const strings. Also, rename respond_error to mhd_respond*, since it is used not only for errors. Make use of information from printf to avoid one extra call to strlen.
* journal-remote: tool to receive messages over the networkZbigniew Jędrzejewski-Szmek2014-03-171-0/+1
|
* journal-gatewayd: check if certificate is signed by CAZbigniew Jędrzejewski-Szmek2014-03-171-58/+19
| | | | | | | | | | If --trust=ca.crt is used, only clients presenting certificates signed by the ca will be allowed to proceed. No hostname matching is performed, so any client wielding a signed certificate will be authorized. Error functions are moved from journal-gateway to microhttp-util and made non-static, since now they are used in two source files.
* journal-gatewayd: log to journal from gnutlsZbigniew Jędrzejewski-Szmek2014-03-171-0/+5
| | | | | | Prefix "gnutls: " is added. Some semi-random mapping of gnutls levels to syslog levels is done, but since gnutls levels seem to be used rather loosely, most end up as debug.
* journal-gatewayd: ask clients to provide certificatesZbigniew Jędrzejewski-Szmek2014-03-171-2/+30
| | | | | | | A certificate authority certificate will be presented to clients, causing them to present their client certificate, if it is signed by this authority (default behaviour of most clients). No certificate checking is actually performed.
* make gcc shut upLennart Poettering2014-02-191-2/+2
| | | | | | | If -flto is used then gcc will generate a lot more warnings than before, among them a number of use-without-initialization warnings. Most of them without are false positives, but let's make them go away, because it doesn't really matter.
* Add more _printf_'s for format-nonliteralsThomas Hindoe Paaboel Andersen2013-12-141-0/+1
| | | | | | | | | | | Clang is a bit more strict wrt format-nonliterals: http://clang.llvm.org/docs/LanguageExtensions.html#format-string-checking Adding these extra printf attributes also makes gcc able to find more problems. E.g. this patch uncovers a format issue in udev-builtin-path_id.c Some parts looked intetional about breaking the format-nonliteral check. I added some supression for warnings there.
* bus: introduce concept of a default bus for each thread and make use of it ↵Lennart Poettering2013-11-121-1/+1
| | | | | | | | everywhere We want to emphasize bus connections as per-thread communication primitives, hence introduce a concept of a per-thread default bus, and make use of it everywhere.
* bus: use new property retrieval calls everywhereLennart Poettering2013-11-071-18/+6
|
* clients: unify how we invoke getopt_long()Lennart Poettering2013-11-061-6/+7
| | | | | Among other things this makes sure we always expose a --version command and show it in the help texts.
* timedated: use libsystemd-bus instead of libdbus for bus communicationLennart Poettering2013-10-161-2/+1
| | | | | | | | | | | | | | | Among other things this also adds a few things necessary for the change: - Considerably more powerful error returning APIs in libsystemd-bus - Adapter for connecting an sd_bus to an sd_event - As I reworked the PolicyKit logic to the new library I also made it asynchronous, so that PolicyKit requests of one user cannot block out another user anymore. - We always use the macro names for common bus error. That way it is harder to mistype them since the compiler will notice
* systemctl: show hint about --full when lines don't fitZbigniew Jędrzejewski-Szmek2013-08-111-1/+1
|
* Use stdint.h macros instead of casts to print uint64_t valuesZbigniew Jędrzejewski-Szmek2013-06-101-6/+6
| | | | Casts are visually heavy, and can obscure unwanted truncations.
* journal: add ability to filter by current userZbigniew Jędrzejewski-Szmek2013-06-101-1/+1
| | | | | | | | | | | | | | | | This is the just the library part. SD_JOURNAL_CURRENT_USER flags is added to sd_j_open(), to open files from current user. SD_JOURNAL_SYSTEM_ONLY is renamed to SD_JOURNAL_SYSTEM, and changed to mean to (also) open system files. This way various flags can be combined, which gives them nicer semantics, especially if other ones are added later. Backwards compatibility is kept, because SD_JOURNAL_SYSTEM_ONLY is equivalent to SD_JOURNAL_SYSTEM if used alone, and before there we no other flags.
* hostname: only suppress setting of pretty hostname if it is non-equal to the ↵Lennart Poettering2013-05-071-1/+1
| | | | | | static hostname and if the static hostname is set, too https://bugzilla.redhat.com/show_bug.cgi?id=957814
* move _cleanup_ attribute in front of the typeHarald Hoyer2013-04-181-1/+1
| | | | http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
* bus: add convenience functions for constructing and sending method ↵Lennart Poettering2013-04-051-11/+7
| | | | calls/signals in one call
* journal-gatewayd: query PID 1 for virtalizationLennart Poettering2013-03-311-4/+52
| | | | | | | | | | | Since journal-gatewayd is now running unprivileged, and detecting virtalization requires privileges, query PID1 via D-Bus for the used virtualization. This is also the first time we use libsystemd-bus for more than just testing. https://bugs.freedesktop.org/show_bug.cgi?id=62173
* macro: don't redefine CLAMP if it is already defined by glib or some other ↵Lennart Poettering2013-03-201-1/+0
| | | | library
* added some missing include for a5c32cff1f56afe6f0c6c70d91a88a7a8238b2d7Harald Hoyer2013-02-141-0/+1
|
* journal-gatewayd,man: document new HTTPS optionsZbigniew Jędrzejewski-Szmek2013-01-181-1/+18
|
* journal-gatewayd: return nice error on unsupported methodsZbigniew Jędrzejewski-Szmek2013-01-181-1/+3
| | | | | Returns "HTTP/1.0 406 Not Acceptable" instead of silently closing the connection.
* journal-gatewayd: allow pipeliningZbigniew Jędrzejewski-Szmek2013-01-181-22/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The request must not be answered immediately (at first call to response_handler()), but on the second. This is also important for authentication, which cannot be performed on the first call. Before: % wget -O/dev/null -S https://localhost:19531/ --2012-11-28 18:29:43-- https://localhost:19531/ Resolving localhost (localhost)... 127.0.0.1 Connecting to localhost (localhost)|127.0.0.1|:19531... connected. HTTP request sent, awaiting response... HTTP/1.1 301 Moved Permanently Connection: close Content-Length: 87 Location: /browse Content-Type: text/html Date: Wed, 28 Nov 2012 17:29:44 GMT Location: /browse [following] --2012-11-28 18:29:43-- https://localhost:19531/browse Connecting to localhost (localhost)|127.0.0.1|:19531... connected. HTTP request sent, awaiting response... HTTP/1.1 200 OK Connection: close Content-Length: 23260 Content-Type: text/html Date: Wed, 28 Nov 2012 17:29:44 GMT Length: 23260 (23K) [text/html] After: % wget --no-check-certificate -O/dev/null -S https://localhost:19531/ --2012-11-28 18:30:05-- https://localhost:19531/ Resolving localhost (localhost)... 127.0.0.1 Connecting to localhost (localhost)|127.0.0.1|:19531... connected. HTTP request sent, awaiting response... HTTP/1.1 301 Moved Permanently Content-Length: 87 Location: /browse Content-Type: text/html Date: Wed, 28 Nov 2012 17:30:05 GMT Location: /browse [following] --2012-11-28 18:30:05-- https://localhost:19531/browse Reusing existing connection to localhost:19531. HTTP request sent, awaiting response... HTTP/1.1 200 OK Content-Length: 23260 Content-Type: text/html Date: Wed, 28 Nov 2012 17:30:06 GMT Length: 23260 (23K) [text/html]
* journal-gatewayd: always log oom() in addition to returning errorZbigniew Jędrzejewski-Szmek2013-01-181-1/+3
|
* journal-gatewayd: redirect microhttpd messages to journalZbigniew Jędrzejewski-Szmek2013-01-181-1/+4
| | | | | A prefix ("microhttpd: ") is added to the log lines to make it easy to distinguish the source.
* journal-gatewayd: SSL supportZbigniew Jędrzejewski-Szmek2013-01-181-15/+105
| | | | | | For now the certificates are passed around as options to the program. This might not be the most convenient under "production", but makes for fairly easy testing.
* journal-gatewayd: unify two code pathsZbigniew Jędrzejewski-Szmek2013-01-181-11/+11
| | | | | In preparation for adding more options, split out the option handling code.
* journal-gatewayd: minor cleanupZbigniew Jędrzejewski-Szmek2012-11-251-2/+1
|
* remove duplicate semicolonsThomas Hindoe Paaboel Andersen2012-11-121-2/+2
|
* journal: add high-level match option to filter by current boot idLennart Poettering2012-10-181-0/+32
|
* journal: add ability to list unique fields to gatewaydLennart Poettering2012-10-181-0/+153
|
* journal-gatewayd: rename variables to avoid -Wshadow warningZbigniew Jędrzejewski-Szmek2012-10-131-12/+12
|
* journal: support epxorting the journal in a format suitable for ↵Lennart Poettering2012-10-111-1/+4
| | | | text/event-stream
* journal: when browsing the journal via browse.html allow clicking on entries ↵Lennart Poettering2012-10-101-0/+38
| | | | to show their details
* journal: fix seeking backwards in gateway daemonLennart Poettering2012-10-101-17/+4
|
* journal: implement follow mode for HTTP GET in gatewaydLennart Poettering2012-10-091-1/+31
|
* journal: add matching support to gatewaydLennart Poettering2012-10-091-0/+50
|
* journald: assert target instead of pageLukas Nykryn2012-10-021-1/+1
| | | | page is a local, yet unitialized, variable.
* journal: add minimal journal gateway daemon based on GNU libmicrohttpdLennart Poettering2012-09-281-0/+623
This minimal HTTP server can serve journal data via HTTP. Its primary purpose is synchronization of journal data across the network. It serves journal data in three formats: text/plain: the text format known from /var/log/messages application/json: the journal entries formatted as JSON application/vnd.fdo.journal: the binary export format of the journal The HTTP server also serves a small HTML5 app that makes use of the JSON serialization to present the journal data to the user. Examples: This downloads the journal in text format: # systemctl start systemd-journal-gatewayd.service # wget http://localhost:19531/entries Same for JSON: # curl -H"Accept: application/json" http://localhost:19531/entries Access via web browser: $ firefox http://localhost:19531/