YunoHost-Apps / wallabag2_ynh

Wallabag v2 package for YunoHost

Home Page:https://www.wallabag.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Changing URL of wallabag breaks Android App Access

aslmx opened this issue · comments

commented

Hi,

pre-info:
i'm not sure if this is a problem with the wallabag2_ynh package or with wallabag2 itself or with the wallabag android App. I'm just starting to investigate this and thought i'd let you know.
I'm starting to raise an issue here, because wallabag2_ynh is the part that has changed from a working setup.

I'm in the process of migrating Domains.

Wallabag URL change itself seems fine. After changing to a new domain (which i added before of course) access ot wallabag2 WebUI from my PC is fine. When i changed the URL in the Android App however, it constantly fails the connection test.


root@hostname:/var/www/wallabag2# tail -f /var/log/nginx/wallabag.newdomainname.tld-*

2a01:... - - [23/Sep/2020:20:49:01 +0200] "GET / HTTP/2.0" 302 440 "-" "okhttp/4.8.1"
2a01:... - - [23/Sep/2020:20:49:02 +0200] "GET / HTTP/2.0" 302 440 "-" "okhttp/4.8.1"

(2 lines) occur in the log for each attempt of the Android App to connect.
But it shows "Connection test failed - wallabag service not found - check URL"

As said before - access from PC works super fine. I can read and add articles to wallabag.

I checked the nginx config for the new wallabag domain and can't find any thing which would cause the 302 redirect though.

Also i ran a "grep -R olddomain.tld" in /var/www/wallabag to check if the migration did not change everything, but the only lines that are found are from old sessions/logins..

Any idea?

I suppose you can access your wallabag from your mobile web browser ? (to check if it's related to the app)

commented

I suppose you can access your wallabag from your mobile web browser ? (to check if it's related to the app)

Sure. That works absolutely fine.

I have no clue about what could be the issue, and I don't undertand Yunohost change URL enough to know if that 302 redirect is related.
I wonder if we should contact the app development team to know if it's an "expected" behavior or if it's somewhat yunohost related.

commented

Okay - i can live without the app for some time and will leave the setup as is to be able to provide logs.

Shall i create/link some issue (not sure what context to tell them) or do you have experience how to do it?

One option could be to uninstall the app an reinstall it, to check if it works - and if so, that would mean the issue comes from changing the URL in the app.
But I guess you'd loose any configuration and data from your current app installation. I don't know if it's a big deal, as everything can be retrieved again later on, by syncing it to your account.

commented

Hey again,

i couldn't let it go ;)

i checked adb logcat to see if the app would be more verbose than the nginx access log.

It is...

09-23 22:12:53.635  5436  8957 D TestConnectionTask: Found redirection: https://mymaindomain.tld/yunohost/sso/?r=aHR0cHM6asdfsdfxsYWJhZy4xMzM3bG91bmdlLmRlLw==
09-23 22:12:53.635  5436  8957 D TestConnectionTask: URLs:
09-23 22:12:53.636  5436  8957 D TestConnectionTask: https://wallabag.newdomain.de
09-23 22:12:53.636  5436  8957 D TestConnectionTask: https://mymaindomain.tld/yunohost/sso/?r=aHR0cHM6Ly93YWxsYasdfasdfM3bG91bmdlLmRlLw==

So the app does not like the SSOWat that yunohost uses...
At the PC i was logged in, when i checked in the mobile browser some minutes ago i did not pay enough attention...

so i disabled the sso in nginx config for wallabag domain and it works
I did this for other Apps already (e.g. Gitea)..
Apparently i can't remember having it done for the old wallabag domain, tbh.

#include /etc/nginx/conf.d/yunohost_sso.conf.inc;
 #access_by_lua_file /usr/share/ssowat/access.lua;

This makes you loose single sign on of course, but now the App works...

I don't know if there is a better/nicer way.

Another drawback is that yunohost will constantly complain that the file was changed...

commented

One option could be to uninstall the app an reinstall it, to check if it works - and if so, that would mean the issue comes from changing the URL in the app.

I had deleted the cache and data of the app which for me equals a reinstall. It was in fact no deal but it had apparently not helped.

Well I'm not sure that SSO is enforced by default, and is necessary, as you can connect directly to Wallabag. In my case it wasn't necessary to connect, but once connected to Yunohost you don't have to connect to wallabag too. Maybe when we change the URl we miss a step that gives this behaviour... 🤔