From ccd07f2cbf4424cb01ef99e2c5302191195a11d7 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Thu, 17 Jun 2021 10:10:22 +0200 Subject: [PATCH 1/3] Create DEBUG.md --- doc/DEBUG.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 doc/DEBUG.md diff --git a/doc/DEBUG.md b/doc/DEBUG.md new file mode 100644 index 0000000..de5ca14 --- /dev/null +++ b/doc/DEBUG.md @@ -0,0 +1,35 @@ +This project is just a small REST API Wrapper around [signal-cli](https://github.com/AsamK/signal-cli) - i.e all the heavy lifting is done by `signal-cli`. In case you are experiencing some problems, it's important to determine whether the problems are caused by the REST API wrapper or by `signal-cli`. + +This can be done by putting the docker container into debug mode with the following REST API command: + +```curl -X POST -H "Content-Type: application/json" -d '{"logging": {"level": "debug"}}' 'http://127.0.0.1:8080/v1/configuration'``` + +Once the docker container is in debug mode, execute the REST API command you want to debug. + +e.g Let's assume we are experiencing some problems with sending messages. So, let's send a Signal message with + +```curl -X POST -H "Content-Type: application/json" -d '{"message": "Hello World!", "number": "+431212131491291", "recipients": ["+4354546464654", "+4912812812121"]}' 'http://127.0.0.1:8080/v2/send'``` + +and see what the docker container is doing internally with the request. + +In the docker-compose log file are now all the steps listed you need to perform in oder to use `signal-cli` directly without the REST API wrapper involved. + +e.g for the above request we would see the following lines in the docker-compose log file: + +``` +signal-cli-rest-api_1 | time="2021-06-17T07:41:33Z" level=debug msg="If you want to run this command manually, run the following steps on your host system:" +signal-cli-rest-api_1 | time="2021-06-17T07:41:33Z" level=debug msg="*) docker exec -it 2cb5036847fd07c47100c34c5b7b3b2f38c78a449e6dd20833d1662b32a6713a /bin/bash" +signal-cli-rest-api_1 | time="2021-06-17T07:41:33Z" level=debug msg="*) su signal-api" +signal-cli-rest-api_1 | time="2021-06-17T07:41:33Z" level=debug msg="*) echo 'Hello World!' | signal-cli --config /home/.local/share/signal-cli -u +431212131491291 send +4354546464654 +4912812812121" +``` + +By removing the REST API wrapper from the equation and using `signal-cli` directly it's possible to determine whether the issue is caused by the REST API wrapper or `signal-cli`. +In case it doesn't work when using `signal-cli` directly, it's most probably an issue with `signal-cli` and you need to file a ticket in the [signal-cli repository](https://github.com/AsamK/signal-cli). + + +Before you create a ticket in the `signal-cli` repository, please make sure to collect as much information as possible to make it easier for the maintainer to reproduce your bug: + +* Post the obfuscated(!) `signal-cli` command you tried and the output you got (please also add the `--verbose` to the `signal-cli` command in order to get more debugging output. see: https://github.com/AsamK/signal-cli/blob/master/man/signal-cli.1.adoc) +* Do you see any patterns? Does the issue only occur with specific phone numbers? +* Have you tried to do a `receive` first? `signal-cli` recommends to run this command periodically. +* ... From 7dbe258574bb9b81bfeec6bcb990973981127710 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Thu, 17 Jun 2021 10:14:53 +0200 Subject: [PATCH 2/3] Update DEBUG.md --- doc/DEBUG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/DEBUG.md b/doc/DEBUG.md index de5ca14..1aeaf2a 100644 --- a/doc/DEBUG.md +++ b/doc/DEBUG.md @@ -29,7 +29,7 @@ In case it doesn't work when using `signal-cli` directly, it's most probably an Before you create a ticket in the `signal-cli` repository, please make sure to collect as much information as possible to make it easier for the maintainer to reproduce your bug: -* Post the obfuscated(!) `signal-cli` command you tried and the output you got (please also add the `--verbose` to the `signal-cli` command in order to get more debugging output. see: https://github.com/AsamK/signal-cli/blob/master/man/signal-cli.1.adoc) +* Post the obfuscated(!) `signal-cli` command you tried and the obfuscated(!) output you got (please also add the `--verbose` flag to the `signal-cli` command in order to get more debugging output. see: https://github.com/AsamK/signal-cli/blob/master/man/signal-cli.1.adoc) * Do you see any patterns? Does the issue only occur with specific phone numbers? * Have you tried to do a `receive` first? `signal-cli` recommends to run this command periodically. * ... From 1dcc3da1ecc1b8522f895e08fac67483807b5291 Mon Sep 17 00:00:00 2001 From: Bernhard B Date: Thu, 17 Jun 2021 20:27:26 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 259e973..50504b2 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,16 @@ By adding `USE_NATIVE=1` as environmental variable to the `docker-compose.yml` f In case there's no native binary available (e.g on a 32 bit Raspian OS), it will fall back to the signal-cli Java application. The native mode only works on a 64bit system, when the native mode is enabled on a 32bit system, it falls back to the Java application. -## API documentation +## Documentation -The Swagger API documentation can be found [here](https://bbernhard.github.io/signal-cli-rest-api/). If you prefer a simple text file like API documentation have a look [here](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md) +### API Reference + +The Swagger API documentation can be found [here](https://bbernhard.github.io/signal-cli-rest-api/). If you prefer a simple text file based API documentation have a look [here](https://github.com/bbernhard/signal-cli-rest-api/blob/master/doc/EXAMPLES.md). + +### Blog Posts + +[Running Signal Messenger REST API in Azure Web App for Containers](https://stefanstranger.github.io/2021/06/01/RunningSignalRESTAPIinAppService/) - written by [@stefanstranger](https://github.com/stefanstranger) -In case you need more functionality, please **file a ticket** or **create a PR**. ## Clients & Libraries @@ -61,3 +66,5 @@ In case you need more functionality, please **file a ticket** or **create a PR** | ------------- |:-------------:| :-----:|:-----:|:-----:| | [Shell Client](https://github.com/florian-h05/shell-script_collection/blob/main/signal-cli-rest-api_client.bash) | X | | Shell | [@florian-h05](https://github.com/florian-h05) | [pysignalclirestapi](https://pypi.org/project/pysignalclirestapi/) | | X | Python | [@bbernhard](https://github.com/bbernhard) + +In case you need more functionality, please **file a ticket** or **create a PR**.