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

[Request] Add indicator of (missing) online connectivity to frontend #3840

Closed
deosrc opened this issue Nov 30, 2020 · 7 comments
Closed

[Request] Add indicator of (missing) online connectivity to frontend #3840

deosrc opened this issue Nov 30, 2020 · 7 comments
Labels
done Done but not yet released request Feature request
Milestone

Comments

@deosrc
Copy link

deosrc commented Nov 30, 2020

Is your feature request related to a problem? Please describe.

Having just gone to the OctoPrint UI to install a plugin, I found OctoPrint claiming that it was offline. After some investigation I found this was because the connectivity check uses Cloudflares DNS (1.1.1.1, port 53).

Like many others using PiHole, I have configured my firewall to deny requests on port 53 outside of my network. This prevents devices using their own DNS settings to bypass local network configurations (a practice used to prevent DNS ad blocking). This had the side-effect of OctoPrint thinking it was offline when it actually had full connectivity.

Describe the solution you'd like

Given that most of the OctoPrint functionality which requires an internet connection uses octoprint.org or github.com (e.g. plugin installs, updates), would it not be better to use one of these for the connectivity check?

Describe alternatives you've considered

As a minimum, I would think there should be an indicator in the header bar or notification when the page is first loaded to show that OctoPrint thinks it is offline. There doesn't seem to be an indication at the moment which means that users could be missing out on vital security updates without realising.

Additional context

#2474

@github-actions github-actions bot added the request Feature request label Nov 30, 2020
@foosel
Copy link
Member

foosel commented Nov 30, 2020

The problem with that is that the general connectivity check needs to a) use an IP (to not interpret issues of name resolution as complete loss of connectivity) and b) needs to be reliably reachable.

I cannot guarantee that the IP of octoprint.org will not change at one point, leaving outdated instances stranded. I cannot guarantee that the IP of github.com will not change at one point, leaving outdated instances stranded. I also cannot guarantee the level of availability that 1.1.1.1, 1.1.0.0, 8.8.8.8, 8.8.4.4, 9.9.9.9 and similar public DNS have.

Hence the choice to use something as default that is not owned by Google (as that was raising concerns for many), reachable by IP long-term and with a high availability. Thus: a public well-established DNS server.

I'm aware that some people deny external traffic on port 53, the general majority however doesn't and due to the nature of how the internet works it's a good candidate to not get firewalled. Port 80 or 443 would be better, but see the requirements above again as to why that is problematic. The setting is configurable to allow people in your situation to change it so it fits their setup.

So, I'm not so sure if I really want to change this here, due to the aforementioned reasons, but I agree that a notification about the offline state would be a really good idea!

@deosrc
Copy link
Author

deosrc commented Nov 30, 2020

Seems fair enough. I think the main issue is the lack of notice so I'd be happy for the resolution to just be the notification.

Just to check, is the default now 1.1.1.1 ? The text still indicates the default is Google but I couldn't recall if I'd changed the value at some point.

If you don't know what to set here, the default values (using Google's DNS server) should work.

@foosel
Copy link
Member

foosel commented Nov 30, 2020

Now you made me check, and damn, I misremembered myself. I wanted to switch it to 1.1.1.1 due to the aforementioned concerns, but so far didn't.

foosel added a commit that referenced this issue Nov 30, 2020
Less controversial than google's 8.8.8.8

As mentioned in #3840
@foosel foosel added this to the 1.6.0 milestone Nov 30, 2020
@foosel foosel changed the title [Request] Better to use octoprint.org or github.com for connectivity check? [Request] Add indicator of (missing) online connectivity to frontend Nov 30, 2020
@lasmaty07
Copy link

lasmaty07 commented Jan 20, 2021

Well... this gave me one hell of a headache.
Turns out the name resolution configured on the server tab in octoprint IS NOT using the DNS IP set on the HOST IP field.

My case:

I had configured static IP, Gateway and DNS via the /etc/dhcpcd.conf file on the rpi running OctoPrint. the DNS was set to my local Pi-Hole running on another rpi, with no secondary DNS IP (I know, my bad). So then my Pi-Hole suddenly died (faulty sd) and octoprint said it had no internet connection. The conection to the HOST IP Server (8.8.8.8:53 by default) showed ok. But name resolution was not OK.

Request:

Please add a disclaimer on the server tab saying that name resolution does not use the IP set on HOST IP field. I cant figure out if this only happens when the /etc/dhcpcd.conf is edited or not. but anyway.

@foosel
Copy link
Member

foosel commented Jan 20, 2021

What made you think it was supposed to be used for name resolution in the first place? It is a connectivity check that utilizes a DNS endpoint by default simply because that is readily and highly available, that doesn't mean it is a DNS configuration or it would explicitly say so (and would also be very much out of scope for OctoPrint). You can configure any IP address and port there.

You are the first person I heard of that assumed this would actually manipulate DNS resolution in any way, I'm a bit worried that adding a statement like you are requesting here would more confuse than help to be honest.

@foosel foosel added the stream candidate Issues that are candidates for live streaming their fixing/implementation. label Mar 9, 2021
foosel added a commit that referenced this issue Mar 23, 2021
If the connectivity check detects that OctoPrint cannot reach the
internet, this will now be reflected on the UI.

Implements #3840
@foosel
Copy link
Member

foosel commented Mar 23, 2021

Implemented and ready for 1.6.0.

image

Icon can also be clicked and links to https://faq.octoprint.org/connectivity-offline

@foosel foosel added done Done but not yet released and removed stream candidate Issues that are candidates for live streaming their fixing/implementation. labels Mar 23, 2021
@foosel
Copy link
Member

foosel commented Apr 27, 2021

1.6.0 has just been released.

@foosel foosel closed this as completed Apr 27, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
done Done but not yet released request Feature request
Projects
None yet
Development

No branches or pull requests

3 participants