YunoHost-Apps / wallabag2_ynh

Wallabag v2 package for YunoHost
https://www.wallabag.org/
GNU Affero General Public License v3.0
62 stars 14 forks source link

cannot get Token in wallabager #58

Closed Thatoo closed 5 years ago

Thatoo commented 5 years ago

If logged in yunohost, which is needed to keep using searx for example, then one can't use wallabagger. To be able to use wallabagger (even to make wallabagger accept the token at first), one need to be logged out from yunohost.

Issue reported to wallabager here : https://github.com/wallabag/wallabagger/issues/149

Mellerin commented 5 years ago

Hello, looks like there is something that might work, found on Yunohost forum : https://forum.yunohost.org/t/wallabag-v2-integration-dans-yunohost/1453/40 User here found out that if you edit the /etc/nginx/mon.domaine.tld.d/wallabag2.conf (or maybe /etc/nginx/conf.d/mon.domaine.tld.d/wallabag2.conf) file and change the rewrite ^ /wallabag/app.php$is_args$args; with rewrite ^ /wallabag/app.php?is_args$args; it seems to work. Logged in wallabag with old rewrite : no token not logged in and old rewrite : token ok logged in and new rewrite : token ok not logged in and new rewrite : token ok Looks like nothing goes wrong with this change, but i didn't test everything. Tested with FF 64 (Ubuntu), wallabagger extension, and this Wallabag package for Yunohost

Maybe it's more a Wallabag issue rather than a wallabag2_ynh one?

Thatoo commented 5 years ago

Thank you for this information. I was ready to try but in /etc/nginx/conf.d/mon.domaine.tld.d/wallabag2.conf, I have rewrite ^ /wallabag/app.php/$is_args$args; I don't have rewrite ^ /wallabag/app.php$is_args$args; There is one / more so, should I replace by rewrite ^ /wallabag/app.php/?is_args$args; or rewrite ^ /wallabag/app.php?is_args$args;

Mellerin commented 5 years ago

ok sorry, i don't know what i've done :thinking: in my actual (working) wallabag config file i have : rewrite ^ /wallabag/app.php/?isargs$args; (edited line) just like you ^^ (the '?' was a '$' before) So, keep the extra / i lost somewhere in my copy-pasting-editing, and just change the $ into a ?

edit : feel free to backup your file before if you want with a cp /etc/nginx/conf.d/mon.domaine.tld.d/wallabag2.conf /etc/nginx/conf.d/mon.domaine.tld.d/wallabag2.old You also need to reload nginx with /etc/init.d/nginx restart

Thatoo commented 5 years ago

Thank you. I changed the $ into a ? and restarted first nginx only and then even yunohost server fully but no change happened. I tried with a new pair of ID/key inside wallabager but nothing change. The token is accepted only if I'm logged out from Yunohost and same for saving article. If I'm logged in Yunohost, I can't save articles...

I forgot to mention that I have Yunohost 3.3.4 running wallabag 2.3.2 and I have firefox 64.0 with wallabager 1.5.0 .

Mellerin commented 5 years ago

I got same versions. Sorry, i can't help more than that. You may read the page i linked earlier : https://forum.yunohost.org/t/wallabag-v2-integration-dans-yunohost/1453/40 Some people succeed with changing password, new user inside Wallabag, etc. Good luck ^_^

Thatoo commented 5 years ago

Thank you for your help. I'll read again the thread you wrote. I could try the password thing but not changing users because users in my yunohost have emails and clouds... What I don't understand is that wallabag app on android is working even if I'm logged in yunohost in firefox app on android. So for me it looks more like the problem comes from wallabager in firefox than wallabag2 in yunohost... By the way, I can read today, at the end of the issue opened in wallabager :

stan3 pushed a commit to stan3/wallabagger that referenced this issue a day ago "don't set Cookie header (fixes wallabag#149, maybe wallabag#140)"

So maybe next version of wallabager will be working.

Thatoo commented 5 years ago

I have tried that fix, https://github.com/wallabag/wallabagger/pull/160 , and it works like a charm! Thank you @stan3. Hopefully wallabager 1.5.1 with this fix will be released soon.

Also, I decided to change back ? into a $ in order to get back to default. And it still works! So the issue was coming from wallabager and will soon be solved!

Mellerin commented 5 years ago

thumbs up! In fact the wallabag config modification only worked 2 days, i just don't know why it worked for some time, or why it stopped working. Thanks to point out the correct fix.

lapineige commented 5 years ago

So we can close this issue ? :)