mirror of
https://github.com/systemd/systemd.git
synced 2024-11-23 18:23:32 +08:00
journal-gatewayd,man: document new HTTPS options
This commit is contained in:
parent
a93035cee3
commit
c3a7cfb7de
@ -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>
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user