dunkmann00 / PrusaLinkiOS

iOS app to access PrusaLink from your Prusa printer on your local network.
https://apps.apple.com/us/app/prusalinkios/id6467438508
MIT License
20 stars 0 forks source link

Not limiting to private IPs #9

Open AssetBurned opened 11 months ago

AssetBurned commented 11 months ago

Hi,

rather then forcing using an IP address that is private, the app should throw an warning and still allow using non private IP ranges. Just because an IP is not from an private IP range, it doesn’t mean it can directly accessed from the internet.

CU AssetBurned

dunkmann00 commented 11 months ago

Hello @AssetBurned,

This is true.

I explained why I am hesitant to allow what you described here.

What type of setup do you have where you are trying to access PrusaLink with a public IP Address?

AssetBurned commented 11 months ago

Actually that posting makes the situation even more restrictive then I thought. Not only do you not allow “public IPs” you are also not allowing DNS records or even a IPv6.

So my university uses IP addresses that are part of an national education/science network infrastructure, for all of their infrastructure. Students and staff that are using hotspots are getting private IP addressed. A split Horizont DNS makes DNS records only accessible from within the network and multiple layers of firewall if keeps things inaccessible from the outside world. Think think of that setup.

so with the way your app currently restricts the connection I couldn’t even connect to the printer on IPv6 with a link local IP or if I would map an DNS record or a broadcasted hostname to any sort of IP…. Oh by the way 169.254.x.x is also shown as invalid IP. https://en.m.wikipedia.org/wiki/Link-local_address

I do understand that there might be restrictions regarding accessing the bad World Wide Web, but it might be smarter to filter in a different way. E.g. if uou really just show the content of the Prusa printers page… why not filtering for some strings that are in the response?

dunkmann00 commented 11 months ago

The approach currently used was chosen because it is simple and would work when using PrusaLink how Prusa instructs you to with a basic setup (here for example).

I'm open to changing this, but I was not going to proactively change it without knowing how others using the app were having issues. I appreciate you explaining how you connect to PrusaLink and how this is not possible with the app as it currently works.

I think it fair to say that this is not a common setup, so I would imagine there aren't many others who would be faced with the exact same issue. But there probably are other reasons one would need more flexibility than is currently afforded.