Setup Duplicati and Portainer credentials after the servers are up.
Duplicati Passphrase: L2@Ki
Rename or copy the **.env
file to .env
and add the credentials.
First access the shell of the container docker exec -it mongo bash
and run the following commands,
> use smarty
> db.createUser(
{
user: "root",
pwd: "********",
roles: [
{ role: "readWrite", db: "smarty" }
]
}
)
We need to add the following code snippet to the Node-RED settings.js
file. The passwords need to be hashed and can be generated using this site
Edit the settings.js
file using the command sudo nano /opt/volumes/node-red/data/settings.js
, add the following snippet and restart the docker container, docker restart node_red
adminAuth: {
type: "credentials",
users: [
{
username: "admin",
password: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
permissions: "*"
},
{
username: "app",
password: "xxxxxxxxxxxxxxxxxxx",
permissions: "read"
}
]
}
To make the http calls to the platform secured, add the following line to the settings.js
file,
httpNodeAuth: {
user:"app",
pass:"xxxxxxxxxxxxxxxxxxxxxxxx"
},
For serving static assets like images, without going through the platform, add the following line to the file,
httpStatic:"/assets/",
where you can upload all the static files to the /assets/
folder and can be accssed by using http(s)//<node_red_ip>:<port>/<aeet_path>
endpoint.