caronc / apprise-api

A lightweight REST framework that wraps the Apprise Notification Library
https://hub.docker.com/r/caronc/apprise
MIT License
575 stars 49 forks source link

Default config ID length too long #187

Closed isometimescode closed 2 months ago

isometimescode commented 2 months ago

:beetle: Describe the bug

When loading the web UI, the "New Configuration" link will auto generate a long, unique hash for a new token. The length of that token seems to be 64 chars, but the regex for verifying the token length in apprise itself seems to max out at 32 chars. This causes an error when trying to use that auto-generated token to send a notification through the CLI.

It's easy to workaround this by just using your own tokens. I'm not sure if the bug is that the auto-generated ID is too long or if the regex in apprise should be updated instead.

:bulb: Screenshots and Logs

Using one of the random config IDs generated from the UI:

apprise -vvv -b 'test message' 'apprise://example.com/9cd021ebcbfdd3958c28fd2ef4c3577cbd879b1cf3bb6d75b15dd94891084395/'
2024-04-30 13:32:40,972 - DEBUG - Language set to en
2024-04-30 13:32:41,802 - DEBUG - Notification Plugin 101(s) and 142 Schema(s) loaded in 0.8004s
2024-04-30 13:32:41,806 - WARNING - The Apprise API token specified (9cd021ebcbfdd3958c28fd2ef4c3577cbd879b1cf3bb6d75b15dd94891084395) is invalid.
2024-04-30 13:32:41,807 - ERROR - Could not load Apprise API URL: apprise://example.com/9...5/
2024-04-30 13:32:41,808 - ERROR - There are no service(s) to notify

:computer: Your System Details:

:crystal_ball: Additional context

caronc commented 2 months ago

That's a good find and a simple fix. You should do a PR and grab yourself some credit

caronc commented 2 months ago

Closing this as it is resolved now