Deprecate daemon mode without explicit mode flag

This commit is contained in:
AsamK 2024-01-30 17:44:51 +01:00
parent 080c14d111
commit 2ab5b2817e
4 changed files with 17 additions and 16 deletions

View file

@ -8,7 +8,7 @@ After=network-online.target
[Service] [Service]
Type=dbus Type=dbus
Environment="SIGNAL_CLI_OPTS=-Xms2m" Environment="SIGNAL_CLI_OPTS=-Xms2m"
ExecStart=%dir%/bin/signal-cli --config /var/lib/signal-cli daemon --system ExecStart=%dir%/bin/signal-cli --config /var/lib/signal-cli daemon --dbus-system
User=signal-cli User=signal-cli
BusName=org.asamk.Signal BusName=org.asamk.Signal

View file

@ -8,7 +8,7 @@ After=network-online.target
[Service] [Service]
Type=dbus Type=dbus
Environment="SIGNAL_CLI_OPTS=-Xms2m" Environment="SIGNAL_CLI_OPTS=-Xms2m"
ExecStart=%dir%/bin/signal-cli -a %I --config /var/lib/signal-cli daemon --system ExecStart=%dir%/bin/signal-cli -a %I --config /var/lib/signal-cli daemon --dbus-system
User=signal-cli User=signal-cli
BusName=org.asamk.Signal BusName=org.asamk.Signal

View file

@ -25,7 +25,7 @@ For this use-case, it has a dbus and a JSON-RPC interface, that can be used to s
For some functionality the Signal protocol requires that all messages have been received from the server. For some functionality the Signal protocol requires that all messages have been received from the server.
The `receive` command should be regularly executed. The `receive` command should be regularly executed.
In daemon mode messages are continuously received. In daemon mode messages are by default continuously received.
== Options == Options
@ -720,16 +720,9 @@ Alternatively, specify the group IDs for which to get the attachment.
=== daemon === daemon
signal-cli can run in daemon mode and provides an experimental dbus or JSON-RPC interface. signal-cli can run in daemon mode and provides JSON-RPC or an experimental dbus interface.
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 loaded.
Multiple interfaces can be used at the same time, e.g. `daemon --socket --dbus`
*--dbus*::
Export DBus interface on user bus. +
See **signal-cli-dbus**(5) for info on the dbus interface.
*--dbus-system*::
Export DBus interface on system bus. +
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). +
@ -744,6 +737,14 @@ Expose a JSON-RPC interface as http endpoint (default localhost:8080).
The JSON-RPC endpoint is `/api/v1/rpc`. + The JSON-RPC endpoint is `/api/v1/rpc`. +
See **signal-cli-jsonrpc**(5) for info on the JSON-RPC interface. See **signal-cli-jsonrpc**(5) for info on the JSON-RPC interface.
*--dbus*::
Export DBus interface on user bus. +
See **signal-cli-dbus**(5) for info on the dbus interface.
*--dbus-system*::
Export DBus interface on system bus. +
See **signal-cli-dbus**(5) for info on the dbus interface.
*--ignore-attachments*:: *--ignore-attachments*::
Dont download attachments of received messages. Dont download attachments of received messages.

View file

@ -46,9 +46,7 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
public void attachToSubparser(final Subparser subparser) { public void attachToSubparser(final Subparser subparser) {
final var defaultSocketPath = new File(new File(IOUtils.getRuntimeDir(), "signal-cli"), "socket"); final var defaultSocketPath = new File(new File(IOUtils.getRuntimeDir(), "signal-cli"), "socket");
subparser.help("Run in daemon mode and provide a JSON-RPC or an experimental dbus interface."); subparser.help("Run in daemon mode and provide a JSON-RPC or an experimental dbus interface.");
subparser.addArgument("--dbus") subparser.addArgument("--dbus").action(Arguments.storeTrue()).help("Expose a DBus interface on the user bus.");
.action(Arguments.storeTrue())
.help("Expose a DBus interface on the user bus (the default, if no other options are given).");
subparser.addArgument("--dbus-system", "--system") subparser.addArgument("--dbus-system", "--system")
.action(Arguments.storeTrue()) .action(Arguments.storeTrue())
.help("Expose a DBus interface on the system bus."); .help("Expose a DBus interface on the system bus.");
@ -190,6 +188,8 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
&& httpAddress == null && httpAddress == null
&& inheritedChannel == null && inheritedChannel == null
)) { )) {
logger.warn(
"Running daemon command without explicit mode is deprecated. Use --dbus to use the dbus interface.");
daemonHandler.runDbus(false); daemonHandler.runDbus(false);
} }
} }