Update man page

This commit is contained in:
AsamK 2022-11-02 17:46:20 +01:00
parent 1ad0e94b64
commit c628e27d2e
5 changed files with 59 additions and 49 deletions

View File

@ -5,6 +5,7 @@ vim:set ts=4 sw=4 tw=82 noet:
:quotes.~: :quotes.~:
= signal-cli-dbus (5) = signal-cli-dbus (5)
:doctype: manpage
== Name == Name

View File

@ -5,6 +5,7 @@ vim:set ts=4 sw=4 tw=82 noet:
:quotes.~: :quotes.~:
= signal-cli-jsonrpc (5) = signal-cli-jsonrpc (5)
:doctype: manpage
== Name == Name

View File

@ -5,6 +5,7 @@ vim:set ts=4 sw=4 tw=82 noet:
:quotes.~: :quotes.~:
= signal-cli (1) = signal-cli (1)
:doctype: manpage
== Name == Name
@ -601,7 +602,7 @@ The primary device will respond with synchronization messages with full contact
=== uploadStickerPack === uploadStickerPack
Upload a new sticker pack, consisting of a manifest file and the sticker images. Upload a new sticker pack, consisting of a manifest file and the sticker images. +
Images must conform to the following specification: (see https://support.signal.org/hc/en-us/articles/360031836512-Stickers#sticker_reqs ) Images must conform to the following specification: (see https://support.signal.org/hc/en-us/articles/360031836512-Stickers#sticker_reqs )
- Static stickers in PNG or WebP format - Static stickers in PNG or WebP format
@ -657,20 +658,25 @@ signal-cli can run in daemon mode and provides an experimental dbus or JSON-RPC
If no `-a` account is given, all local accounts will be exported as separate dbus objects under the same bus name. If no `-a` account is given, all local accounts will be exported as separate dbus objects under the same bus name.
*--dbus*:: *--dbus*::
Export DBus interface on user bus. Export DBus interface on user bus. +
See signal-cli-dbus (5) for info on the dbus interface. See **signal-cli-dbus**(5) for info on the dbus interface.
*--dbus-system*:: *--dbus-system*::
Export DBus interface on system bus. Export DBus interface on system bus. +
See signal-cli-dbus (5) for info on the dbus interface. See **signal-cli-dbus**(5) for info on the dbus interface.
*--socket [SOCKET]*:: *--socket [SOCKET]*::
Export a JSON-RPC interface on a UNIX socket (default $XDG_RUNTIME_DIR/signal-cli/socket). Export a JSON-RPC interface on a UNIX socket (default $XDG_RUNTIME_DIR/signal-cli/socket). +
See signal-cli-jsonrpc (5) for info on the JSON-RPC interface. See **signal-cli-jsonrpc**(5) for info on the JSON-RPC interface.
*--tcp [HOST:PORT]*:: *--tcp [HOST:PORT]*::
Export a JSON-RPC interface on a TCP socket (default localhost:7583). Export a JSON-RPC interface on a TCP socket (default localhost:7583). +
See signal-cli-jsonrpc (5) for info on the JSON-RPC interface. See **signal-cli-jsonrpc**(5) for info on the JSON-RPC interface.
*--http [HOST:PORT]*::
Expose a JSON-RPC interface as http endpoint (default localhost:8080).
The JSON-RPC endpoint is `/api/v1/rpc`. +
See **signal-cli-jsonrpc**(5) for info on the JSON-RPC interface.
*--ignore-attachments*:: *--ignore-attachments*::
Dont download attachments of received messages. Dont download attachments of received messages.

View File

@ -73,7 +73,7 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
subparser.addArgument("--http") subparser.addArgument("--http")
.nargs("?") .nargs("?")
.setConst("localhost:8080") .setConst("localhost:8080")
.help("Expose a JSON-RPC interface as http endpoint."); .help("Expose a JSON-RPC interface as http endpoint (default localhost:8080).");
subparser.addArgument("--no-receive-stdout") subparser.addArgument("--no-receive-stdout")
.help("Dont print received messages to stdout.") .help("Dont print received messages to stdout.")
.action(Arguments.storeTrue()); .action(Arguments.storeTrue());

View File

@ -70,8 +70,9 @@ public class HttpServerHandler {
}); });
final var jsonRpcReader = new JsonRpcReader(jsonRpcSender, httpExchange.getRequestBody()); final var jsonRpcReader = new JsonRpcReader(jsonRpcSender, httpExchange.getRequestBody());
jsonRpcReader.readMessages((method, params) -> commandHandler.handleRequest(objectMapper, method, params), jsonRpcReader.readMessages((method, params) -> commandHandler.handleRequest(objectMapper,
response -> logger.debug("Received unexpected response for id {}", response.getId())); method,
params), response -> logger.debug("Received unexpected response for id {}", response.getId()));
if (result[0] != null) { if (result[0] != null) {
sendResponse(200, result[0], httpExchange); sendResponse(200, result[0], httpExchange);
@ -79,12 +80,13 @@ public class HttpServerHandler {
sendResponse(201, null, httpExchange); sendResponse(201, null, httpExchange);
} }
} } catch (Throwable aEx) {
catch (Throwable aEx) {
logger.error("Failed to process request.", aEx); logger.error("Failed to process request.", aEx);
sendResponse(200, JsonRpcResponse.forError( sendResponse(200,
new JsonRpcResponse.Error(JsonRpcResponse.Error.INTERNAL_ERROR, JsonRpcResponse.forError(new JsonRpcResponse.Error(JsonRpcResponse.Error.INTERNAL_ERROR,
"An internal server error has occurred.", null), null), httpExchange); "An internal server error has occurred.",
null), null),
httpExchange);
} }
}); });