dimtion / Shaarlier

Simple Android app for sharing links on Shaarli.
GNU General Public License v3.0
97 stars 11 forks source link

Shaarli 0.12.1 support? #56

Open virtadpt opened 3 years ago

virtadpt commented 3 years ago

Hi. Has any work been done on making Shaarlier work with v0.12.1 of Shaarli? Something seems to have changed in the API such that it doesn't seem to work anymore. The error that Shaarlier throws in the UI: "Could not load tags. Error fetching HTTP URL."

error.log on the server side: Nothing.

access.log on the server side:

2600:...:4801 - - [23/Nov/2020:10:43:37 -0800] "GET /?do=login HTTP/1.1" 302 879 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36" 

2600:...:4801 - - [23/Nov/2020:10:43:37 -0800] "GET /?do=login HTTP/1.1" 302 879 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36" 

2600:...:4801 - - [23/Nov/2020:10:43:37 -0800] "GET /login HTTP/1.1" 200 19558 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36" 

2600:...:4801 - - [23/Nov/2020:10:43:37 -0800] "POST / HTTP/1.1" 405 993 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36" 

2600:...:4801 - - [23/Nov/2020:10:43:37 -0800] "GET /login HTTP/1.1" 200 19555 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36" 

2600:...:4801 - - [23/Nov/2020:10:43:39 -0800] "POST / HTTP/1.1" 405 993 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36" 

(Note: I'm using Android - why does it think I'm using a Mac?)

If I use the Manage Accounts feature, double-check my URL (it's correct), and re-paste my password from my password manager, and use the "try and save" button, I get the "You think this is a bug?" pop-up. This is what it looks like in my server logs:

2600:...:4801 - - [23/Nov/2020:10:48:00 -0800] "GET /?do=login HTTP/1.1" 302 879 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36" 

2600:...:4801 - - [23/Nov/2020:10:48:00 -0800] "GET /login HTTP/1.1" 200 19556 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36" 

2600:...:4801 - - [23/Nov/2020:10:48:00 -0800] "POST / HTTP/1.1" 405 993 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"

Nothing has shown up in my data/log.txt file since I upgraded to 0.12.1 on the 14th of November, though I use it fairly heavily at the desktop without any trouble.

Is there any other information I could provide to help troubleshoot?

ArthurHoaro commented 3 years ago

In the meantime, you should try to uncheck "Use username/password (deprecated)" and paste your API key instead. It's working fine for me.

virtadpt commented 3 years ago

Yup, that did it. Thanks!

daks commented 3 years ago

I tried to use the username/password but it didn't work, maybe because I also use the HTTP Auth.

Error log from Nginx (anonymized):

<IP> - <HTTPuser> [24/Nov/2020:23:02:02 +0100] "GET /?do=login HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
<IP> - <HTTPuser> [24/Nov/2020:23:02:04 +0100] "GET /login HTTP/1.1" 200 17912 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
<IP> - <HTTPuser> [24/Nov/2020:23:02:07 +0100] "POST / HTTP/1.1" 405 555 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.143 Safari/537.36"
immanuelfodor commented 3 years ago

@daks To get HTTP Auth working, you could try adding your Shaarli URL in a form of https://httpusername:httppassword@shaarli.example.com where the user/pass could be added to an Authorization header. This workaround only works if the app implements it, and this scenario is untested by me but worth a shot.

iraklis10 commented 2 years ago

@dimtion this can be marked as solved/closed. The suggested solution using the API works fine.