Deployment of individual nodes in Node-RED - node.js

Node-RED has very nice "single-click deployment" feature. Using this feature, node-red deploys all its nodes and flows very quickly.
However, I would like to know - where flows and nodes ,we develop in Node-RED editor, are deployed when we click "deploy" button in the node-RED? The reason why I am asking because I would like to deploy Node-RED's generated code ( I guess it is in Node.js) on remote devices (e.g., Android) automatically.
I know one of solution to connect is -- run MQTT publisher on Android device and write subscriber in MQTT subscriber in NodeRED to get event data. But, the problem with this solution is - manual deployment (time consuming, error prone).
As Tiago has suggested in the answer section of this question, Node-RED generates JSON files in the useDir according to nodes and flows we define in the Node-RED editor. Can we get node.js files, instead of JSON files ? This would help us to deploy device specific code on each device without loading Node-RED editor on each device?

You can copy your userDir on those remote devices and launch node-red:
Your flows as well as your settings file is there:
# /opt/node/bin/node-red -help
Node-RED v0.12.1
Usage: node-red [-v] [-?] [--settings settings.js] [--userDir DIR] [flows.json]
Options:
-s, --settings FILE use specified settings file
-u, --userDir DIR use specified user directory
-v enable verbose output
-?, --help show usage
My userDir:
root#arm:~# find /root/.node-red/
/root/.node-red/
/root/.node-red/lib
/root/.node-red/lib/flows
/root/.node-red/settings.js
/root/.node-red/flows_arm.json
/root/.node-red/.config.json
/root/.node-red/.flows_arm.json.backup
BTW your flow is just a json file, take a look at it I'm sure you understand how it works :)

Related

jhipster warn org.apache.kafka.clients.NetworkClient Broker may not be available

So I made a helloworld jhipster application and everything seems to be working fine but I'm getting this warning about every 3 seconds and it's clouding up my output:
WARN 542 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient : [Producer clientId=producer-1] Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available.
Anybody know what's causing this? It's apparently not critical because everything seems to be working but it is quite aggravating, since I have to scroll way up in the terminal to find any actually relevant output, like for example what port the application is running on.
It looks like you selected the option to use Apache Kafka when you generated your project. Using Kafka is completely optional and requires a few extra steps as described in the official documentation (Using Kafka).
If this is just a "Hello World" app your best option is probably to just regenerate the project without Kafka. Otherwise, you will have to follow the steps in the documentation I linked above.
Basic instructions to use Kafka
Install Docker Desktop if you don't have it already.
Restart your computer as requested, and remember to enable hardware virtualization in your BIOS if you have it disabled.
Navigate to the root folder of your project (where your /src/ folder is) and execute docker-compose -f src/main/docker/kafka.yml up -d
Wait for the process to complete.
Add .antMatchers("/api/<appName>-kafka/publish").permitAll() to your SecurityConfiguration.java where <appName> is the name you gave while generating your project. Note that you must add this line before .antMatchers("/api/**").authenticated().
Now you can launch your application.
At this point everything is configured, so the 'Broker may not be available' messages should be gone.

Unable to log into Hyperledger cello operator dashboard

I just installed hyperledger cello following the instructions here The operator dashboard opens up at port 8080 but when I try logging in with the credentials admin:pass as suggested by tutorials like these, a spinner appears on the login button for a while and then the button becomes active again.
Are there any other credentials one can use to log into the operator dashboard? I can't log into the operator dashboard and I can't access the user dashboard. The user dashboard container is not running and there's nothing running on my port 8081 where the user dashboard should be. Please help.
I think maybe you are running the service under dev mode, and if you run dev mode, must compile js files for operator dashboard, if not operator dashboard can't find any js files needed, so after you login the page is empty. In the latest code, will compile js files if you run it in dev mode, such as:
MODE=dev make start
So please try again after you clone the latest code, and if you also have any problem, can comment more here.
And We have released v0.9.0-alpha version, and in the newest version have some new feature, include:
Support kubernetes agent.
Can apply fabric 1.2 chain in user dashboard, and use it.
And this is the new tutorial, in this tutorial include:
How to setup master service.
How to setup k8s, docker worker node.
How to create host for k8s, docker type in operator dashboard.
How to create chain in operator dashboard.
Apply & Use fabric chain in user dashboard, include fabric v1.0 & v1.2.

How could I prohibit anonymous access to my NodeRed UI Dashboard on IBM Cloud(Bluemix)?

I'm working with node-red, on boilerplate IBM cloud. I know that there is a way, changing the value of enviroments variables(NODE_RED_USERNAME and NODE_RED_PASSWORD), to change username and password of the editor flow. But, what about UI dashboard? I mean using dashboard nodes. Forbid access to
https://noderedservicename.mybluemix.net/ui/
I know that on the code, changing the variable httpNodeAuth on the file settings.js I can do what I want. What is the way for doing that on IBM Cloud?
Thank you in advance!
You need to add the httpNodeAuth (not the httpAdminAuth as this is for controlling access to the Node-RED editor and can done with the environment variables discussed in the other answer.) to the app/bluemix-settings.js file.
Something like this:
...
httpStatic: path.join(__dirname,"public"),
httpNodeAuth: {user:"user",pass:"$2a$08$zZWtXTja0fB1pzD4sHCMyOCMYz2Z6dNbM6tl8sJogENOMcxWV9DN."},
functionGlobalContext: { },
...
Details of how to generate the pass can be found here
There are a number of ways you can edit the file, some of which include linking the Node-RED deployment to a git repository or downloading the whole app, editing the file and pushing it back to Bluemix (when you first deploy Node-RED from the starter pack it gives you instructions on how to download the source to make changes and then push them back. You can get to these instructions by clicking on the "Getting started" link in your Node-RED Bluemix console page).
But the quickest/simplest/dirtiest way is probably to just SSH into the instance and change the file with something like vi. Details on how to ssh to an app instance can be found here. But the following should work:
cf ssh [app name]
Once you have edited the file you will need to tell bluemix to restart the app. You can do this from the web console or with the cf command line tool.
(The changes made by this method will not survive if the app is restaged, or bluemix decides to move your instance to another machine internally because it will rebuild the app from the pushed sources. The permanent solution is to download the source, edit and push back)
This link will help you but it's written in Japanese.
http://dotnsf.blog.jp/archives/1030376575.html
Summary
You can define the "user-defined" environment variables through the IBM Cloud dashboard.
It contains the variables to protect Node-RED GUI.
You have to be set as follows
NODE_RED_USERNAME : username
NODE_RED_PASSWORD : password

Problems running large command line program (Inkscape) in Azure Function app or App Service

I wasn't sure whether to ask this in an Inkscape specific forum or here in Azure. I tagged both.
My goal is to run a windows build of Inkscape in a cloud function preferably or in an App Service to open up different vector files and send them back to the user as a plain SVG.
I've downloaded the binary archive (https://inkscape.org/en/release/0.92.2/windows/32-bit/) and extracted it in Kudu on both a paid App Service and in a Function App.
When I run inkview.com it seems to be working. It outputs info to cmd
But when I run inkscape.com it just stays open for a couple of seconds and quits. (Just outputs a blank line and exits) I've tried -V and -? and many other commands (also using the -Z without GUI command).
Does anybody have an idea of what's going on here? Is Azure perhaps missing some dependencies that Inkscape needs to run? Any ideas on how to troubleshoot?
Thanks in advance.
Azure Functions, like WebApps and Mobile Apps, run in an App Service. The App Service runs in a secure environment called a sandbox which imposes certain limitation. Amongst them, is the use of GDI+.
With Inkspace being a graphics program, I can only imagine that it is making use of GDI+, so it would be blocked.
You can see the list of limitation https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox#unsupported-frameworks
In order to be able to run inkspace in Azure, you need to host in something other than App Service, such as a VM, Cloud Service, Service Fabric, Containers... etc.

creating a performance tool for web based GUI

I want to create an automated performance metric gathering tool, to get various metrics for page load times for a flash based web application. I am doing the web automation using a batch script, and then I want to collect the various metrics using browsermob-proxy (http://opensource.webmetrics.com/browsermob-proxy/), it exports the metrics in a HAR file. I've never done this before so I was wondering if this approach is okay? What are the steps to using browswermob-proxy for windows (firefox). There is no information about windows in the documentation, just linux. I know I run the proxy from the /bin directory, then what do I need to do?
I had downloaded the copy from the browsermob zip from here..http://opensource.webmetrics.com/browsermob-proxy/ Unzip and refer the readme.md
The readme file in the browsemob zip, specifies the instructions to start the proxy server. Once the server is started, you would need to specify the server port and machine ip in your firefox proxy settings (from options->advanced->network>settings. Then trigger your urls on this browser.

Resources