signal-cli-rest-api icon indicating copy to clipboard operation
signal-cli-rest-api copied to clipboard

Set default registered number

Open pyheme opened this issue 1 year ago • 4 comments

Feature Request

Is there a way to define in signal-cli-rest-api the registered account number used to send / receive so that it does not have to be passed in the json data or in url calls?

I am using signal-cli-rest-api, among other use cases, as a gateway for one of Nextcloud's TOTP plugins and currently I need to hard code the gateway's phone number in the plugin's code for it to work, which is less than ideal. Alternatively, I noticed in signal-cli's doc that the -a flag is optional when there's only 1 account set up, so I was wondering if that could be another way to go at it?

pyheme avatar Sep 30 '22 15:09 pyheme

Right now, something like that isn't possible.

Just out of interest: Doesn't the plugin have any config file where the phone number could be entered?

bbernhard avatar Oct 02 '22 17:10 bbernhard

I did something in my pythonic version. You can set PYTHON_SIGNAL_CLI_REST_API_ACCOUNT to have a default account. The -a flag of signal-cli is not used, i'm just adding the configured number into all JSON-RPC requests.

morph027 avatar Oct 03 '22 06:10 morph027

Right now, something like that isn't possible.

Just out of interest: Doesn't the plugin have any config file where the phone number could be entered?

Unfortunately, it does not, but I agree that would be the logical solution. As a workaround, I added the number in the plugin's code and it works fine but throws an error in Nextcloud's admin panel's 'integrity checks' as the checksum on that file no longer matches.

Thank you both for the reply. I'll have a look at morph027's project to see if it also fits my other usecases, as I understand it would solve that issue.

pyheme avatar Oct 03 '22 14:10 pyheme

In fact, this was one of my original needs too, because i had some software which was able to send webhooks but without any helpful extra data besides the message, so i needed a way to hardcode the account. Now, it's some kind of fallback or for convinience for lazy people like me ;)

morph027 avatar Oct 03 '22 16:10 morph027