JSON-RPC Beta Testing #160
Replies: 13 comments 27 replies
-
Thanks for this opportunity to get signal-cli REST API back up to speed again on low-power devices. I just powered up the new docker container and right away messages are delivered within 1sec again (normal mode: ~30sec / native mode: was 2-3sec but since an update some time ago also ~20sec). I will now test the features that I'm using from the REST API but performance wise you just made me very happy! Oh and the websockets I will have to try out for receiving messages. My device: |
Beta Was this translation helpful? Give feedback.
-
I can't get the websocket connection to work reliably. Connection drops out every few seconds and apart from events when typing starts and ends I don't get the real message. I tried with the "Websocket In" node in Node Red. Might be an issue with this as I've not used websockets before in Node RED. What I tested and works though looks good:
|
Beta Was this translation helpful? Give feedback.
-
Not sure what I changed but the websockets work now. I can receive messages and they also come in pretty fast. So fast that it's great for implementing Signal Bots through it. Further successful testing:
|
Beta Was this translation helpful? Give feedback.
-
Many thanks for the feedback - that sounds really good! :) |
Beta Was this translation helpful? Give feedback.
-
That's impressive. Sending a message with text only takes now 1second. |
Beta Was this translation helpful? Give feedback.
-
There's a new version available for testing: Changelog:
|
Beta Was this translation helpful? Give feedback.
-
The edit: But I've just noticed that there was a bug in there. Instead of doing a tree walk in the I'll fix that and push a new test version to dockerhub. Hopefully that fixes the issue 🤞 Regarding the "fifo already exists" error: I wasn't able to reproduce the error. But I'll change the code so that it first removes the fifo (in case it already exists) and then creates a new fifo with mkfifo. |
Beta Was this translation helpful? Give feedback.
-
A new build is running: https://github.com/bbernhard/signal-cli-rest-api/actions/runs/1326208604 After the github actions job is done, the tag Changelog:
|
Beta Was this translation helpful? Give feedback.
-
Many thanks for letting me know! I can reproduce the issue here too. I'll have a look. |
Beta Was this translation helpful? Give feedback.
-
New build is running: https://github.com/bbernhard/signal-cli-rest-api/actions/runs/1326608673 After the github actions job is done, the tag I've looked again at the websocket rfc and the websocket rfc doesn't specify what to do in case a client doesn't respond to I've googled a bit and found a few websocket server implementations which also ignore a missing |
Beta Was this translation helpful? Give feedback.
-
@bbernhard When I set the mode to json-rpc it seems to want to look here: /home/.local/share/signal-cli/data causing a fatal error, rather than the location I specify with the environment variable. I suspect it is hard coded somewhere to look for that DIR rather than using the variable. Native and normal modes work fine with the alternative location. Specific error message:
When:
|
Beta Was this translation helpful? Give feedback.
-
Sorry about the delay, I've been traveling. Anyway, here is the initial log output before the error before spams the console:
The log file in
Here is
Switching back to native or normal modes works fine. I still haven't tried to register again, it might help. |
Beta Was this translation helpful? Give feedback.
-
Yep, works now! Thanks again! |
Beta Was this translation helpful? Give feedback.
-
Hello everybody,
as some of you might have noticed, signal-cli v0.9.0 now supports JSON-RPC. While I wasn't a big fan of signal-cli's DBUS integration (I am just not a big fan of DBUS itself), I really like the JSON-RPC interface. So I figured it would be a good idea to add support for that as well.
With this new mode, the docker image now supports three different modes (the mode can be selected by setting the
MODE
env variable in thedocker-compose.yml
appropriately:(I haven't tried it yet, but it might be possible to combine the fast startup time of the native image with the JSON-RPC interface. So maybe there will be a fourth mode at some point: json-rpc-native)
How to use it
The only thing you need to do is to set the
MODE
env variable in thedocker-compose.yml
file tojson-rpc
and use the docker imagebbernhard/signal-cli-rest-api:0.80-jsonrpc-dev
. (I also deprecated some env variables - see the next section for the details)Limitations, API changes & FAQ:
receive
endpoint. Instead you have to use websockets. e.g: In order to listen for incoming messages you can use wscat like this:wscat -c 127.0.0.1:8080/v1/receive/<your registered signal number> --show-ping-pong --slash
USE_NATIVE
env variable in thedocker-compose.yml
file is now deprecated. You can still use it, but you'll see a deprecation warning in the logs. It is recommended to use theMODE
env variable instead. (e.g:MODE=native
)AUTO_RECEIVE_SCHEDULE
env variable in thedocker-compose.yml
only works in normal/native modeSIGNAL_CLI_CMD_TIMEOUT
env variable in thedocker-compose.yml
only works in normal/native modeIf anyone wants to have a look at the code, have a look at the
jsonrpc
git branch.So far, I've only tested the docker image on x86-64, so not sure if/how much it currently works on arm64/armv7.
Please report any feedback here.
If anyone wants to help with some documentation - any help there is really appreciated! I think with all the different modes and configuration options it's probably becoming more and more difficult for new users to get started. I think the existing
README.md
could definitely need some love. I am not particularly good at documenting/explaining stuff, so if anyone wants to help me with that, please let me know.Beta Was this translation helpful? Give feedback.
All reactions