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

Third party nodes not working when dashboard is accessed via proxy unless admin route also proxied directly #1615

Open
colinl opened this issue Feb 11, 2025 · 3 comments
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do

Comments

@colinl
Copy link
Contributor

colinl commented Feb 11, 2025

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 is
http://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 to flow_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 fine

Most likely this is the same problem as #1612

Expected Behavior

No response

Steps To Reproduce

No response

Environment

  • Dashboard version: 1.22.1
  • Node-RED version: 4.0.8
  • Node.js version: 22
  • npm version:
  • Platform/OS: Ubuntu
  • Browser: Edge

Have you provided an initial effort estimate for this issue?

I am not a FlowFuse team member

@colinl colinl added bug Something isn't working needs-triage Needs looking at to decide what to do labels Feb 11, 2025
@colinl
Copy link
Contributor Author

colinl commented Feb 11, 2025

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 am investigating further.

@colinl
Copy link
Contributor Author

colinl commented Feb 11, 2025

I see what is happening. If I set httpAdminRoot to, for example, /flow_editor and, taking the proxy out of the equation, access the dashboard locally at http://<IP>:1880/dashboard and look in the developer tools then I see that it is fetching the umd.js file from http://<IP>:1880/flow_editor/resources/@colinl/node-red-dashboard-2-ui-gauge-classic/ui-gauge-classic.umd.js. Note that it is using httAdminRoot. If I now access it through the proxy then it tries to fetch it from https://xxx.tailxxxx.ts.net/flow_editor/resources/@colinl/node-red-dashboard-2-ui-gauge-classic/ui-gauge-classic.umd.js. But I have not proxied /flow_editor so it does not find it.

If I don't set httpAdminRoot and go to http://<IP>:1880/dashboard then the file is fetched from http://<IP>:1880/resources/@colinl/node-red-dashboard-2-ui-gauge-classic/ui-gauge-classic.umd.js, but again, since I have not proxied / to / it does not work. In fact if I do proxy / to / then it does work.

Should not the umd.js file be fetched from a /dashboard relative location rather then httpAdminRoot?

@colinl colinl changed the title Third party nodes not working when dashboard is accessed through tailscale with https Third party nodes not working when dashboard is accessed via proxy unless admin route also proxied directly Feb 12, 2025
@colinl
Copy link
Contributor Author

colinl commented Feb 12, 2025

I have updated the description and title to reflect the current understanding of the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Needs looking at to decide what to do
Projects
Status: Backlog
Development

No branches or pull requests

1 participant