From: Zbigniew Jędrzejewski-Szmek Date: Fri, 18 Jan 2013 06:41:01 +0000 (-0500) Subject: journal-gatewayd,man: document new HTTPS options X-Git-Tag: v198~475 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=c3a7cfb7dee251cab01e98a399e7d2a0f787b6b9 journal-gatewayd,man: document new HTTPS options --- diff --git a/man/systemd-journal-gatewayd.service.xml b/man/systemd-journal-gatewayd.service.xml index 562d22186..37b39c2d3 100644 --- a/man/systemd-journal-gatewayd.service.xml +++ b/man/systemd-journal-gatewayd.service.xml @@ -52,7 +52,9 @@ along with systemd; If not, see . systemd-journal-gatewayd.service systemd-journal-gatewayd.socket - /usr/lib/systemd/systemd-journal-gatewayd + + /usr/lib/systemd/systemd-journal-gatewayd + OPTIONS @@ -61,7 +63,9 @@ along with systemd; If not, see . systemd-journal-gatewayd serves journal events over the network. Clients must connect using - HTTP. The server listens on port 19531 by default. + HTTP. The server listens on port 19531 by default. + If is specified, the server expects + HTTPS connections. The program is started by systemd1 @@ -71,6 +75,48 @@ along with systemd; If not, see . to have it started on boot. + + Options + + The following options are understood: + + + + + + + Prints a short help + text and exits. + + + + + + Prints a short version + string and exits. + + + + + + Specify the path to a file containing a server + certificate in PEM format. This option switches + systemd-journal-gatewayd into HTTPS mode + and must be used together with + . + + + + + + Specify the path to a file containing a server + key in PEM format corresponding to the certificate specified + with . + + + + + Supported URLs diff --git a/src/journal/journal-gatewayd.c b/src/journal/journal-gatewayd.c index 4a4905dbf..dfec8352b 100644 --- a/src/journal/journal-gatewayd.c +++ b/src/journal/journal-gatewayd.c @@ -862,6 +862,19 @@ static int request_handler( return respond_error(connection, MHD_HTTP_NOT_FOUND, "Not found.\n"); } +static int help(void) { + + printf("%s [OPTIONS...] ...\n\n" + "HTTP server for journal events.\n\n" + " -h --help Show this help\n" + " --version Show package version\n" + " --cert=CERT.PEM Specify server certificate in PEM format\n" + " --key=KEY.PEM Specify server key in PEM format\n", + program_invocation_short_name); + + return 0; +} + static char *key_pem = NULL; static char *cert_pem = NULL; @@ -875,6 +888,7 @@ static int parse_argv(int argc, char *argv[]) { int r, c; static const struct option options[] = { + { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, ARG_VERSION }, { "key", required_argument, NULL, ARG_KEY }, { "cert", required_argument, NULL, ARG_CERT }, @@ -884,13 +898,16 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) switch(c) { case ARG_VERSION: puts(PACKAGE_STRING); puts(SYSTEMD_FEATURES); return 0; + case 'h': + return help(); + case ARG_KEY: if (key_pem) { log_error("Key file specified twice");