fluidd-core / fluidd

Fluidd, the klipper UI.
https://docs.fluidd.xyz
GNU General Public License v3.0
1.37k stars 421 forks source link

How can I access multiple Fluidd printers through a domain name on the Intel network? #1180

Closed zhuwei closed 12 months ago

zhuwei commented 1 year ago

Is your feature request related to a problem? Please describe

When there is only one printer, the domain name defaults to accessing port 80 (or a custom port). However, when there are multiple printers (such as port 7125/7126/7127), fluid defaults to accessing port 7125, and this port does not need to be mapped to the public network. How can we access ports 7126/7127 at this time?

Describe the solution you'd like

Although I can map 7126/7127 to an external network, this method is extremely insecure. Is there a better way?

Describe alternatives you've considered

No response

Additional information

No response

pedrolamas commented 12 months ago

Hi @zhuwei, you need to add the different Moonraker instances manually!

Just press the 3 vertical dots in the top right corner and select "Add printer"

image

Then add each of the urls with its on port (7125, 7126, ...)

image

zhuwei commented 12 months ago

Hi @zhuwei, you need to add the different Moonraker instances manually!

Just press the 3 vertical dots in the top right corner and select "Add printer"

image

Then add each of the urls with its on port (7125, 7126, ...)

image

If I map the two printer ports corresponding to 7126/7127 to the public network, then the addition you mentioned is acceptable. But in this case, exposing too many ports is extremely unsafe

pedrolamas commented 12 months ago

Assuming that by "public network" you are talking about the internet, I would strongly recommend that you DO NOT do that and instead use a VPN to access it instead.

Having said that, exposing port 80 (which is Nginx pointing to Fluidd HTTP port and Moonraker 7125) or directly 7125 will produce the exact same result!

zhuwei commented 12 months ago

假设您所说的“公共网络”指的是互联网,我强烈建议您不要这样做,而应使用 VPN 来访问它。

话虽如此,暴露端口 80(Nginx 指向 Fluidd HTTP 端口和 Moonraker 7125)或直接暴露 7125 将产生完全相同的结果!

Perhaps I didn't express myself clearly, but now I have exposed port 80. There are three printers, with ports 7125/7126/7127. By default, port 7125 is accessible. But 7126/7127 cannot be accessed without exposure, so I came up with the idea of using the URL path( http://www.domain.com/printer1 )Access?

pedrolamas commented 12 months ago

This seems to be beyond the scope of a regular Klipper + Moonraker + Fluidd setup which is unsupported here.

I would recommend that you try Klipper Discord server for a more direct help on this matter.

zhuwei commented 12 months ago

I didn't understand why it was closed? This is clearly what Fluid should do. Klipper+Moonraker has provided multiple instances and localhost ports. However, the approach of fluid is to directly access the Klipper+Moonraker ports, which is typically only applicable to local LANs. I can only find another solution in the end, modify nginx, establish multiple domain proxy ports, and access independent printers separately. But it's clearly very unfriendly. I tried to add multiple URL paths corresponding to each printer instance in the original 80 port, but ultimately failed

pedrolamas commented 12 months ago

The Fluidd GitHub issues are exclusive for Bug Reports or Feature Requests; this issue is neither, hence why it has been closed.

For help, Fluidd Discord server or Klipper Discord server (even better) is the recommended way.


Fluidd was designed around what is made possible by Moonraker, not the other way around.

Moonraker API requires specific paths to be called, so the control we have is to the hostname & port combination.

You can either:

  1. use multiple ports, which is the default OR
  2. use multiple domains or sub-domains (which will open a different can of worms as that requires at least DNS server configuration)

Option 1 is the default, that's how Moonraker and Fluidd/Mainsail has been designed.

Option 2 is a custom setup; it will work, but it is something you need to do yourself as it is unsupported.