mirror of
https://github.com/AsamK/signal-cli.git
synced 2026-09-01 06:28:11 +00:00
Updated DBus service (markdown)
parent
c322d64bc7
commit
26e16cdf19
@ -39,36 +39,6 @@ Example with `dbus-send`:
|
||||
dbus-send --session --type=method_call --print-reply --dest="org.asamk.Signal" /org/asamk/Signal org.asamk.Signal.sendMessage string:MessageText array:string: string:RECIPIENT
|
||||
|
||||
|
||||
### Multiple system buses
|
||||
|
||||
As an extension to [System Bus](DBus-service#system-bus), you can run multiple daemons with different bus names by providing the `--busname` parameter. In this guide we use the bus naming scheme 'org.asamk.Signal_NUMBER' where NUMBER is the user number **without** the leading + sign.
|
||||
|
||||
Again, the following steps assume you created a user named *signal-cli*.
|
||||
For each (named) system bus, a config file is needed to allow the signal-cli user to take a name on the system bus. An template config file can be found in `data/org.asamk.Signal_NUMBER.conf`. This file also configures that any user can talk with the signal-cli daemon.
|
||||
|
||||
The `data/signal-cli@.service` file configures a systemd service template that takes the NUMBER as argument. We start each service when systemd's _multi-user.target_ is reached.
|
||||
|
||||
Executed these commands **once** as root to provide the signal-cli systemd service:
|
||||
```bash
|
||||
sed -e "s|%dir%|<INSERT_INSTALL_PATH>|" data/signal-cli@.service > /etc/systemd/system/signal-cli@.service
|
||||
systemctl daemon-reload
|
||||
```
|
||||
Mind the fact that signal.service executes the signal-cli with "--config /var/lib/signal-cli".
|
||||
If you registered with user signal-cli, remove the config option.
|
||||
|
||||
Executed these commands **for each number** as root to provide the corresponding dbus configuration:
|
||||
```bash
|
||||
sed -e "s|%number%|<INSERT_YOUR_NUMBER>|" data/org.asamk.Signal_NUMBER.conf > /etc/dbus-1/system.d/org.asamk.Signal_<INSERT_YOUR_NUMBER>.conf
|
||||
|
||||
systemctl reload dbus.service
|
||||
|
||||
systemctl enable signal-cli@<INSERT_YOUR_NUMBER>.service
|
||||
systemctl start signal-cli@<INSERT_YOUR_NUMBER>.service
|
||||
```
|
||||
Make sure to use "--dbus-system" and "--dbusname 'org.asamk.Signal_NUMBER'" with the send command:
|
||||
|
||||
```signal-cli --dbus-system --busname "org.asamk.Signal_<INSERT_YOUR_NUMBER>" send -m "Message" [RECIPIENT [RECIPIENT ...]] [-a [ATTACHMENT [ATTACHMENT ...]]]```
|
||||
|
||||
### Receive messages from signal-cli daemon
|
||||
The signal-cli daemon publishes new messages to dbus.
|
||||
Here's an example using python:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user