/
Instalación y configuración de Node-RED
Search
Try Notion
Instalación y configuración de Node-RED
Fecha publicación
2021/07/02
#
18
Dificultad
Básico
3 more properties
NodeRED es la herramienta ideal para gestionar la lógica de nuestros proyectos. Recolectar datos de sensores y otros dispositivos, procesarlos y enviarlos hacia la BBDD u otros servicios centrales ya sea en local o en la nube.
Directorio
/docker-data/node-red
/docker-data/node-red/data
drwxr-xr-x 3 1000 1000 4096 Mar 24 14:15 data
Shell
mkdir -p /docker-data/node-red/data chown 1000.1000 /docker-data/node-red/data
Bash
/docker/node-red/docker-compose.yml
version: "3.7"
services:
node-red:
container_name: node-red
image: nodered/node-red:latest
environment:
- TZ=Europe/Madrid
volumes:
- /dev:/host/dev
- /etc/localtime:/etc/localtime:ro
- ./data:/data
network_mode: host
healthcheck:
test: ["CMD-SHELL","node /healthcheck.js"]
interval: 60s
timeout: 3s
retries: 3
start_period: 30s
restart: unless-stopped
privileged: true
Añadir usuario para acceder a Node-Red
Crear un nuevo password
docker run -it --rm --entrypoint /bin/sh nodered/node-red node -e "console.log(require('bcryptjs').hashSync(process.argv[1], 8));" your-password-here exit
Shell
/docker-data/data/settings.js
adminAuth: {
type: "credentials",
users: [{
username: "admin",
password: "$2b$08$HaTrfkNeGlpFwOShiFL3V.49VzdgGXdNqRe7hO1Omh/LbsjTP0x16",
permissions: "*"
}]
},
view raw settings.js hosted with ❤ by GitHub
Habilitar proyectos en node-red
/docker-data/data/settings.js
// Customising the editor
editorTheme: {
projects: {
// To enable the Projects feature, set this value to true
enabled: true
}
}
view raw settings.js hosted with ❤ by GitHub
Personalizar NodeRED
/docker-data/data/settings.js
editorTheme: {
page: {
title: "i40sys flows"
},
header: {
title: "Industry 4.0 Systems - Flows",
image: "", // or null to remove image
url: "http://nodered.org" // optional url to make the header text/image a link to this url
},
projects: {
// To enable the Projects feature, set this value to true
enabled: true
}
}
view raw settings.js hosted with ❤ by GitHub