Casvt / MIND

A simple self hosted reminder application that can send push notifications to your device. Set the reminder and forget about it!
https://casvt.github.io/MIND/
GNU General Public License v3.0
201 stars 10 forks source link

Token size limitation #86

Closed pedrompcaetano closed 1 month ago

pedrompcaetano commented 3 months ago

Description of the bug Using a automatically generated token from apprise does not work. (65 characters)

To Reproduce

  1. On Apprise webAPI, generate click 'New configuration' and copy the 'Management for Config ID'
  2. Setup a new Notification Service => Apprise
  3. Input hostname and token
  4. Unable to click test, token is deemed invalid

Expected behaviour It should be possible to use the generated token. Testing via 3rd party (curl) works as expected.

Version info Client

Casvt commented 1 month ago

The maximum length of the token allowed by apprise (to be specific: the regex for the field supplied by apprise) is 128 characters. So where does the "65" characters come from? What do the logs say?

ovargasp commented 1 month ago

Hi,

I'm seen the same thing I think, there is nothing in the logs because it doesn't get to be saved. I noticed that the field became red when I tried to save the 65 characters key, so I decided to cut the key short to test, and it saved the value and then it gave the invalid key error in the logs.

This is what i got from my tests: this leght is UI valid: 12345678901234567890123456789012 image as you can see is not red, and allows you to run the test and save.

If you add one more character it will show the red interface warning and it won't save it... so this is what a non go looks like: lenght: 123456789012345678901234567890123 image

And the same happens if you try to edit and change the short key for the correct one, it goes red and it doesn't save... (I tried that to see it it worked)

I hope this helps to clarify or at least add some more information to this post.

ovargasp commented 1 month ago

So I did a little "googling" on this and found that there is a change in Apprise API version 1.8.0 (the autogenerated token lenght) it seems now it's 64 bits and before it used to be 32 bits. The Mind docker image has Apprise CLI version v1.7.4, and that version as the previous ones uses the 32 bits token, so when I tried to use the 64 bit token it errored saying: ERROR - Could not load Apprise API URL: apprise://X...X:8000/7...3/ even though I could test it successfully on the API UI as @pedrompcaetano said.

So it's kind of a backwards compatibility issue in the Apprise API, to work arround it you can manually generate a 32 bits key in Apprise API and it will work with both Mind docker and Apprise API docker latest. Once you do that it works flowlessly

Here you have a post that explains it all:

https://github.com/louislam/uptime-kuma/issues/4928

By the way @Casvt I find your software really cool and it saved me a lot of work and troubles... thanx

Casvt commented 1 month ago

Okay so I basically need to update the apprise dependency. Even though the cause is different, the result is the same as #85. So I'll be closing this issue as the same actions are required as for that issue.