Hello Friends, I hope you are well. I developed a...
# umh-support
o
Hello Friends, I hope you are well. I developed an application for operators working in the field. This application is used for starting and finishing work orders and for waste entries. I ran into a problem when I deployed the application on the server. In this problem; I was sending a query to nodered via http in and getting a response. Because Nodered works with http, browsers did not see the queries as secure and blocked them. When I manually added the site as a secure site, the problem was solved, but can we do a work on https?
j
To add Node-RED via HTTPS, you need to either 1. Publish it on the internet and put something like cloudflare in front of it. additionally, you should add a password protection, so that not everyone ca naccess it 2. add a local certificate and then install the certificate on each device where you want to access from (really not recommended)
d
Since node-red lacks a good authentication one of my ideas to work around this was to use separate containers for each dashbord to work around the authentication problem.. This way you can limit which data each dashboard can access. Also you can use mqtt or redis to send/recieve data..
o
Actually the app works on the internet. I want it to be on the same network in the Node-Red connection anyway. If the device is on a different network, do not use the application. I set it according to this rule. Flow is; 1. The user first joins the MC's network. 2. Then he opens the login screen and logs in with his password. 3. Then the application lists the applications in the field. For this, it sends a post request to the MC. (http://192.168.10.226/nodered/listMachine). This is where the problem arises. Internet Browser is blocking the post request because https is not used. When I add HTTPS, node-red does not respond.
d
so you can login to nodered without http but your api-request gets denied ?
j
in local networks, HTTPS is unfortunately not possible (you can do it, but it will not solve your problem and will be very difficult)
o
I did not know that. Alternatively, I added a code in the application I wrote. Thanks to this, I see the application as safe in the browser and allow access to http via .htaccess. Seems to be resolved now 🙂
Actually I just control the login process with codes. I set up an if - else construct. It checks whether the entered username and password are equal in default or not. (I entered it for now so as not to waste time.) I do not use an api logic in the node-red part. I send a direct post request and get a response.
d
i do not understand your process fully.. can you show a screenshot ?
o
If you have 10 minutes, I can tell you faster over the google meet 😄
j
this should also work in theory
what did you do exactly?
o
I solved the problem in the application I developed. I was getting HTTPs error for each post request. When I added this code the problem was solved.
The application is here. In the codes you will see something called .axios. Those codes create post request. (https://github.com/onurcankaraman/yeniOperatorEkrani). Variable names are usually Turkish. We have developed it so that operators can enter stops and select production orders.
I took a video to explain it more easily. 720p rendering. I can send it in higher resolution if you want.
d
i had just left the office, went to a machine in the factory and then went home for some cross country skiing..
i think i understand better now.. You use another software for the dashboard and make api calls to node-red to send data and that part fails when node-red is on http right?
o
Actually, I thought it was going to be over. I hope you didn't mess with me tonight. I'm reviewing the link. 😄
j
ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
ok, you have your vuejs application running
and the vuejs application is doing requests to a non http website
what you are doing: 1. VueJS website opens 2. Tells the browser to open 192.168.x.x/listmachines 3. Because 192.168.x.x/listmachines is not https, and VueJS is https, it fails
Better: 1. VueJS website opens 2. VueJS tells the browser to call a backend, which then opens the website 192.168.x.x/listmachines and passes the result to the browser.
so you have VueJS --> Backend --> Node-Red list machines --> backend --> VueJS
then it will also work outside of your local network 🙂
btw: i like the operator dashboard 🙂
d
What is the benefit of using VueJS compared to do dashboards in node-red?
o
I will try to run it this way.
Thank you. We are now working to improve its design. We will be working on it in English soon. 🙂
I can make applications independent of Node-red infrastructure. In particular, it can provide flexibility in design. Library supports etc. I can combine different applications here. Also, since I don't want the end user to enter via nodered for operator application, I separated this application. 😄
d
Nice. How about authorization, can you have different user for different dashboards?
How about using mqtt from Vue or is it not supported ?
j
i would consider calling MQTT from the frontend as weird (cannot really explain the reasons, just a gut feeling). mqtt should be handled by a backend and not from the frontend.
o
I actually have authorization in mind. But for this it may be necessary to create a user table in the UMH database. I plan to make this work after I develop and finalize the application. It will work like a competency matrix.
I have no knowledge about this. I'll search and get back.
So, would you recommend using mqtt instead of http requests in this application? (if vue supports it of course)
d
So there is no authorization available in vue? The authorization part is something i am looking at for dashboards since it is not good in node-red and i don't want to use grafana for all dashboards..
o
No. You can do it with Vue, but you have to define who has what authority somewhere. For this, the first method that comes to my mind is to create a user database and define what authority it has. Then you can redirect in vue according to the logged in user.
You can use chart js for your self dashboard. You can see detail in this link: https://www.chartjs.org/
d
Nice. i will have a look and see if it is useful for me.
2 Views