Commit Graph

208 Commits

Author SHA1 Message Date
Bernhard B
0d5c23d7ea fixed json-rpc debug log outputs
* moved them up a bit to also log something in case of an error

see #482
2024-03-20 20:52:25 +01:00
Bernhard B
3573f6ae95 added json-rpc debug logging
see #482
2024-03-20 19:47:37 +01:00
Bernhard B
efee49e792 add API endpoints to list and add sticker packs
see #398
2024-03-13 21:10:23 +01:00
Bernhard B
9c365e6f84 add possibility to edit messages
see #485
2024-03-07 20:11:57 +01:00
Bernhard B
f57512216c added endpoints to set/remove a username + change the account settings 2024-03-06 18:27:17 +01:00
Bernhard B
91d7dc0a19 fixed concurrent map write
* protect map access with mutex to avoid concurrent map access

see #493
2024-02-28 16:37:40 +01:00
Bernhard B
08dc98eac2 removed JAVA_HOME env variable from supervisor configuration
* not needed and is causing some problems since we switched from
  the eclipse-temurin to the ubuntu base image.

see #489
2024-02-23 10:38:36 +01:00
Bernhard B
05f6434630 updated golang.org/x/net to v0.17.0 in order fix potential security vulnerability 2024-02-21 16:26:47 +01:00
Bernhard B
03af708f11 added hidden 'recipient' parameter to /v2/send endpoint
* some REST API consumers (like the Synology NAS) do not allow
  to use an array for the recipients. So, in order to support
  those platforms as well, a 'recipient' string parameter is added.

  As most users are perfectly fine with the array parameter, the
  recipient parameter won't be exposed in the Swagger UI.

see #428
2024-02-16 19:18:48 +01:00
Bernhard B
d5210041c6 fixed typo in swagger documentation
see #466
2024-01-08 20:49:29 +01:00
Bernhard B
3d7b73560a fixed bug in golang channel handling (json-rpc mode)
* golang channels are meant to be 1:1 channels, so if multiple
  goroutines listen on the same channel for messages, only one will
  receive the message and the others are not, which lead to lost
  messages.

  In order to fix that, we create a dedicated golang channel for every
  websocket connection.

see #451
2023-12-11 22:18:23 +01:00
Bernhard B
f564cffd67 Merge branch 'master' of github.com:bbernhard/signal-cli-rest-api 2023-12-01 21:33:18 +01:00
Bernhard B
13236b7c66 added /v1/rate-limit-challenge endpoint
see #456
2023-12-01 21:29:00 +01:00
Benjamin Prevor
e4b2d21588 fix typo in endpointNotSupportedInJsonRpcMode 2023-11-27 11:33:42 -05:00
Bernhard B
63c767e088 Merge pull request #447 from kxait/get_accounts
Get list of accounts
2023-11-13 18:08:07 +01:00
Tomek Osika
385a591b32 get accounts 2023-11-12 02:19:13 +01:00
Tomek Osika
3ea7949c10 also reload config after device was linked successfully 2023-11-11 22:23:26 +01:00
Tomek Osika
4444beaf98 link device in json-rpc mode 2023-11-11 14:34:47 +01:00
Bernhard B
c493655f14 Merge pull request #434 from bbernhard/multimaster_mode
Multimaster mode
2023-10-30 20:03:28 +01:00
Bernhard B
6feb7078f1 improved misleading comment 2023-10-30 20:00:16 +01:00
Bernhard B
512458b202 json-rpc mode: fixed bug in register endpoint + added verify endpoint 2023-10-30 19:56:01 +01:00
Bernhard B
a06a9f873b switched implementation to multi-account mode
* instead of starting signal-cli in json-rpc mode with the '-u',
  we start signal-cli without the '-u' parameter (also known as
  multi-account mode). This makes it possible to register a number in
  json-rpc mode.
2023-10-30 14:49:11 +01:00
Tomek Osika
56eaa7b79b update group name 2023-10-29 17:04:52 +01:00
Bernhard B
0cab12c49d added spoiler to textstyleparser 2023-10-28 18:53:25 +02:00
Bernhard B
fa91a58bf2 fixed bug in response parsing
* strip info and warn messages from output
2023-10-19 20:19:16 +02:00
Bernhard B
b45aab70a7 improved REST API documentation 2023-10-07 11:29:41 +02:00
Bernhard B
9e09775d94 implemented "sendContacts" functionality
see #416
2023-10-07 11:18:16 +02:00
Bernhard B
07aee21672 handle multicharacter emojis in textstyleparser
see #413
2023-10-06 19:11:07 +02:00
Bernhard B
8271d53746 fixed small bug in cli client 2023-10-05 21:16:40 +02:00
Bernhard B
bc74d4cb48 add debug logging to cli client
* log the stdout & stderr buffers in case debug logging is enabled.

see #412
2023-10-05 18:02:57 +02:00
Bernhard B
6f269d3e1d improved error handling in send method
* when a message is successfully sent, signal-cli returns a timestamp,
  which we convert to an integer. in case, we, for some reason can't
  convert the timestamp to an integer, it means that signal-cli returned
  some non-numeric characters as well (which is a strong indication that
  there was an error). So, instead of returning the parsing error,
  return the actual signal-cli error message.

see #412
2023-10-04 20:44:42 +02:00
Bernhard B
661fe568e2 json-rpc mode: fixed bug in group deletion
* deleting a group in json-rpc mode didn't work.

see #387
2023-10-04 19:07:17 +02:00
Bernhard B
b39980e66b added possibility to update the group description & the avatar
see #417
2023-10-03 19:49:36 +02:00
Bernhard B
2474238cb5 fixed typo in struct definition 2023-10-03 19:29:26 +02:00
Bernhard B
fc2982c25f fixed crash in create group request
see #410
2023-10-03 19:28:26 +02:00
Bernhard B
4f3ebf0bfc fixed bug in create group endpoint
link & permissions weren't correctly set

see #410
2023-09-26 22:30:43 +02:00
Bernhard B
f21925ea74 updated filepath-securejoin to v0.2.4 to fix a potential security issue
on windows
2023-09-23 19:00:54 +02:00
Bernhard B
76026e9c5c Merge branch 'master' of github.com:bbernhard/signal-cli-rest-api 2023-09-23 18:58:16 +02:00
Bernhard B
221e129ad4 added strikethrough and monspace text styling options
see #382
2023-09-23 18:57:32 +02:00
Bernhard B
e8bea4b477 Merge pull request #405 from greysonp/add-group-refresh
Add the ability to refresh a group.
2023-09-19 22:42:15 +02:00
Greyson Parrelli
4eaf9a971b Update to a PUT request. 2023-09-09 08:00:33 -04:00
Bernhard B
35e2e903df made qrcode version configureable via query parameter (e.g
?qrcode_version=11)

see #402
2023-09-08 22:45:50 +02:00
Bernhard B
1ba1418e14 Merge branch 'master' of github.com:bbernhard/signal-cli-rest-api 2023-09-08 19:55:01 +02:00
Bernhard B
a5cbb4c725 fixed bug in textstyleparser
* bold text wasn't correctly parsed

see #382
2023-09-08 19:54:05 +02:00
Greyson Parrelli
6ec00f4589 Add the ability to refresh a group. 2023-09-06 00:59:14 -04:00
Bernhard B
06744e9706 Merge pull request #404 from tactilenews/fix-403
fix: include $stdin in server response on error
2023-09-05 20:45:17 +02:00
Robert Schäfer
7aa1fddcd8 fix: include $stdin in server response on error
Motivation
----------
The way how I fixed this is that both `Stdout` and `Stderr` are responded back to the client.

I don't think it's good practice to discard `$stderr` on success and to discard `$stdout` on error.

Let me know what you think. I'm still very new to Golang.

How to test
-----------
1. First of all you must be able to reproduce "CAPTCHA proof required" error (I guess you need to send a lot of messages to the same number)
2. Execute:
```
curl -X POST -H "Content-Type: application/json" 'http://localhost:8080/v2/send' \
       -d '{"message": "Test via Signal API!", "number": "<SENDER_PHONE_NUMBER>", "recipients": [ "<RECIPIENT_PHONE_NUMBER>" ]}
'
```
3. See in the JSON response:
```
{"error":"Failed to send (some) messages:\n+49176xxxxxxxx: CAPTCHA proof required for sending to \"+49176xxxxxxxx\", available options \"RECAPTCHA, PUSH_CHALLENGE\" with challenge token \"1f209ee0-d487-4efc-xxxx-xxxxxxxxxxxx\", or wait \"86400\" seconds.\nTo get the captcha token, go to https://signalcaptchas.org/challenge/generate.html\nCheck the developer tools (F12) console for a failed redirect to signalcaptcha://\nEverything after signalcaptcha:// is the captcha token.\nUse the following command to submit the captcha token:\nsignal-cli submitRateLimitChallenge --challenge CHALLENGE_TOKEN --captcha CAPTCHA_TOKEN\nxxxxxxxxxxxxx\nFailed to send message\n"}
```

fix #403
2023-09-04 16:13:04 +02:00
Kostia Rybnikov
068a124a1a Accept max_messages param 2023-08-31 10:36:52 +03:00
Bernhard B
759ba197a1 fixed bug in textstyleparser + added unittests 2023-08-21 20:04:28 +02:00
Bernhard B
a332215a9e added text formatting (bold & italic) to json-rpc mode 2023-08-21 18:43:15 +02:00