Trying to set the a Username and Password for Node Red.
The instructions require that in "settings.js" be modfied.
I have edited the field and removed the comment //.
Then tried to save by pressing ctrl+o ( ^o)
However i get Error " Error writing settings.js: Permission denied"
Which settings.is are you editing? If you look at the node red log it will tell you which one it is using. Normally this will be .node-red/settings.js and should not need sudo to edit.
You should run the bash <(curl upgrade script from the pi installation docs [1]. Then your flows file and settings.js should be in ~/.node-red. The pre-installed node-red is out of date.
Normally on first run the settings.js file gets copied to ~/.node-red/ directory and is used from there. There are a few reasons why this may not happen (which I can’t recall). You could move it manually I think.
Hi all...
Want to setup some user/pass and always get settings.js as read only.
My settings.js seems to be the one at: /snap/node-red/388/lib/node_modules/node-red, there are others but this in the only one that shown contents that include the adminAuth: {... and all the rest.
It is always read only owned by root.
Sudo cannot changed it. sudo -i turns me into root but I still find the file read only.
Tried changing current dir to the path above and execute: sudo chmod 766 -R settings.js
But still cannot edit settings.js, read only
That should indeed be read-only and should not be the live version you are running with. That one would appear to be the master one provided in the Node-RED package.
You should have another one in your userDir folder so that is what you need to focus on. If you don't have it there, you can manually copy it from the other location.
That you cannot edit it is a benefit and one I suspect that snap is enforcing somehow.
Hi, I see...
Excuse my ignorance but when I open terminal and type ls what I see is:
pcborges@ubuntu:~$ ls
'Area de Trabalho' Downloads influxdbinstall Music snap
Documents Images Models Public Videos
I see no node-red
Should I create a node-red folder?
Where do I copy settings.js to?
Thanks
Paulo
The node-red folder starts with a ., that means it's hidden from the view by default. If you pass the -a option it will show everything including hidden files/folders. If you add -l it will show it as list: ls -a -l
afelix@Hewlett:~$ ls -a -l
total 1464
drwxr-xr-x+ 108 afelix staff 3456 Sep 1 11:55 .
drwxr-xr-x 6 root admin 192 Mar 28 16:06 ..
-rw-r--r--@ 1 afelix staff 69636 Sep 4 08:23 .DS_Store
drwx------ 2 afelix staff 64 Aug 28 16:31 .Trash
-rw------- 1 afelix staff 0 Sep 26 2016 .Xauthority
drwxr-xr-x 6 afelix staff 192 Dec 29 2018 .heroku
-rw------- 1 afelix staff 213 Dec 28 2018 .netrc
drwxr-xr-x 4 afelix staff 128 May 18 2017 .node-gyp
drwxr-xr-x 16 afelix staff 512 Aug 23 14:28 .node-red
drwxr-xr-x 2440 afelix staff 78080 Aug 21 20:40 .npm
Great, it is indeed there. Thanks
cd .node-red worked but the directory is empty
So, I assume I copy settings.js to /snap/node-red/388/lib/node_modules/node-red and edit it accordingly right?
Thanks again
Clearly, your installation went wrong because Node-RED would populate the .node-red folder upon first run. It will copy over settings.js, create your initial flows files and a package.json.
Something is still wrong...
I copied the settings.js from the folder /snap/node-red/388/lib/node_modules/node-red into the folder .node-red (under home) and uncommented:
Back to my earlier question, how do you start node-red?
When it starts it shows you a log of what settings file it is using, node-red version, node version and so on. Are you sure the settings.js file in ~/.node-red is being used?
I'm not sure if you said "Ubuntu GUI" specifically but I'm going to assume you said so and just move on. Does Ubuntu use SystemD these days or something else? Can you try the following two commands and post the output, I don't know which of those you need: sudo systemctl status node-red sudo service node-red status
GUI, I am referring to the the graphic user interface, not the command prompt.
The first returns:
sudo: system: command not found
The second returns:
Unit node-red.service could not be found
I am transcribing because the browser is not in the virtual machine running ubuntu...
Looks like something definitely went wrong during the install but except for this authentication problem node red is working and integrating with grafana without any other problem.
Hi, cannot post more than 3 repplies...
I assume deinstall using the Ubuntu user interface.
Will do and report back
Thanks
###############################################################
Hi there...
Still cannot post new replies...
But just did uninstall using the GUI and reinstalled according to the link
Works perfect, even took the settings.js I have created with the password I defined.
Thanks a lot!
Paulo