-
Notifications
You must be signed in to change notification settings - Fork 50
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
Third party nodes not working when dashboard is accessed via proxy unless admin route also proxied directly #1615
Comments
Strangely, others do not seem to have this problem. See https://discourse.nodered.org/t/when-is-it-advisable-to-use-https-with-tailscale/95251/13 and onwards. |
I see what is happening. If I set httpAdminRoot to, for example, If I don't set httpAdminRoot and go to Should not the umd.js file be fetched from a /dashboard relative location rather then httpAdminRoot? |
I have updated the description and title to reflect the current understanding of the issue. |
May be here you need the information how to reproduce it: |
@colinl The problem you describe is indeed correct. It happens here in the dashboard code. When I for example quickly install a ui-led node and I put a breakpoint in that code snippet, it will fetch the ui-led bundle file from my httpAdminRoot path: Which is no problem in my case, since I also proxy the httpAdminRoot path in Tailscale (similar to how you already had described above). If you know by head which property (from the settings.js file) the dashboard should use, you can try that one and create a pull request. Or can create a pull request if you provide me the details. @ortegafernando |
Thanks for looking into this. My assumption is that it should be fetched from below the |
Perhaps this won't be an issue as the file is fetched in the client browser, not when node-red is loaded. I will implement it and see. |
@colinl If anybody disagrees for some reason, don't hesitate to share your thoughts! Not sure whether that xxx is adjustable or hardcoded to "dashboard". Not at my computer... |
It is a field that, in theory, can be filled in in the dashboard settings (ui-base) config, but at the moment it is preset to dashboard and cannot be changed. I have got part of the way there, I can get the ui-base path setting into the url in the code you pointed to (the source of which is in ui/src/util.mjs) but the problem is that |
Possibly we need something in the NR core that allows /dashboard/resources to pickup the resources in the same way that httpAdminRoot/resources does. But eventually the |
@joepavitt could you possibly provide some guidance here? The fundamental problem is that the third party node's umd.js file is served via |
The proxying side of things is a little outside of my domain, @hardillb may be able to advise. For the serving of the content, serving those files up via |
The result of that is that the third party nodes cannot be loaded when behind a proxy, unless httpAdminRoute is proxied, and is directly mapped to httpAdminRoute. |
With dashboard 1.0 I didn't have this problem even with third party nodes. Only with dashboard 2.0 |
That is a very good point. Using dashboard 1 I installed node-red-contrib-artless-gauge and had a look to see how that is loaded in the browser. It fetches the file |
Thanks for the investigations gents - we shall make it so |
I can handle fairly simple things in the dashboard code, but I think this is beyond my capabilities, otherwise I would have a go myself. |
Current Behavior
[Editted description following analysis described in comments below]
If the dashboard is accessed via a proxy then it may not be possible to load third party ui nodes. The reason is that then the node's
umd.js
file is loaded it is fetched using the httpAdminRoute setting (which may be empty) rather than the dashboard route. If the admin route is not also proxied then the fetch fails with a 404 Not Found error.For example, if httpAdminRoute is set to
flow_editor
then the url used for the classic gauge js file ishttp://domain/flow_editor/resources/@colinl/node-red-dashboard-2-ui-gauge-classic/ui-gauge-classic.umd.js
This will only work if
flow_editor/
is proxied toflow_editor/
I assume that the file should be accessed via the dashboard route so that it does not rely on the admin route being proxied.
[Original description]
When Tailscale is used to connect to a server running node-red, with https, then, in the dashboard, third party ui nodes do not work.
In the developer console I see, for example, a 404 error fetching
https://xxx.tailxxx.ts.net/resources/@colinl/node-red-dashboard-2-ui-gauge-classic/ui-gauge-classic.umd.js
Using tailscale I have proxied /dashboard to localhost:1880/dashboard, and I access the dashboard using https://xxx.tailxxx.ts.net/dashboard. I suspect that the failing uri should actually be
https://xxx.tailxxx.ts.net/dashboard/resources/@colinl/node-red-dashboard-2-ui-gauge-classic/ui-gauge-classic.umd.js
If I access the dashboard through tailscale using
http://xxx.tailxxx.ts.net:1880/dashboard
then it is fineMost likely this is the same problem as #1612
Expected Behavior
No response
Steps To Reproduce
No response
Environment
Have you provided an initial effort estimate for this issue?
I am not a FlowFuse team member
The text was updated successfully, but these errors were encountered: