Hello.
I have a problem with node-red that I don't know what to do anymore.
Every so often, varying between two weeks and 2 or 3 days, the system deletes all the data in the flows.json file and the flows disappear.
Two months ago I changed from Raspberry Pi 3B to 4, I installed everything from scratch, but the problem persists.
I have a home automation application, temperatures, smoke detectors, etc., and I can't trust the system anymore.
No no no, I don't want to access your Node-red, I wanted to find out if you might have been hacked, which would be possible if (for example) you had set up port forwarding on your router.
Reinstall the entire operating system on the Node-red device.
Check all of your computers for viruses.
If you restore Node-red from a backup, check all the flows for nodes you don't recognise, especially exec nodes. Note that these nodes might not be easily visible in the editor desktop.
Search the forum for advice on securing Node-red.
Password protect your editor.
Do not use port forwarding!
Please remember to change any exposed passwords. Also, check anything else that is on your local network. For example, your router - if an attacker had access to Node-RED, they could easily have made changes to anything that they could access. Especially if you have used default logins for things like routers, the Pi, etc.