I have been running a dashboard with some quite complex flows and nodes to show various environmental monitors passing data via MQTT. Node-red is installed on an AWS Ubuntu instance. This morning the dashboard UI is showing "Welcome to the Node Red dashboard" and no content. Accessing Node Red gives me the normal workspace but with no flows visible. The AWS instance has been stable and has not restarted. I have no idea what might have happened for me to have lost all of my content. Does anyone have any pointers of where I should start the journey to trying to recover my system? I'm pretty new to all of this and would be gutted if I had lost all of my work somehow.
In newer versions of Node-RED, there is an entry in ~/.node-red/settings.js that tells the instance where the flows should be found. Without this, Node-RED will look for flows_<hostname>.json and therefore, if the hostname is dynamic, node-red will not find a flows file.
In short, set a definite flows file using the setting flowFile: 'flows.json
From the docs:
the file used to store the flows. Default: flows_<hostname>.json
So I am guessing that any change in hostname will not have had an impact. The flows.json file itself has a timestamp of 5am this morning. I am starting to think that I have possibly been hacked. The flows.json file that I can see just seems to be a collection of "exec" nodes, but I have no idea whether that is unusual or not.
Any node-red accessible from the internet without requiring credentials to get in is liable to be hacked. There are bots out there looking for them. You will have to rebuild the whole system I am sorry to say, and put it down to a learning exercise.
Then read this FAQ post for advice on how to safely access node-red over the internet.