Code Monkey home page Code Monkey logo

signal-cli-rest-api's Introduction

Dockerized Signal Messenger REST API

This project creates a small dockerized REST API around signal-cli.

At the moment, the following functionality is exposed via REST:

  • Register a number
  • Verify the number using the code received via SMS
  • Send message (+ attachments) to multiple recipients (or a group)
  • Receive messages
  • Link devices
  • Create/List/Remove groups
  • List/Serve/Delete attachments
  • Update profile

and many more

Getting started

  1. Create a directory for the configuration This allows you to update signal-cli-rest-api by just deleting and recreating the container without the need to re-register your signal number
$ mkdir -p $HOME/.local/share/signal-api
  1. Start a container
$ sudo docker run -d --name signal-api --restart=always -p 8080:8080 \
      -v $HOME/.local/share/signal-api:/home/.local/share/signal-cli \
      -e 'MODE=native' bbernhard/signal-cli-rest-api
  1. Register or Link your Signal Number

In this case we'll register our container as secondary device, assuming that you already have your primary number running / assigned to your mobile.

Therefore open http://localhost:8080/v1/qrcodelink?device_name=signal-api in your browser, open Signal on your mobile phone, go to Settings > Linked devices and scan the QR code using the + button.

  1. Test your new REST API

Call the REST API endpoint and send a test message: Replace +4412345 with your signal number in international number format, and +44987654 with the recipients number.

$ curl -X POST -H "Content-Type: application/json" 'http://localhost:8080/v2/send' \
     -d '{"message": "Test via Signal API!", "number": "+4412345", "recipients": [ "+44987654" ]}'

You should now have send a message to +44987654.

Execution Modes

The signal-cli-rest-api supports three different modes of execution, which can be controlled by setting the MODE environment variable.

  • normal Mode: (Default) The signal-cli executable is invoked for every REST API request. Being a Java application, each REST call requires a new startup of the JVM (Java Virtual Machine), increasing the latency and hence leading to the slowest mode of operation.
  • native Mode: A precompiled binary signal-cli-native (using GraalVM) is used for every REST API request. This results in a much lower latency & memory usage on each call. On the armv7 platform this mode is not available and falls back to normal. The native mode may also be less stable, due to the experimental state of GraalVM compiler.
  • json-rpc Mode: A single, JVM-based signal-cli instance is spawned as daemon process. This mode is usually the fastest, but requires more memory as the JVM keeps running.
mode speed resident memory usage
normal ✔️ normal
native ✔️ ✔️ normal
json-rpc ✔️ ✔️ ✔️ increased

Example of running signal-cli-rest in native mode

$ sudo docker run -d --name signal-api --restart=always -p 9922:8080 \
              -v /home/user/signal-api:/home/.local/share/signal-cli \
              -e 'MODE=native' bbernhard/signal-cli-rest-api

This launches a instance of the REST service accessible under http://localhost:9922/v2/send. To preserve the Signal number registration, i.e. for updates, the storage location for the signal-cli configuration is mapped as Docker Volume into a local /home/user/signal-api directory.

Auto Receive Schedule

⚠️ This setting is only needed in normal/native mode!

signal-cli, which this REST API wrapper is based on, recommends to call receive on a regular basis. So, if you are not already calling the receive endpoint regularly, it is recommended to set the AUTO_RECEIVE_SCHEDULE parameter in the docker-compose.yml file. The AUTO_RECEIVE_SCHEDULE accepts cron schedule expressions and automatically calls the receive endpoint at the given time. e.g: 0 22 * * * calls receive daily at 10pm. If you are not familiar with cron schedule expressions, you can use this website.

WARNING Calling receive will fetch all the messages for the registered Signal number from the Signal Server! So, if you are using the REST API for receiving messages, it's not a good idea to use the AUTO_RECEIVE_SCHEDULE parameter, as you might lose some messages that way.

Example

Sample docker-compose.ymlfile:

version: "3"
services:
  signal-cli-rest-api:
    image: bbernhard/signal-cli-rest-api:latest
    environment:
      - MODE=normal #supported modes: json-rpc, native, normal
      #- AUTO_RECEIVE_SCHEDULE=0 22 * * * #enable this parameter on demand (see description below)
    ports:
      - "8080:8080" #map docker port 8080 to host port 8080.
    volumes:
      - "./signal-cli-config:/home/.local/share/signal-cli" #map "signal-cli-config" folder on host system into docker container. the folder contains the password and cryptographic keys when a new number is registered

Documentation & Usage

API Reference

The Swagger API documentation can be found here. If you prefer a simple text file based API documentation have a look here.

Blog Posts

Clients, Libraries and Scripts

Name Type Language Description Maintainer
pysignalclirestapi Library Python Small python library @bbernhard
signalbot Library Python Framework to build Signal bots @filipre
signal-cli-to-file Script JavaScript Save incoming signal messages as files @jneidel

In case you need more functionality, please file a ticket or create a PR.

Advanced Settings

There are a bunch of environmental variables that can be set inside the docker container in order to change some technical details. This settings are meant for developers and advanced users. Usually you do not need to change anything here - the default values are perfectly fine!

  • SIGNAL_CLI_CONFIG_DIR: Specifies the path to the signal-cli config directory inside the docker container. Defaults to /home/.local/share/signal-cli/

  • SIGNAL_CLI_UID: Specifies the uid of the signal-api user inside the docker container. Defaults to 1000

  • SIGNAL_CLI_GID: Specifies the gid of the signal-api group inside the docker container. Defaults to 1000

  • SWAGGER_HOST: The host that's used in the Swagger UI for the interactive examples (and useful when this runs behind a reverse proxy). Defaults to SWAGGER_IP:PORT.

  • SWAGGER_IP: The IP that's used in the Swagger UI for the interactive examples. Defaults to the container ip.

  • PORT: Defaults to port 8080 unless this env var is set to tell it otherwise.

signal-cli-rest-api's People

Contributors

ahatius avatar akloeckner avatar bbernhard avatar bentolor avatar brozikcz avatar danijelst avatar dependabot[bot] avatar developersteve avatar filipre avatar fl42 avatar funkybunch avatar greyson-signal avatar haberda avatar jarrah31 avatar jneidel avatar jokay avatar k-bx avatar lkwg82 avatar marvinruder avatar matovidlo avatar mattwr18 avatar mdegat01 avatar richtier avatar robin-thoni avatar roschaefer avatar stilsch avatar testwill avatar vorwd avatar webzit avatar zeetabit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

signal-cli-rest-api's Issues

Version 0.30 is not working

I have upgrade to the latest version and now it is not working anymore.

The log files show the following error:

+ set -e
+ chown 1000:1000 -R /home/.local/share/signal-cli
+ cat
+ exec setpriv --reuid=1000 --regid=1000 --init-groups --inh-caps=-all signal-cli-rest-api
setpriv: libcap-ng is too old for "all" caps

Feature link devices

It would be great to support the feature of linking devices so we can use my number.

The signal-cli already supports this. So I enter on the docker container instance.
docker exec -it -u 0 NameOfContainer bash
and generate the link code signal-cli link -n "signal-laptop"
It generate +- a String like this tsdevice:/\?uuid=asdfghjkl\&pub_key=qwertyuiop

Then I generate a picture (QR-Code) with https://linux.die.net/man/1/qrencode
qrencode -o linkqr.png tsdevice:/\?uuid=asdfghjkl\&pub_key=qwertyuiop
Which I scan with my Android device

After that, I was able to send messages via signal-cli from inside of the container instance. (Too good to be true.) When I call the API (signal-cli-rest-api) it did not work as I wanted, it gave some errors.

I never tried to write in go. So I don't know if I'm going to try to do this.
Also, I don't really need it. Was just playing around here.

This API makes really easy to integrate other stuff.
Thanks @bbernhard

Error: Verification failed! This number is locked with a pin

I have a PIN in use for my Signal account. When I run the curl commands to apply the verification code, I get the following:

{"error":"Verification failed! This number is locked with a pin. Hours remaining until reset: 150\nUse '--pin PIN_CODE' to specify the registration lock PIN\n"}

What is the syntax I need when running the following that results in the error?
curl -X POST -H "Content-Type: application/json" 'http://192.168.x.y:1234/v1/register/+1816xxxyyyy/verify/123-123'

Feature Request for Receive

Sorry this isn't an issue, I saw at the bottom you mentioned to create a pull request for new functionality but I'm unsure how to do that, would there be any chance to implement receiving messages, I've attempted to use signal-cli inside the container to receive but i get unregistered error.

Thank you

Can't send messages from Home Assistant after linking device

I first had issues with my phone number being locked by a pin in Signal (#22).

I managed to use signal-cli link -n HomeAssistant to get the data for a QR code, which I converted and scanned with my mobile phone's Signal app. (see)
signal-cli -u +<phone> receive now works and I can send messages via signal-cli -u +<phone> send -m "<message>" <recipient>

I don't seem to need to verify my number anymore

root@abcdef-signal-messenger:/# signal-cli -u +<phone> verify -p <pin> <verification>
User registration is already verified

However, I can't send notifications from Home Assistant

notify:
  - name: Signal_me
    platform: signal_messenger
    url: "http://192.168.10.105:8080" # service not reachable at 127.0.0.1?
    number: "+<phone>"
    recipients:
      - "+<phone>"

Developer tools:

Service: notify.signal_me
Data: message: "Lorum ipsum"

image

Add-on logs

[GIN] 2020/10/27 - 16:37:35 | 200 |      55.424µs |  192.168.10.105 | GET      "/v1/about"
[GIN] 2020/10/27 - 16:37:39 | 400 |  4.665510344s |  192.168.10.105 | POST     "/v2/send"

HA logs

Logger: homeassistant.components.websocket_api.http.connection.139716746907808
Source: components/signal_messenger/notify.py:76
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 15:23:18 (6 occurrences)
Last logged: 15:37:39
Failed to get sender certificate: org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException: Authorization failed! Failed to send message: Authorization failed!

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 138, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1335, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1370, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 138, in _async_notify_message_service
    await self.async_send_message(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 117, in async_send_message
    await self.hass.async_add_job(partial(self.send_message, message, **kwargs))  # type: ignore
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/signal_messenger/notify.py", line 79, in send_message
    raise ex
  File "/usr/src/homeassistant/homeassistant/components/signal_messenger/notify.py", line 76, in send_message
    self._signal_cli_rest_api.send_message(message, self._recp_nrs, filenames)
  File "/usr/local/lib/python3.8/site-packages/pysignalclirestapi/api.py", line 83, in send_message
    raise exc
  File "/usr/local/lib/python3.8/site-packages/pysignalclirestapi/api.py", line 79, in send_message
    raise SignalCliRestApiError(json_resp["error"])
pysignalclirestapi.api.SignalCliRestApiError: Failed to get sender certificate: org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException: Authorization failed!
Failed to send message: Authorization failed!
Logger: homeassistant.components.signal_messenger.notify
Source: components/signal_messenger/notify.py:78
Integration: signal_messenger (documentation, issues)
First occurred: 15:23:18 (6 occurrences)
Last logged: 15:37:39
Failed to get sender certificate: org.whispersystems.signalservice.api.push.exceptions.AuthorizationFailedException: Authorization failed! Failed to send message: Authorization failed! 

Home Assistant signal_messenger integration improvement

bbernhard, do you think it's possible to implement the following in Home Assistant's signal_messenger integration?

  • specify attachment as an URL to a picture
  • specify multiple attachments per message

Reasons:

  • security cameras often natively offer a direct access to a snapsot on a simple http URL, no need to download the picture to the filesystem first and attach from there (it's possible in the Telegram integration btw)
  • one would like to send a series of images from multiple cameras in a single notification event - could it be supported as a single message?

Swagger incorrect?

Hi,

it seems the send-endpoints are not correct:

/v1/send/{number}
/v2/send/{number}

sendV1.POST("", api.Send)
sendV2.POST("", api.SendV2)

Wouldn't that be
sendV1.POST(":number", api.Send)
sendV2.POST(":number", api.SendV2)
if the swagger were right?

Regards

Sending message to Group not working

I was able to install, register a phone, create a group and test it through curl and Home Assistant.
Everything works well when i send it to a phone number or list of numbers.
But sending it to a group is giving the following error.
{"error":"Failed to send message: org.whispersystems.signalservice.api.push.exceptions.NotFoundException: Not found\n"}%

Here's the output from the group listing
`
MacBook-Pro ~ % curl -X GET -H "Content-Type: application/json" 'http://homeassistant.local:8080/v1/groups/+14087824585'
[{"name":"Home Alerts","id":"group.ZkFERWhRTDMxV01wbm53ZDRhaG1Sdz09","internal_id":"fADEhQL31WMpnnwd4ahmRw==","members":["+14082421927","+14087824585"],"active":true,"blocked":false}]% MacBook-Pro ~ %
'

Then I am not sure what exactly is the ID that I should pass in for the group, but I tried all 3 options
'
MacBook-Pro ~ % curl -X POST -H "Content-Type: application/json" -d '{"message": "Hello World!", "number": "+14087824585", "recipients": ["group.ZkFERWhRTDMxV01wbm53ZDRhaG1Sdz08"]}' 'http://homeassistant.local:8080/v1/send'
{"error":"Failed to send message: org.whispersystems.signalservice.api.push.exceptions.NotFoundException: Not found\n"}% MacBook-Pro ~ %
'
I also tried passing in ZkFERWhRTDMxV01wbm53ZDRhaG1Sdz08 as well as the internal ID. But all give the same error.

On the phone, I can see that the group is created as a "Legacy Group"

Any help appreciated.

Binary for usage without Docker?

Do you plan to provide a binary for usage without docker? Preferably with a configurable path to the config directory? I tried to compile myself, but always end up with

# command-line-arguments
./main.go:64:10: assignment mismatch: 2 variables but 1 values

I'm a bit reluctant to set up docker and pull an 1,3 GB image only for this usecase (wrapper of a Signal API wrapper ;-), as I prefer the "classical" way of installing programs, especially on low-end devices. (Moreover, for me the docker container always exits with "0" doing nothing, and I'm not very good in debugging docker problems...)

Thanks for your work!

getting this : Request verify error: Bad response: 502

I'm following the Register phone number instructions but I keep getting this error in response :

➜  ~ curl -X POST -H "Content-Type: application/json" 'http://127.0.0.1:8080/v1/register/+32479033400'
{"error":"Request verify error: Bad response: 502 \n"}#

What am I doing wrong ?
PS: in case you're wondering : it ain't my real phone nr...

exited with code 0

Hi! Please help...
All I get is signal_messenger_signal-cli-rest-api_1 exited with code 0 immediately after starting with docker-compose up.
Can you please help me in determining what's going wromng?

Cannot send attachments

Hello,

since last commit 10 hours ago, I can't attach base64 documents.
URL has been updated to v2, but the message is sent without attachment. At this point I haven't changed anything else.

Then I noticed the json field name for attachment now is set to plural:
"base64_attachments": ["<base64 encoded attachment>"]

However adding this 's' throws the following error.
{"error":"Couldn't process request - invalid request"}

anything I'm not doing right?

Disappearing messages disabled by signal-cli

Hi, Bernhard. Thank you. Now I can send messages from my home server, torrent client and HA of course. It's very useful setup.
I've been set up disappearing messages at my android signal client but it disabled every time i get messages from cli.
Looks like AsamK/signal-cli support disappearing messages, but necessary condition for this Is receive message command.

Is it possible add disappearing messages at your project?
Maybe this setting is somewhere in the configuration file?

photo_2020-01-17_09-32-34

Ability to use systemd-service / experimental dbus-interface

If you're using signal-cli not only for HomeAssistant, but also for registering other numbers for "stand-alone desktop instances", it might make sense to have signal-cli running as a systemd-service.
https://github.com/AsamK/signal-cli/wiki/DBus-service
E.g. this makes it possible to synchronize contacts with the coupled instance, and, according to some web pages, is "useful to keep the keys in sync".
Is this possible with the dockerized image, too?

Unable to create groups

Im running latest stable home assistant on latest homeassistant os, installed this addon from the repository.

I was able to register a phone number, fetching messages and sending messages to numbers via automations works just fine. However, when i try to create a group using (numbers obfuscated):

curl -X POST -H "Content-Type: application/json" -d '{"name": "HAMP", "members": ["+358XXXXXXX", "+358YYYYYYY"]}' 'http://192.168.10.119:8080/v1/groups/+358ZZZZZZZZZ'

i get {"error":"Failed to send message: Unable to parse entity\n"}

Am i doing something wrong?

Couldn't determine REST API version when running as addon

After the recent update to the Home Assistant add-on, I installed version .06 and was able to get the add-on up and running and register my number and create a group. However, when I try to actually send a notification through Home Assistant I get the following stack trace:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 159, in _new_conn
    conn = connection.create_connection(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
OSError: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 392, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/http/client.py", line 1240, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1286, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1235, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1006, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.8/http/client.py", line 946, in send
    self.connect()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 187, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 171, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x6679a0a0>: Failed to establish a new connection: [Errno 113] Host is unreachable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 726, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='192.168.86.102', port=8851): Max retries exceeded with url: /v1/about (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x6679a0a0>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pysignalclirestapi/api.py", line 22, in api_info
    resp = requests.get(self._base_url + "/v1/about")
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='192.168.86.102', port=8851): Max retries exceeded with url: /v1/about (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x6679a0a0>: Failed to establish a new connection: [Errno 113] Host is unreachable'))
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 125, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1308, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1343, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 119, in async_notify_message
    await notify_service.async_send_message(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 185, in async_send_message
    await self.hass.async_add_job(partial(self.send_message, message, **kwargs))
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/signal_messenger/notify.py", line 79, in send_message
    raise ex
  File "/usr/src/homeassistant/homeassistant/components/signal_messenger/notify.py", line 76, in send_message
    self._signal_cli_rest_api.send_message(message, self._recp_nrs, filenames)
  File "/usr/local/lib/python3.8/site-packages/pysignalclirestapi/api.py", line 45, in send_message
    api_versions, build_nr = self.api_info()
  File "/usr/local/lib/python3.8/site-packages/pysignalclirestapi/api.py", line 36, in api_info
    raise SignalCliRestApiError("Couldn't determine REST API version") from exc
pysignalclirestapi.api.SignalCliRestApiError: Couldn't determine REST API version```

Can't send to 1 specific recipient, others OK.

I'm trying to send to one of my phone numbers :

➜  /config curl -X POST -H "Content-Type: application/json" -d '{"message": "Hello World!", "number": "+32123456789", "recipients": ["+32987654321"]}' 'http://127.0.0.1:8080/v2/send'
{"error":"Failed to send message: 1610795206942\nFailed to send (some) messages:\nUntrusted Identity for \"+32987654321\"\n\n"}#

That recipient number has no problems receiving messages in the Signal app for Android. (Tested by sending msg to it from other Signal apps/ numbers)
Sending from signal-cli-rest-api with the same registered number to my other recipients works just fine.
Any thoughts why that specific recipient gets marked as Untrusted when using the api ?

License

Hi, your API looks quite cool and of course I think that you want to share your code, but as you state no license, technically no one is allowed to use it (without your explicit permission).

So, I’m sorry to bother you with this legal stuff, but would you please add a license of your choice to your project?

(Side note: It get's far more weird for every user of go packages as everyone has to comply with all licenses of every used go dep as go links (mostly) statically..)

Thanks!

Port mapping problem

Hi,

I wanted to run the docker on my Synology NAS using different port than 8080:

version: "3"
services:
  signal-cli-rest-api:
    container_name: signal-cli-rest-api
    image: bbernhard/signal-cli-rest-api:latest
    ports:
      - "8090:8090"
    volumes:
      - "/volume1/docker/signal-cli-rest-api/signal-cli-config:/home/.local/share/signal-cli"
    restart: always

image

But I see this in docker logs:
image

Am I doing something wrong?

Home Assistant Add-on does not start

I am attempting to run the Home Assistant Add-on using the Add-on Store. The Add-on appears to install correctly, but when it is started the log produces the following error:

[FATAL tini (7)] exec main failed: No such file or directory

and is does not start.

I am running Home Assistant 0.113.3

Receiving 400 Response and API Timeout

I have the Docker container up and running, but I'm getting a 400 HTTP response as well as a {"error":"process killed as timeout reached"} message in the body. I haven't tried all endpoints, but /v1/about works just fine, but anytime I try to register a number it times out.

Has anyone else run into this? I'm not seeing much else in logs unfortunately. I did modify the code I'm running to run on port 3000. I'm running this on Docker Swarm and port 8080 was already in use. Are there places that port 8080 is expected that I might be missing?

A way to configure the port at build/runtime would be super helpful if that is what is causing the issue I'm having.

Safety number changed - Howto?

[not an issue but couldn't find documentation]
Hello,
upon changing phone, my safety numbers changed. As my profileKey has changed and because signal-cli sets the trust as 0 in the identityKeyStore, I don't receive messages sent by signal-cli on that phone, and signal-cli throws errors when receiving messages from that new phone.
setting the "trustLevel" to 1 after sending a message from the new phone in file .local/share/signal-cli/data/ works.
is it the way to do it?
would it be worth it to implement an api call to verify safety numbers?

Performance

Hi,

I'm using this rest api as a hassio-addon. It's really easy to use it for sending messages with home assistant.
Unfortunately sending a message is taken (too) long, approximately 10 seconds per message. When sending multiple messages after each other, things are throttling up.

Reading AsamK/signal-cli#351, there a two common causes for signal-cli's long response times: a long java virtual machine startup time, and the lack of cryptographic entropy. To avoid the JVM startup time, run signal-cli as a daemon and use dbus to interact with it; see https://github.com/AsamK/signal-cli/wiki/DBus-service.

By using the DBUS service another user got a really big improvement in performance. I already read another issue about implementing DBUS service. Is this really needed or can I do other thing to improve performance?

Thanks in advance

Is there an API call that can tell me which version is running?

I'm running the latest tag but without comparing dates it can get confusing to know which version I've pulled down and am running. I was thinking an API call could give me that info (which version of the docker container and maybe which version of the Signal CLI as well)? Maybe there's another way to get the info?

[Feature Requests] Verbose or debug mode

Hi,

I am just thinking if a verbose or debug mode with much more detailled logs would make sense?

I am currently have a issue that some messages from OMV are not sent via signal but I cannot debug.

rationale behind this project

Hi Bernhard,

thanks for making signal available to home-assistant! I really appreciate it.

I was wondering why you chose to create this rest-api wrapper around the signal-cli instead of directly calling signal-cli from home-assistant. It seems to me like a bit of an unnecessary overhead, so I was wondering if there is some rationale behind all of this that I'm missing and would be pleased if you could elaborate on this.

Thanks,
Dominik

Authentication before sending message

Hi,

I just got signal-cli-rest-api running for Home Assistant and other purposes. I really like this piece of software.

However, I just realized that using this command

curl -X POST -H "Content-Type: application/json" -d '{"message": "Hello World!", "number": "+< my number >", "recipients": ["+< recipiant number >"]}' 'http://<ip address>:8080/v2/send'

I can send signal messages from all computers that are in the same network. Security wise this is not optimal.

Would it possible to add some kind of authentication mechanism? For example a token that needs to be created and attached to the curl command in order authorize the sender.

Verify if config file access needs to be protected

Currently, we are invoking a new signal-cli process for every REST API request. Due to that it can happen that multiple signal-cli processes access the config file at the same time - leading to a potential config file corruption. Investigate whether multiple requests could lead to file corruption and check if signal-cli already protects the concurrent config file access somehow.

Growing container size due to missing cleanup for /tmp/*.{jpg,mp4} files

Thanks for providing this great glueing service, @bbernhard ! I recently praised it in my stream ;-)

I stumbled over a minor issue/annoyance: A sudo docker container ls -s reveals the following:

58f27f04c663        bbernhard/signal-cli-rest-api            "signal-cli-rest-api"    7 days ago          Up 7 days           0.0.0.0:9922->8080/tcp                           signal-api                                   118MB (virtual 2.04GB)

On inspecting with container diff reports the following situation:

$ sudo docker container diff signal-api
C /tmp
A /tmp/10096571-0b51-41ac-84cc-44bd77a6fc4e.mp4
A /tmp/193791b7-a84c-4458-823d-6120b33c6b56.jpg
…
A /tmp/c37bebc6-c6a8-40b6-92c4-c770a97bdfeb.jpg
A /tmp/dfbea440-7709-4600-9065-7ce02fe76ba7.jpg
C /tmp/hsperfdata_root
D /tmp/hsperfdata_root/57
A /tmp/2c1f1207-e9ca-47c7-b1c3-3a7dc064b792.jpg
…

A container restart does not clean them up.

After inspecting the code it seems there is also some sort of cleanup logic. Not sure where the fallthrough is lying: func cleanupTmpFiles()

For me it seems that nearly no cleanup happened at all, because the file list more or less matches all media files I yet sent via the API?!

error Captcha required for verification

Hi ! When I run the CURL post to verify phone number :
curl -X POST -H "Content-Type: application/json" 'http://192.168.255.1:8080/v1/register/+336xxxxxxxx'

I get :
{"error":"Captcha required for verification (null)\n"}

any idea ?

error This signal-cli-rest-api version is not capable of sending multiple attachments.

Error in Home Assistant after upgrading to 0.106.5

The 'attachment' option is deprecated, please replace it with 'attachments'. This option will become invalid in version 0.108.

changed 'attachment' to 'attachments' and get the following in the home assistant logs:

Unknown error for call_service at pos 1: 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 397, in async_trigger
    await self.action_script.async_run(variables, trigger_context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 247, in async_run
    await self._handle_action(action, variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 331, in _handle_action
    await self._actions[_determine_action(action)](action, variables, context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 413, in _async_call_service
    context=context,
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 101, in async_call_from_config
    domain, service_name, service_data, blocking=blocking, context=context
  File "/usr/src/homeassistant/homeassistant/core.py", line 1230, in async_call
    await asyncio.shield(self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 119, in async_notify_message
    await notify_service.async_send_message(**kwargs)
  File "/usr/src/homeassistant/homeassistant/components/notify/__init__.py", line 185, in async_send_message
    await self.hass.async_add_job(partial(self.send_message, message, **kwargs))
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/signal_messenger/notify.py", line 79, in send_message
    raise ex
  File "/usr/src/homeassistant/homeassistant/components/signal_messenger/notify.py", line 76, in send_message
    self._signal_cli_rest_api.send_message(message, self._recp_nrs, filenames)
  File "/usr/local/lib/python3.7/site-packages/pysignalclirestapi/api.py", line 38, in send_message
    raise SignalCliRestApiError("This signal-cli-rest-api version is not capable of sending multiple attachments. Please upgrade your signal-cli-rest-api docker container!")

when attempting to trigger an automation the following appears on the signal docker side:

signal-cli-rest-api_1 | [GIN] 2020/03/04 - 19:30:58 | 404 | 21.463µs | | GET /v1/about

Thanks!

Attachments download api

We have registered a number using "register" api and we are able to sent message using "send" api.

Also we could fetch messages/attachments using "receive" api and we are getting the response as below.

For eg: [{"envelope":{"source":"+919xxxx","sourceDevice":1,"relay":null,"timestamp":1610517721588,"dataMessage":{"timestamp":1610517721588,"message":null,"expiresInSeconds":0,"attachments":[{"contentType":"image/jpeg","filename":null,"id":"pwtcq-xxxx","size":366267}],"groupInfo":null},"syncMessage":null,"callMessage":null,"receiptMessage":null}}]

But we would like to know how to get/download the image by using attachments id "pwtcq-xxxx".

Is there an api to fetch the attachments (image/video/pdf)?

Hassio addon

I'd like to make this into a hassio addon. I have made a few addons in the past by dissecting docker images. The only thing holding me back is where the config files are stored in the image. Is there a way to reroute the default location inside the container to /share?

After creating /share/signal-cli folder I tried:
ENTRYPOINT ["main --signal-cli-config /share/signal-cli"]

But I get an error that the location does not exist. Maybe a permissions issue? But they seem right.

I also tried symlinking, I get no error but the folder in the container is empty.

Anyway, thanks for the awesome work!

help on getting started

Hello,
I have installed the CLI via repository on my home assistant installation.
I already have a signal account on my phone and my macbook is linked as well

I am trying to register the container with the same account but maybe I am doing something wrong?
What are the correct steps for having:
Phone
Laptop
API-Container?

Thanks

M.

Latest dev images not running on ARM (release blocker)

As you've might have noticed, the bbernhard/signal-cli-rest-api:latest tag on dockerhub hasn't been updated in a while. The reason for that is, that the "cross-built" (with docker buildx, see build script here) ARM image which is built on x86-64 doesn't work on the ARM machine.

If you want to give it a shot, just pull this bbernhard/signal-cli-rest-api:latest-dev image from dockerhub and run it on an ARM machine. When you execute a send request with curl, the request fails after 60 seconds with: "error":"process killed as timeout reached".

The reason for that is, that signal-cli inside the docker container blocks forever. This can easily be reproduced by connecting to the running docker container with docker exec -it <container id> /bin/bash and then executing signal-cli. As you can see, the signal-cli binary blocks forever.

I am still investigating, but I think it has something to do with seccomp and Ubuntu 20.04. see this reports here:

https://bugs.launchpad.net/ubuntu/+source/libseccomp/+bug/1890332
debuerreotype/docker-debian-artifacts#97

As the adoptopenjdk/openjdk11 image we are using is based on Ubuntu 20.04 and I see the same issue when doing an apt-get update inside the docker container, I guess we could run into this issue. I've tried to use strace to see where the signal-cli binary is hanging, but unfortunately it's not installed in the adoptopenjdk/openjdk11 image. But I couldn't pull the package in with apt-get due to the issue above. So I decided to start the container with --privileged and now the invocation of signal-cli works without problems.

edit: Okay, I've pretty much confirmed that it's the above issue:

If the docker container is started with

docker run -it --entrypoint /bin/bash bbernhard/signal-cli-rest-api:latest-dev

and you invoke signal-cli in there, it blocks forever.

But if you start the docker container with

docker run -it --security-opt seccomp:unconfined --entrypoint /bin/bash bbernhard/signal-cli-rest-api:latest-dev

signal-cli works.

Updating the profile seems not to work

Registration, verification and sending messages do work but updating the profile seems not work.

I used Postman and send:

Url: http://192.168.1.123:8080/v1/profi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r///e+3vibxgVcIKMOZfiZObTh3jiMJKLkLaLfb7XQ6xmosJD6q00AJKEMwMzNj/T5pATUDFVBGNwN1AtMYSfm0K5fLBkpAGYKU1ZyAjpGUZ8w5EC+gDEfKak5AC7aEF1ABZXRSTo7BDwsBBRBQhreET9mtRk6k/LDc1E5AGY6Ug0hOYxojflgCCiCgAAgowChN3blzxygAmIECCCiAgAIIKAACCiCgAAIKIKAAAgqAgAIIKICAAggogIACIKAAAgogoAACCoCAAggogIACCCiAgAIgoAACCiCgAAIKIKAACCiAgAIIKICAAiCgAAIKIKAAAgogoAAIKICAAggogIACCCgAAgogoAACCiCgAAgogIACCCiAgAIIKAACCiCgAAIKIKAAAgqAgAIIKICAAggogIACIKAAAgogoAACCoCAAggogIACCCiAgAIgoAACCiCgAAIKIKAACCiAgAIIKICAAiCgAAIKIKAAAgogoAAIKICAAggogIACCCgAAgogoAACCiCgAAgogIACCCiAgAIIKAACCiCgAAIKIKAAAgqAgAIIKICAAggoAAIKIKAAAgogoAACCoCAAggogIACCCiAgAIgoAACCiCgAAIKIKAACCiAgAIIKICAAiCgAMPxXwEGAN308eZinc2BAAAAAElFTkSuQmCC",
  "name": "Test"
}

And got 404 page not found.

This is what the log says:

[GIN] 2021/01/16 - 18:23:06 | 404 |       1.391µs |     192.168.1.15 | PUT      "/v1/profiles/+4179423****"

Make first contact to API more clear for HomeAssistant users

Hey there,

after some initial problems this code works pretty good for me. But it wasn't that clear to me, that I need to interact with the API from another machine through CLI. I thought of some configuration in the HomeAssistant UI, but after I got the way it works, it was so easy. Found out, that I wasn't the first one with this question, so maybe you could point newbies abit in the right direction.

Something like:

After installing the Addon, you need to go on with registering the phone number through Command Line Interface (from the same machine or another local machine) and not within the User Interface from HomeAssistant.

Maybe you/I need to change some words to make it more clear and avoid confussion.

If you are okay with it, I could also do a pull request.

(Talked about it here: https://github.com/haberda/hassio_addons/issues/8 )

Max :)

Home Assistant multiple recipients

Sorry for asking here (if you want me I can coly to HA's issues), but how do I specify multiple recipients?

  - name: Signal Csalad
    platform: signal_messenger
    url: "http://172.22.222.12:8080"
    number: "+XXXXXXXXXX"
    recipients:
      - "+AAAAAAAAA"
      - "+BBBBBBBBBB"

This only forwards messages only to +BBBBBBBBBB (the last one in the list).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.