{ "module": "nodered", "version": "1", "emits": [ "flows.deployed" ], "own-secrets": { "admin": { "path": "${dir:mesh-state}/admin", "taken": "at-start" }, "api-token": { "path": "${dir:mesh-state}/api-token", "taken": "at-start" } }, "capabilities": [ "container-runtime" ], "listens": [ { "name": "web", "port": 1880, "protocol": "tcp", "from": "mesh", "why": "the flow editor and the endpoints flows expose" } ], "data": { "own": [ { "id": "data", "path": "${dir:data}", "class": "valuable", "why": "flows and their credentials" } ] }, "config": { "flow-file": { "type": "string", "description": "Node-RED's flowFile setting: the file in the user directory the flows are kept in.", "trusted": true, "default": "flows.json" }, "flow-file-pretty": { "type": "boolean", "description": "Node-RED's flowFilePretty setting: whether the flows file is written indented.", "trusted": true, "default": true }, "diagnostics": { "type": "object", "description": "Node-RED's diagnostics setting: whether its diagnostics report is on, and shown in the editor.", "trusted": true, "default": { "enabled": true, "ui": true } }, "runtime-state": { "type": "object", "description": "Node-RED's runtimeState setting: whether flows may be started and stopped from the editor.", "trusted": true, "default": { "enabled": false, "ui": false } }, "logging": { "type": "object", "description": "Node-RED's logging setting: the console log's level, and whether metrics and audit events are logged.", "trusted": true, "default": { "console": { "level": "info", "metrics": false, "audit": false } } }, "export-global-context-keys": { "type": "boolean", "description": "Node-RED's exportGlobalContextKeys setting: whether a function node may list the global context's keys.", "trusted": true, "default": false }, "external-modules": { "type": "object", "description": "Node-RED's externalModules setting: which modules the editor may install, and from where.", "trusted": true, "default": {} }, "editor-theme": { "type": "object", "description": "Node-RED's editorTheme setting: the editor's look and features, projects among them.", "trusted": true, "default": { "projects": { "enabled": false } } }, "function-external-modules": { "type": "boolean", "description": "Node-RED's functionExternalModules setting: whether a function node may load modules of its own.", "trusted": true, "default": true }, "debug-max-length": { "type": "number", "description": "Node-RED's debugMaxLength setting: the most characters a debug message shows, a count.", "trusted": true, "default": 1000 }, "mqtt-reconnect-time": { "type": "number", "description": "Node-RED's mqttReconnectTime setting: how long an MQTT node waits before reconnecting, in milliseconds.", "trusted": true, "default": 15000 }, "serial-reconnect-time": { "type": "number", "description": "Node-RED's serialReconnectTime setting: how long a serial node waits before reconnecting, in milliseconds.", "trusted": true, "default": 15000 }, "mqtt": { "type": "object", "description": "The broker nodes the module's MQTT step keeps pointed at the mesh's broker, as {\"brokers\": [their ids]}; empty, none.", "trusted": true, "default": {} }, "time-zone": { "type": "string", "description": "The time zone the flows schedule and format in, an IANA name such as Europe/Brussels; unset, the container's UTC.", "trusted": true, "default": "" } }, "resources": [ { "id": "mesh-state", "type": "directory", "mode": "0700", "place": "mesh" }, { "id": "state", "type": "directory", "mode": "0700", "place": "." }, { "id": "data", "type": "directory", "mode": "0700", "owner": "1000:1000" }, { "id": "written", "type": "directory", "mode": "0700" }, { "id": "settings-code", "type": "file", "path": "${dir:state}/settings.js", "mode": "0600", "owner": "1000:1000", "template": "files/settings.js" }, { "id": "settings", "type": "file", "path": "${dir:state}/settings.json", "mode": "0600", "owner": "1000:1000", "merge": "json", "takes-config": [{"key": "flow-file", "as": "flowFile"}, {"key": "flow-file-pretty", "as": "flowFilePretty"}, "diagnostics", {"key": "runtime-state", "as": "runtimeState"}, "logging", {"key": "export-global-context-keys", "as": "exportGlobalContextKeys"}, {"key": "external-modules", "as": "externalModules"}, {"key": "editor-theme", "as": "editorTheme"}, {"key": "function-external-modules", "as": "functionExternalModules"}, {"key": "debug-max-length", "as": "debugMaxLength"}, {"key": "mqtt-reconnect-time", "as": "mqttReconnectTime"}, {"key": "serial-reconnect-time", "as": "serialReconnectTime"}, "mqtt", {"key": "time-zone", "as": "timeZone"}], "template": "files/settings.json" }, { "id": "server", "type": "container", "name": "nodered", "image": "nodered/node-red@sha256:a649dd711d55490151a2c39a8e48ad0c44325488fbc0e66315f2d2e19e5e1ace", "health": { "kind": "runtime" }, "env": { "TZ": "Etc/UTC" }, "ports": [ "1880" ], "args": [ "--settings", "/data/settings.js" ], "volumes": [ "${dir:data}:/data", "${dir:state}/settings.js:/data/settings.js:ro", "${dir:state}/settings.json:/data/settings.json:ro" ], "restart-on": [ "settings-code", "settings" ] }, { "id": "runtime-config", "type": "file", "path": "${dir:mesh-state}/config.json", "mode": "0600", "template": "files/config.json" }, { "id": "mqtt-env", "type": "file", "path": "${dir:state}/mqtt.env", "mode": "0600", "template": "files/mqtt.env" }, { "id": "mqtt", "type": "process", "name": "nodered-mqtt", "artifact": "code", "run": [ "node", "mqtt/index.js" ], "run-once": true, "env-file": [ "${dir:state}/mqtt.env" ], "restart-on": [ "mqtt-env", "bound-mqtt-topic", "secret-mqtt-topic", "settings" ] } ], "requires": [ "mqtt-topic", "route" ], "contributes": { "mqtt-topic": { "topics": [ "#" ] }, "route": { "label": "nodered", "endpoint": "web" } }, "binds": { "route": "${dir:state}/route.json", "mqtt-topic": "${dir:state}/mqtt-topic.json" }, "secrets": { "mqtt-topic": "${dir:state}/mqtt-topic.secret" }, "build": { "artifacts": [ { "name": "code", "kind": "bundle", "language": "typescript", "entrypoints": [ "tools/index.js", "mqtt/index.js" ], "loads": [ "tools/index.js" ], "env": { "MESH_NODERED_URL": "http://127.0.0.1:${port:1880}", "MESH_NODERED_CONFIG_FILE": "${dir:mesh-state}/config.json" } }, { "name": "files", "kind": "archive", "from": "files" } ] } }