Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local network setting for use without relying on NAT hairpinning or local DNS #755

Open
ghost opened this issue Mar 18, 2017 · 12 comments
Open
Labels
connectivity DNS, TLS, proxies, network connection, etc. related matter enhancement help wanted

Comments

@ghost
Copy link

ghost commented Mar 18, 2017

Actual behaviour

Can't connect to Nextcloud instance if it's on local network.

Expected behaviour

It'd be nice (and convenient) to be able to choose a local network, just like you can do with Transdroid (Settings > Servers > [Your server] > Advanced settings > Local Network and Local IP or host). My server runs inside my home network and it is very annoying to have to either change the settings when I get home or to have to access my Nextcloud instance using mobile data. I hope this makes sense.

Steps to reproduce

  1. go to local network
  2. open app
  3. doesn't work

Environment data

Android version: irrelevant

Device model: irrelevant

Stock or customized system: irrelevant

Nextcloud app version: 1.4.1
Nextcloud server version: 11.??

@tobiasKaminsky
Copy link
Member

If you cannot access your server from within your network it is a misconfiguration of your network.
However it makes sense to have a direct/local access to the server and not use the external ip to connect to the server.
But both of it can and should be solved with the network configuration and not on every end client.

@ghost
Copy link
Author

ghost commented Jun 26, 2017

If you cannot access your server from within your network it is a misconfiguration of your network.

No, it's not: NAT hairpinning is not available on most consumer routers, so the only way to make this possible is by including a setting in the app, just like Transdroid does.

@tobiasKaminsky
Copy link
Member

Hmm, seems indeed to be much more complicated/not working on many consumer routers.

@ghost
Copy link
Author

ghost commented Jun 26, 2017

Thanks for reopening this, I think it would be very useful for many people who host at home like I do :)

@ShapeShifter499
Copy link

ShapeShifter499 commented Apr 29, 2018

Am I understanding this correctly then I want this feature too.

When you're at home the Android app should detect that (maybe by Wifi name setting or whatnot) so everything goes through LAN only. This would allow for potentially faster uploads and less data use since some ISPs track data use.

@LukeOwlclaw
Copy link

@tobiasKaminsky Could you advise what the best solution would be for this problem? I had a look at FilderDownloader.downloadFile(). There is Account mCurrentAccount which is an Android class, with it OwnCloudAccount ocAccount is obtained which is from the OC lib. Then OwnCloudClient mDownloadClient is obtain - also from OC lib.

I see two options:

  • idit OC lib (OwnCloudAccount or OwnCloudClient ) --> not easy I guess
  • include second URL or create a new Account for the local URL --> password has to be entered twice I guess

Is there a better/easier option?

@LukeOwlclaw
Copy link

@newhinton and @AndyScherzinger Do you any advice on this topic? Thanks!

@AndyScherzinger
Copy link
Member

@LukeOwlclaw unfortunately I am no expert on this part (usually doing the UI work), maybe @tobiasKaminsky can answer the question. Not sure how this could be achieved at all since we now rely on the weblogin, so we would have to save 2 sessions and would also have to decide when to use which session.

@j-ed
Copy link

j-ed commented Feb 23, 2019

I tend to say that this is a pure network configuration issue, as @tobiasKaminsky mentioned. If someone wants to access his Nextcloud server over the Internet and the LAN, he has to make sure that the local DNS is working correctly.
This can be achieved by setting-up a local DNS server which resolves the official DNS name to an internal ip address. Trying to switch server names most likely leads to certificate problems because a) the internal DNS name would be different from an external one, b) an internal ip address can very often not be added to an official certificate.

@mario
Copy link
Contributor

mario commented Feb 23, 2019

You are partly correct @j-ed.

An alternative would be to provide a custom DNS selector implementation that would route all requests on a given Wifi network to a proper IP address for a given hostname which might make sense for people not running their own DNS server :)

@ShapeShifter499
Copy link

ShapeShifter499 commented Feb 23, 2019

@mario @j-ed I see an issue with this. What about website certificates? Do I set my webserver to provide the same certificate for both LAN and WAN requests?

EDIT: I should have read more carefully, @j-ed mentioned exactly the same thing about certificates, sorry.

@LukeOwlclaw
Copy link

@mario You are talking about custom DNS resolution as mentioned here, right? I was also thinking that this should work without introducing certificate problems.

@joshtrichards joshtrichards changed the title Feature request: Local network setting Local network setting for use without relying on NAT hairpinning or local DNS Oct 12, 2023
@joshtrichards joshtrichards added the connectivity DNS, TLS, proxies, network connection, etc. related matter label Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connectivity DNS, TLS, proxies, network connection, etc. related matter enhancement help wanted
Projects
None yet
Development

No branches or pull requests

7 participants