From 42dfa7c7b16bae4bbba013fa35275f544bfb30a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20J=C3=A4ckle?= Date: Mon, 27 Jan 2025 10:47:28 +0100 Subject: [PATCH] remove unused nodered config from sandbox deployment --- deployment/docker/sandbox/docker-compose.yml | 8 --- deployment/docker/sandbox/nginx.conf | 10 --- .../docker/sandbox/nodered/flows-ditto.json | 1 - .../docker/sandbox/nodered/package.json | 12 ---- deployment/docker/sandbox/nodered/settings.js | 62 ------------------- 5 files changed, 93 deletions(-) delete mode 100644 deployment/docker/sandbox/nodered/flows-ditto.json delete mode 100644 deployment/docker/sandbox/nodered/package.json delete mode 100644 deployment/docker/sandbox/nodered/settings.js diff --git a/deployment/docker/sandbox/docker-compose.yml b/deployment/docker/sandbox/docker-compose.yml index eedd3bb9d2..884a474b80 100644 --- a/deployment/docker/sandbox/docker-compose.yml +++ b/deployment/docker/sandbox/docker-compose.yml @@ -217,14 +217,6 @@ services: options: max-size: 10m -# node-red: -# image: docker.io/nodered/node-red-docker:latest -# volumes: -# - /opt/docker-volumes/nodered-data:/data:rw -# - ./nodered/settings.js:/data/settings.js:ro -# - ./nodered/package.json:/data/package.json:rw -# - ./nodered/flows-ditto.json:/data/flows-ditto.json:rw - nginx: image: docker.io/nginx:1.27-alpine deploy: diff --git a/deployment/docker/sandbox/nginx.conf b/deployment/docker/sandbox/nginx.conf index 0ac27a5462..cdb99a4609 100644 --- a/deployment/docker/sandbox/nginx.conf +++ b/deployment/docker/sandbox/nginx.conf @@ -274,16 +274,6 @@ http { proxy_set_header Host $http_host; } -# location /nodered { -# proxy_pass http://node-red:1880/nodered; -# proxy_http_version 1.1; -# proxy_set_header Host $host; -# proxy_set_header Upgrade $http_upgrade; -# proxy_set_header Connection 'upgrade'; -# proxy_set_header Host $host; -# proxy_cache_bypass $http_upgrade; -# } - location /oauth2/google/token { # set $args ''; proxy_set_body $request_body&client_secret=TODOinsertOauth2clientSecret; diff --git a/deployment/docker/sandbox/nodered/flows-ditto.json b/deployment/docker/sandbox/nodered/flows-ditto.json deleted file mode 100644 index 3bd7fd1160..0000000000 --- a/deployment/docker/sandbox/nodered/flows-ditto.json +++ /dev/null @@ -1 +0,0 @@ -[{"id":"75607f17.f82d4","type":"tab","label":"Ditto example","disabled":false,"info":""},{"id":"c6f97f88.92567","type":"debug","z":"75607f17.f82d4","name":"print control message","active":true,"console":"false","complete":"payload","x":460,"y":180,"wires":[]},{"id":"39d53b0c.20f634","type":"inject","z":"75607f17.f82d4","name":"Request events","topic":"","payload":"START-SEND-EVENTS","payloadType":"str","repeat":"","crontab":"","once":true,"x":140,"y":80,"wires":[["f6c0858f.9bc5d8"]]},{"id":"2f9e4db.b6296b2","type":"websocket out","z":"75607f17.f82d4","name":"Ditto WS","server":"","client":"58771f30.1013c","x":500,"y":20,"wires":[]},{"id":"34ef1b22.29e1f4","type":"websocket in","z":"75607f17.f82d4","name":"Ditto WS","server":"","client":"58771f30.1013c","x":60,"y":200,"wires":[["445bceed.f480c"]]},{"id":"e17ef752.80a388","type":"inject","z":"75607f17.f82d4","name":"keep alive","topic":"","payload":"","payloadType":"date","repeat":"30","crontab":"","once":false,"x":150,"y":20,"wires":[["508e0439.acc04c"]]},{"id":"508e0439.acc04c","type":"function","z":"75607f17.f82d4","name":"","func":"msg.payload = new Buffer([]); \nreturn msg;","outputs":1,"noerr":0,"x":310,"y":20,"wires":[["2f9e4db.b6296b2"]]},{"id":"8fac3744.27b0e8","type":"inject","z":"75607f17.f82d4","name":"Request messages","topic":"","payload":"START-SEND-MESSAGES","payloadType":"str","repeat":"","crontab":"","once":true,"x":130,"y":120,"wires":[["f6c0858f.9bc5d8"]]},{"id":"222edbbb.4a7da4","type":"switch","z":"75607f17.f82d4","name":"","property":"payload.path","propertyType":"msg","rules":[{"t":"eq","v":"/inbox/messages/ping","vt":"str"},{"t":"eq","v":"/features/weather/inbox/messages/fetchWeather","vt":"str"},{"t":"else"}],"checkall":"true","outputs":3,"x":550,"y":340,"wires":[["bdea63a.85b05a"],["e385a15a.a77eb"],[]]},{"id":"e4110ce2.417e4","type":"debug","z":"75607f17.f82d4","name":"print unknown messages","active":true,"console":"false","complete":"payload","x":810,"y":220,"wires":[]},{"id":"757040a9.fcc6a","type":"json","z":"75607f17.f82d4","name":"","pretty":false,"x":170,"y":260,"wires":[["9c749ffc.d30a6"]]},{"id":"445bceed.f480c","type":"switch","z":"75607f17.f82d4","name":"protocol/json","property":"payload","propertyType":"msg","rules":[{"t":"regex","v":"^.*:ACK$","vt":"str","case":false},{"t":"else"}],"checkall":"true","outputs":2,"x":210,"y":200,"wires":[["c6f97f88.92567"],["757040a9.fcc6a","8209410f.7a4af"]]},{"id":"f6c0858f.9bc5d8","type":"delay","z":"75607f17.f82d4","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":320,"y":80,"wires":[["2f9e4db.b6296b2"]]},{"id":"8209410f.7a4af","type":"debug","z":"75607f17.f82d4","name":"print Ditto Protocol message","active":false,"console":"false","complete":"payload","x":480,"y":220,"wires":[]},{"id":"16ce4f12.bab6e1","type":"debug","z":"75607f17.f82d4","name":"print response","active":true,"console":"false","complete":"payload","x":1300,"y":480,"wires":[]},{"id":"7bbe851e.c6d5ec","type":"websocket out","z":"75607f17.f82d4","name":"Ditto WS","server":"","client":"58771f30.1013c","x":1320,"y":520,"wires":[]},{"id":"bdea63a.85b05a","type":"template","z":"75607f17.f82d4","name":"create response message","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"topic\": \"{{{payload.topic}}}\",\n \"path\": \"{{{payload.path}}}\",\n \"headers\": {\n \"thing-id\": \"{{{payload.headers.thing-id}}}\",\n \"direction\": \"FROM\",\n \"subject\": \"{{{payload.headers.subject}}}\",\n \"correlation-id\": \"{{{payload.headers.correlation-id}}}\",\n \"content-type\": \"text/plain\"\n },\n \"status\": 200,\n \"value\": \"PONG! {{{payload.value}}}\"\n}","output":"str","x":790,"y":340,"wires":[["a0118226.dd3fb"]]},{"id":"a0118226.dd3fb","type":"json","z":"75607f17.f82d4","name":"","pretty":false,"x":1170,"y":400,"wires":[["f766b0d5.ca765"]]},{"id":"f766b0d5.ca765","type":"change","z":"75607f17.f82d4","name":"change to response","rules":[{"t":"delete","p":"_session","pt":"msg"},{"t":"change","p":"payload.path","pt":"msg","from":"/inbox/","fromt":"str","to":"/outbox/","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1250,"y":440,"wires":[["16ce4f12.bab6e1","7bbe851e.c6d5ec"]]},{"id":"61540745.214348","type":"comment","z":"75607f17.f82d4","name":"/inbox/messages/ping","info":"","x":760,"y":300,"wires":[]},{"id":"eafa4b7e.526398","type":"template","z":"75607f17.f82d4","name":"create response message","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"topic\": \"{{{payload.topic}}}\",\n \"path\": \"{{{payload.path}}}\",\n \"headers\": {\n \"thing-id\": \"{{{payload.headers.thing-id}}}\",\n \"feature-id\": \"{{{payload.headers.feature-id}}}\",\n \"direction\": \"FROM\",\n \"subject\": \"{{{payload.headers.subject}}}\",\n \"correlation-id\": \"{{{payload.headers.correlation-id}}}\",\n \"content-type\": \"application/json\"\n },\n \"status\": 200,\n \"value\": {\n \"city\": \"{{response.name}}\",\n \"temp\": \"{{response.main.temp}}\",\n \"humidity\": \"{{response.main.humidity}}\",\n \"description\": \"{{response.weather.0.description}}\"\n }\n}","output":"str","x":910,"y":520,"wires":[["a0118226.dd3fb"]]},{"id":"e233550b.e71fa8","type":"comment","z":"75607f17.f82d4","name":"/features/weather/inbox/messages/fetchWeather","info":"","x":840,"y":440,"wires":[]},{"id":"5ec25cf6.8404e4","type":"http request","z":"75607f17.f82d4","name":"openweathermap HTTP","method":"GET","ret":"obj","url":"https://api.openweathermap.org/data/2.5/weather?q={{dittopayload.value}},de&appid=b35060c7a0a6c6fdb05f72b8632c7ab4&units=metric","tls":"","x":910,"y":480,"wires":[["3a85b6df.be8fba"]]},{"id":"3a85b6df.be8fba","type":"change","z":"75607f17.f82d4","name":"map","rules":[{"t":"move","p":"payload","pt":"msg","to":"response","tot":"msg"},{"t":"move","p":"dittopayload","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":520,"wires":[["eafa4b7e.526398"]]},{"id":"e385a15a.a77eb","type":"change","z":"75607f17.f82d4","name":"map","rules":[{"t":"move","p":"payload","pt":"msg","to":"dittopayload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":480,"wires":[["5ec25cf6.8404e4"]]},{"id":"9c749ffc.d30a6","type":"switch","z":"75607f17.f82d4","name":"messages/events","property":"payload.path","propertyType":"msg","rules":[{"t":"cont","v":"/inbox/messages/","vt":"str"},{"t":"else"}],"checkall":"true","outputs":2,"x":190,"y":360,"wires":[["222edbbb.4a7da4"],["fe574860.5cfdc8"]],"outputLabels":["messages",""]},{"id":"fe574860.5cfdc8","type":"switch","z":"75607f17.f82d4","name":"","property":"payload.path","propertyType":"msg","rules":[{"t":"eq","v":"/features/trackable/properties/location","vt":"str"},{"t":"else"}],"checkall":"true","outputs":2,"x":90,"y":620,"wires":[["b193ab61.786b48"],[]]},{"id":"3530fe00.538592","type":"comment","z":"75607f17.f82d4","name":"/features/trackable/properties/location","info":"","x":350,"y":500,"wires":[]},{"id":"b193ab61.786b48","type":"change","z":"75607f17.f82d4","name":"map","rules":[{"t":"move","p":"payload","pt":"msg","to":"dittopayload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":540,"wires":[["ea0c4922.778ad8"]]},{"id":"ea0c4922.778ad8","type":"http request","z":"75607f17.f82d4","name":"openweathermap HTTP","method":"GET","ret":"obj","url":"https://api.openweathermap.org/data/2.5/weather?lat={{dittopayload.value.latitude}}&lon={{dittopayload.value.longitude}}&appid=b35060c7a0a6c6fdb05f72b8632c7ab4&units=metric","tls":"","x":450,"y":540,"wires":[["1994bda5.07c622"]]},{"id":"1994bda5.07c622","type":"change","z":"75607f17.f82d4","name":"map","rules":[{"t":"move","p":"payload","pt":"msg","to":"response","tot":"msg"},{"t":"move","p":"dittopayload","pt":"msg","to":"payload","tot":"msg"},{"t":"change","p":"payload.topic","pt":"msg","from":"/things/twin/events/modified","fromt":"str","to":"/things/twin/commands/modify","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":580,"wires":[["18727ed.8350981"]]},{"id":"18727ed.8350981","type":"template","z":"75607f17.f82d4","name":"create twin update message","field":"payload","fieldType":"msg","format":"json","syntax":"mustache","template":"{\n \"topic\": \"{{{payload.topic}}}\",\n \"path\": \"/features/weather/properties/current\",\n \"headers\": {\n \"content-type\": \"application/json\"\n },\n \"value\": {\n \"city\": \"{{response.name}}\",\n \"temp\": \"{{response.main.temp}}\",\n \"humidity\": \"{{response.main.humidity}}\",\n \"description\": \"{{response.weather.0.description}}\"\n }\n}","output":"str","x":460,"y":580,"wires":[["a0118226.dd3fb"]]},{"id":"58771f30.1013c","type":"websocket-client","z":"","path":"wss://demo1:demo@ditto.eclipseprojects.io/ws/1","wholemsg":"false"}] diff --git a/deployment/docker/sandbox/nodered/package.json b/deployment/docker/sandbox/nodered/package.json deleted file mode 100644 index 6cc63e9642..0000000000 --- a/deployment/docker/sandbox/nodered/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "node-red-ditto-sandbox", - "description": "A Node-RED Project for the Eclipse Ditto sandbox", - "version": "0.0.1", - "dependencies": { - "node-red-node-base64": "*", - "node-red-node-random": "*", - "node-red-contrib-amqp": "0.4.*", - "node-red-contrib-crypto-js": "0.1.*", - "node-red-contrib-rhea": "*" - } -} diff --git a/deployment/docker/sandbox/nodered/settings.js b/deployment/docker/sandbox/nodered/settings.js deleted file mode 100644 index 89c0082dfe..0000000000 --- a/deployment/docker/sandbox/nodered/settings.js +++ /dev/null @@ -1,62 +0,0 @@ -module.exports = { - uiPort: process.env.PORT || 1880, - - mqttReconnectTime: 15000, - serialReconnectTime: 15000, - - //socketReconnectTime: 10000, - //socketTimeout: 120000, - //httpRequestTimeout: 120000, - - debugMaxLength: 1000, - debugUseColors: true, - flowFile: 'flows-ditto.json', - - httpRoot: '/nodered', - - adminAuth: { - type: "credentials", - users: [{ - username: "admin", - password: "$2a$08$H7n.UCeFdgxJUwemV6z9YOJXcvUcBHWDLLUBshm7RUOFxFWEbqkz2", - permissions: "*" - }], - default: { - permissions: "read" - } - }, - - // Anything in this hash is globally available to all functions. - // It is accessed as context.global. - // eg: - // functionGlobalContext: { os:require('os') } - // can be accessed in a function block as: - // context.global.os - - functionGlobalContext: { - // os:require('os'), - // octalbonescript:require('octalbonescript'), - // jfive:require("johnny-five"), - // j5board:require("johnny-five").Board({repl:false}) - }, - - // Configure the logging output - logging: { - // Only console logging is currently supported - console: { - // Level of logging to be recorded. Options are: - // fatal - only those errors which make the application unusable should be recorded - // error - record errors which are deemed fatal for a particular request + fatal errors - // warn - record problems which are non fatal + errors + fatal errors - // info - record information about the general running of the application + warn + error + fatal errors - // debug - record information which is more verbose than info + info + warn + error + fatal errors - // trace - record very detailed logging + debug + info + warn + error + fatal errors - // off - turn off all logging (doesn't affect metrics or audit) - level: "info", - // Whether or not to include metric events in the log output - metrics: false, - // Whether or not to include audit events in the log output - audit: false - } - } -}