]> nmode's Git Repositories - signal-cli/commitdiff
Deprecate daemon mode without explicit mode flag
authorAsamK <asamk@gmx.de>
Tue, 30 Jan 2024 16:44:51 +0000 (17:44 +0100)
committerAsamK <asamk@gmx.de>
Tue, 30 Jan 2024 16:44:51 +0000 (17:44 +0100)
data/signal-cli.service
data/signal-cli@.service
man/signal-cli.1.adoc
src/main/java/org/asamk/signal/commands/DaemonCommand.java

index 1e4a5a5cd4ccf7e969a7935b05234f8ca971984f..a0bba76825f659dff6f82497312788abe6cfac2c 100644 (file)
@@ -8,7 +8,7 @@ After=network-online.target
 [Service]
 Type=dbus
 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
 BusName=org.asamk.Signal
 
index d96352e8d3d94cda4ae9ca62616b4c1b134f35a4..c5698ca7dee8b91877f86a6320dd68eaafbaca53 100644 (file)
@@ -8,7 +8,7 @@ After=network-online.target
 [Service]
 Type=dbus
 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
 BusName=org.asamk.Signal
 
index bd855ab43d19c90f8abcb5f6f6790fb1321d813d..7bc1790579d0514b95dd7e274b0890cfb7bb1178 100644 (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.
 The `receive` command should be regularly executed.
-In daemon mode messages are continuously received.
+In daemon mode messages are by default continuously received.
 
 == Options
 
@@ -720,16 +720,9 @@ Alternatively, specify the group IDs for which to get the attachment.
 
 === daemon
 
-signal-cli can run in daemon mode and provides an experimental dbus or JSON-RPC interface.
-If no `-a` account is given, all local accounts will be exported as separate dbus objects under the same bus name.
-
-*--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.
+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 loaded.
+Multiple interfaces can be used at the same time, e.g. `daemon --socket --dbus`
 
 *--socket [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`. +
 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*::
 Don’t download attachments of received messages.
 
index 561ee8c32873156c6c932626c4b889434b28750d..f4d701b1e731d1783bdcf1820fb0b44bcaeadcac 100644 (file)
@@ -46,9 +46,7 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
     public void attachToSubparser(final Subparser subparser) {
         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.addArgument("--dbus")
-                .action(Arguments.storeTrue())
-                .help("Expose a DBus interface on the user bus (the default, if no other options are given).");
+        subparser.addArgument("--dbus").action(Arguments.storeTrue()).help("Expose a DBus interface on the user bus.");
         subparser.addArgument("--dbus-system", "--system")
                 .action(Arguments.storeTrue())
                 .help("Expose a DBus interface on the system bus.");
@@ -190,6 +188,8 @@ public class DaemonCommand implements MultiLocalCommand, LocalCommand {
                         && httpAddress == null
                         && inheritedChannel == null
         )) {
+            logger.warn(
+                    "Running daemon command without explicit mode is deprecated. Use --dbus to use the dbus interface.");
             daemonHandler.runDbus(false);
         }
     }