chiark / gitweb /
journal-gatewayd,man: document new HTTPS options
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 18 Jan 2013 06:41:01 +0000 (01:41 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 18 Jan 2013 06:41:01 +0000 (01:41 -0500)
man/systemd-journal-gatewayd.service.xml
src/journal/journal-gatewayd.c

index 562d22186b732da3ab4f3d5f0b14f4c730f87cc5..37b39c2d3ef0341362b221a7aa4feccf5671f174 100644 (file)
@@ -52,7 +52,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
   <refsynopsisdiv>
     <para><filename>systemd-journal-gatewayd.service</filename></para>
     <para><filename>systemd-journal-gatewayd.socket</filename></para>
-    <cmdsynopsis><command>/usr/lib/systemd/systemd-journal-gatewayd</command>
+    <cmdsynopsis>
+      <command>/usr/lib/systemd/systemd-journal-gatewayd</command>
+      <arg choice="opt" rep="repeat">OPTIONS</arg>
     </cmdsynopsis>
   </refsynopsisdiv>
 
@@ -61,7 +63,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
 
     <para><command>systemd-journal-gatewayd</command> serves journal
     events over the network. Clients must connect using
-    HTTP. The server listens on port 19531 by default.</para>
+    HTTP. The server listens on port 19531 by default.
+    If <option>--cert=</option> is specified, the server expects
+    HTTPS connections.</para>
 
     <para>The program is started by
     <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
@@ -71,6 +75,48 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>.
     to have it started on boot.</para>
   </refsect1>
 
+  <refsect1>
+    <title>Options</title>
+
+    <para>The following options are understood:</para>
+
+    <variablelist>
+      <varlistentry>
+        <term><option>--help</option></term>
+        <term><option>-h</option></term>
+
+        <listitem><para>Prints a short help
+        text and exits.</para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>--version</option></term>
+
+        <listitem><para>Prints a short version
+        string and exits.</para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>--cert=</option></term>
+
+        <listitem><para>Specify the path to a file containing a server
+        certificate in PEM format. This option switches
+        <command>systemd-journal-gatewayd</command> into HTTPS mode
+        and must be used together with
+        <option>--key=</option>.</para></listitem>
+      </varlistentry>
+
+      <varlistentry>
+        <term><option>--key=</option></term>
+
+        <listitem><para>Specify the path to a file containing a server
+        key in PEM format corresponding to the certificate specified
+        with <option>--cert=</option>.</para></listitem>
+      </varlistentry>
+
+    </variablelist>
+  </refsect1>
+
   <refsect1>
     <title>Supported URLs</title>
 
index 4a4905dbfb8b94dd4498879c1e8d104b340269fd..dfec8352bb91e3092bba134f22dc8c01251a89f9 100644 (file)
@@ -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");