How to deploy Node-red to the internet?

I am having an issue on making Node-red able to be accessed from the internet. Right now, I have made a Node-red flow but the UI only can be accessed when connecting to the same network. I would like to make my UI to be able being accessed by any network. Here is the flow of my Node-Red

[{"id":"982e4061.92493","type":"function","z":"678b622e.d861ac","name":"","func":"var m = msg.payload.Username;\nvar n = \"smartgreenhouse05\";\nvar x = msg.payload.Password\nvar y = \"Mekatro05\"\n\nif(m == n && x == y)\n{\n    msg.login = 0;\n    msg.payload = \"Login Success\";\n}\nelse if(m == n && x != y)\n{\n    msg.login = 1;\n    msg.payload = \"Wrong Pasword\"\n}\nelse if(m != n && x == y)\n{\n    msg.login = 2;\n    msg.payload = \"Wrong Username\";\n}\nelse\n{\n    msg.login = 3;\n    msg.payload = \"User Unregistered\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":820,"y":600,"wires":[["722a6620.cab6b8"]]},{"id":"722a6620.cab6b8","type":"switch","z":"678b622e.d861ac","name":"","property":"login","propertyType":"msg","rules":[{"t":"eq","v":"0","vt":"str"},{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"},{"t":"eq","v":"3","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":1010,"y":620,"wires":[["235fbb27.06bbe4"],["bcf99422.9864e8"],["e7594ef2.1702c"],["10744471.8d2abc"]]},{"id":"235fbb27.06bbe4","type":"function","z":"678b622e.d861ac","name":"","func":"return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":560,"wires":[["17a18308.dc05ad"]]},{"id":"bcf99422.9864e8","type":"function","z":"678b622e.d861ac","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":600,"wires":[["feffa19a.a1b5b"]]},{"id":"e7594ef2.1702c","type":"function","z":"678b622e.d861ac","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":640,"wires":[["8758df7a.bd684"]]},{"id":"10744471.8d2abc","type":"function","z":"678b622e.d861ac","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1200,"y":680,"wires":[["45fc540c.fd572c"]]},{"id":"1043b401.0bbc6c","type":"function","z":"678b622e.d861ac","name":"","func":"var m = msg.payload.Username;\nvar n = \"smartgreenhouse05\";\nvar x = msg.payload.Password\nvar y = \"Mekatro05\"\n\nif(m == n && x == y)\n{ \n    msg.payload={\"group\":{\"show\":[\"Home_Control\", \"Account_Sign_Out\"],\n    \"hide\":[\"Account_Sign_In\"]}};\n}\nelse if(m == n && x != y)\n{\n    msg.payload={\"group\":{\"hide\":[\"Home_Control\", \"Sign_Out\"]}};\n}\nelse if(m != n && x == y)\n{\n    msg.payload={\"group\":{\"hide\":[\"Home_Control\", \"Sign_Out\"]}};\n}\nelse \n{  \n    msg.payload={\"group\":{\"show\": [\"Account_Sign_In\"], \"hide\": [\"Account_Sign_Out\", \"Home_Control\"]}};\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":820,"y":560,"wires":[["e8e5dbe6.34d2f8","608dbc43.848634"]]},{"id":"7648a6d5.d7f538","type":"inject","z":"678b622e.d861ac","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 00 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":430,"y":520,"wires":[["5d4198be.b0eca8"]]},{"id":"7ba6b632.6d9ca8","type":"function","z":"678b622e.d861ac","name":"in_1","func":"ran = parseInt(Math.random() * 10);\nmsg.topic = \"Input1\";\nmsg.payload = ran;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":1000,"wires":[["8502987f.d648a8"]]},{"id":"14a9fe1f.6c4872","type":"inject","z":"678b622e.d861ac","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":530,"y":1000,"wires":[["7ba6b632.6d9ca8","9e72d244.f8f22","727fc01c.f6ae6","b9c72f53.e5a98","c58c4650.f404e8"]]},{"id":"c58c4650.f404e8","type":"function","z":"678b622e.d861ac","name":"in_1","func":"ran = parseInt(Math.random() * 10);\nmsg.topic = \"Input1\";\nmsg.payload = ran;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":1040,"wires":[["e39bb2ce.f9d88"]]},{"id":"b9c72f53.e5a98","type":"function","z":"678b622e.d861ac","name":"in_1","func":"ran = parseInt(Math.random() * 10);\nmsg.topic = \"Input1\";\nmsg.payload = ran;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":1080,"wires":[["69794a0c.d8a824"]]},{"id":"727fc01c.f6ae6","type":"function","z":"678b622e.d861ac","name":"in_1","func":"ran = parseInt(Math.random() * 10);\nmsg.topic = \"Input1\";\nmsg.payload = ran;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":1120,"wires":[["566443b9.b7981c"]]},{"id":"9e72d244.f8f22","type":"function","z":"678b622e.d861ac","name":"in_1","func":"ran = parseInt(Math.random() * 10);\nmsg.topic = \"Input1\";\nmsg.payload = ran;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":690,"y":1160,"wires":[["e5ff00a0.1b577"]]},{"id":"1f231d13.4a1573","type":"inject","z":"678b622e.d861ac","name":"","props":[{"p":"payload"}],"repeat":"5","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":510,"y":700,"wires":[["65852229.62aefc","76ebfbe1.1dd824","70afb33.fe06a4c","44f169ac.346128","305252e9.c7dc4e"]]},{"id":"70afb33.fe06a4c","type":"function","z":"678b622e.d861ac","name":"in_1","func":"ran = parseInt(Math.random() * 15);\nmsg.topic = \"Input1\";\nmsg.payload = ran;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":689,"y":880,"wires":[["8f6a6f9b.2db6e"]]},{"id":"76ebfbe1.1dd824","type":"function","z":"678b622e.d861ac","name":"in_1","func":"ran = parseInt(Math.random() * 15);\nmsg.topic = \"Input1\";\nmsg.payload = ran;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":689,"y":920,"wires":[["e15c8f31.ffb0a"]]},{"id":"65852229.62aefc","type":"function","z":"678b622e.d861ac","name":"in_1","func":"ran = parseInt(Math.random() * 15);\nmsg.topic = \"Input1\";\nmsg.payload = ran;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":689,"y":960,"wires":[["3b8675be.79ba8a"]]},{"id":"608dbc43.848634","type":"function","z":"678b622e.d861ac","name":"","func":"if((m == n && x == y) || (msg.payload.Logout == \"Logout\"))\n{\n    msg.payload={\"group\":{\"hide\":[\"Account_Sign_Out\"]\n                }};\n}\nelse\n{\n    msg.payload={\"group\":{\"hide\":[\"Account_Sign_Out\", \"Home_Control\"]}};\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":520,"wires":[["f5fb0ee8.7f2c3"]]},{"id":"c0fa5f13.53845","type":"link in","z":"678b622e.d861ac","name":"","links":["f5fb0ee8.7f2c3"],"x":455,"y":560,"wires":[["2ac48651.a06dca"]]},{"id":"f5fb0ee8.7f2c3","type":"link out","z":"678b622e.d861ac","name":"Account","links":["c0fa5f13.53845"],"x":1165,"y":520,"wires":[]},{"id":"2ac48651.a06dca","type":"ui_button","z":"678b622e.d861ac","name":"","group":"ab37021c.1fdf3","order":1,"width":0,"height":0,"passthru":false,"label":"Log Out","tooltip":"","color":"","bgcolor":"","icon":"fa-sign-out","payload":"Logout","payloadType":"str","topic":"","x":561,"y":560,"wires":[["1043b401.0bbc6c","603e1eb6.7d3c3"]]},{"id":"27431185.067ece","type":"ui_gauge","z":"678b622e.d861ac","name":"","group":"b8a717ab.df4bc8","order":2,"width":0,"height":0,"gtype":"donut","title":"Temperature","label":"Celcius","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1410,"y":740,"wires":[]},{"id":"5a0a1cbe.844304","type":"ui_gauge","z":"678b622e.d861ac","name":"","group":"b8a717ab.df4bc8","order":3,"width":0,"height":0,"gtype":"donut","title":"Humidity","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1400,"y":800,"wires":[]},{"id":"e15c8f31.ffb0a","type":"ui_gauge","z":"678b622e.d861ac","name":"","group":"51a8388b.ab9778","order":3,"width":0,"height":0,"gtype":"donut","title":"Conductivity","label":"uS","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":830,"y":920,"wires":[]},{"id":"8f6a6f9b.2db6e","type":"ui_gauge","z":"678b622e.d861ac","name":"","group":"51a8388b.ab9778","order":1,"width":0,"height":0,"gtype":"donut","title":"Moisture","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":820,"y":880,"wires":[]},{"id":"3b8675be.79ba8a","type":"ui_gauge","z":"678b622e.d861ac","name":"","group":"51a8388b.ab9778","order":2,"width":0,"height":0,"gtype":"donut","title":"Temperature","label":"Celcius","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":830,"y":960,"wires":[]},{"id":"8502987f.d648a8","type":"ui_chart","z":"678b622e.d861ac","name":"","group":"45c6d15d.ac006","order":0,"width":0,"height":0,"label":"Temperature","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":831,"y":1000,"wires":[[]]},{"id":"69794a0c.d8a824","type":"ui_chart","z":"678b622e.d861ac","name":"","group":"9febd0c2.a464a","order":1,"width":0,"height":0,"label":"Moisture","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":821,"y":1080,"wires":[[]]},{"id":"e39bb2ce.f9d88","type":"ui_chart","z":"678b622e.d861ac","name":"","group":"45c6d15d.ac006","order":0,"width":0,"height":0,"label":"Humidity","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":821,"y":1040,"wires":[[]]},{"id":"566443b9.b7981c","type":"ui_chart","z":"678b622e.d861ac","name":"","group":"9febd0c2.a464a","order":3,"width":0,"height":0,"label":"Conductivity","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":831,"y":1120,"wires":[[]]},{"id":"e5ff00a0.1b577","type":"ui_chart","z":"678b622e.d861ac","name":"","group":"9febd0c2.a464a","order":2,"width":0,"height":0,"label":"Temperature","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":831,"y":1160,"wires":[[]]},{"id":"feffa19a.a1b5b","type":"ui_toast","z":"678b622e.d861ac","position":"bottom right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"Wrong Password","x":1371,"y":600,"wires":[]},{"id":"8758df7a.bd684","type":"ui_toast","z":"678b622e.d861ac","position":"bottom right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"Wrong Username","x":1371,"y":640,"wires":[]},{"id":"45fc540c.fd572c","type":"ui_toast","z":"678b622e.d861ac","position":"bottom right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"User Unregistered","x":1371,"y":680,"wires":[]},{"id":"603e1eb6.7d3c3","type":"ui_toast","z":"678b622e.d861ac","position":"bottom right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":776,"y":480,"wires":[],"l":false},{"id":"17a18308.dc05ad","type":"ui_toast","z":"678b622e.d861ac","position":"bottom right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":1296,"y":560,"wires":[],"l":false},{"id":"e8e5dbe6.34d2f8","type":"ui_ui_control","z":"678b622e.d861ac","name":"","events":"all","x":976,"y":560,"wires":[[]],"l":false},{"id":"5d4198be.b0eca8","type":"ui_template","z":"678b622e.d861ac","group":"b8a717ab.df4bc8","name":"Clock","order":4,"width":"0","height":"0","format":"<script id=\"titleScript\" type=\"text/javascript\">\n    $('#clock').remove();\n    var toolbar = $('.md-toolbar-tools');\n    var div = $('<div/>');\n    var p = $('<p/ id=\"clock\">');\n    \n    $('#titleScript').parent().hide();\n    div.append(p);\n    div[0].style.margin = '5px 5px 5px auto';\n    toolbar.append(div);\n\n    function displayTitle(lh) {\n        p.text(lh); \n    }\n    \n    function upTime() {\n        var d = new Date();\n        var options = {weekday: 'long',  day: 'numeric' ,month: '2-digit' ,year: 'numeric'};\n        p.text(d.toLocaleTimeString('en-US',options));\n    }\n\n    (function(scope) {\n        scope.$watch('msg.payload', function(data) {\n            displayTitle(data);\n        });\n        setInterval(upTime,1000);\n    })(scope);\n</script>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":591,"y":520,"wires":[[]]},{"id":"82903ed0.75261","type":"ui_switch","z":"678b622e.d861ac","name":"","label":"LED Full Spectrum","tooltip":"","group":"f1395852.3a74f8","order":3,"width":"0","height":"0","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":490,"y":1460,"wires":[["cad0bfc1.ef5b5"]]},{"id":"7abf23e0.924ecc","type":"ui_switch","z":"678b622e.d861ac","name":"","label":"Watering","tooltip":"","group":"f1395852.3a74f8","order":2,"width":"0","height":"0","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"fa-tint","oncolor":"black","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":521,"y":1220,"wires":[["ca5513c9.7cc46"]]},{"id":"c52576e4.81ec48","type":"ui_form","z":"678b622e.d861ac","name":"Login Form","label":"","group":"7e553c8e.c96a84","order":1,"width":0,"height":0,"options":[{"label":"Username","value":"Username","type":"text","required":true,"rows":null},{"label":"Password","value":"Password","type":"password","required":true,"rows":null}],"formValue":{"Username":"","Password":""},"payload":"","submit":"Login","cancel":"","topic":"msg.login","x":570,"y":600,"wires":[["982e4061.92493","1043b401.0bbc6c","4a47a720.30ba38"]]},{"id":"85f41897.9214b8","type":"file","z":"678b622e.d861ac","name":"Database Login","filename":"/home/pi/Documents/Track_Login.xlsx","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"utf8","x":1351,"y":460,"wires":[[]]},{"id":"ef5b3565.12c148","type":"csv","z":"678b622e.d861ac","name":"","sep":",","hdrin":true,"hdrout":"once","multi":"one","ret":"\\n","temp":"Date,Time,Username","skip":"0","strings":false,"include_empty_strings":"","include_null_values":"","x":1161,"y":460,"wires":[["85f41897.9214b8"]]},{"id":"4a47a720.30ba38","type":"function","z":"678b622e.d861ac","name":"","func":"var username = msg.payload.Username\nvar d= new Date();\nvar tgl = d.toLocaleDateString();\nvar time = d.toLocaleTimeString();\nvar m = {'Date': tgl,'Time': time,'Username': username};\nreturn {payload:m};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1021,"y":460,"wires":[["ef5b3565.12c148"]]},{"id":"84d87bc8.f60f68","type":"mqtt in","z":"678b622e.d861ac","name":"","topic":"Room/Home","qos":"2","datatype":"auto","broker":"80e2b3a3.7a5c7","x":1210,"y":740,"wires":[["27431185.067ece"]]},{"id":"29bab9f9.d38276","type":"mqtt out","z":"678b622e.d861ac","name":"","topic":"Room/Home","qos":"","retain":"","broker":"80e2b3a3.7a5c7","x":990,"y":680,"wires":[]},{"id":"44f169ac.346128","type":"exec","z":"678b622e.d861ac","command":"sudo python bme280.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":750,"y":700,"wires":[["29bab9f9.d38276"],[],[]]},{"id":"2d83ac0a.aeecd4","type":"mqtt out","z":"678b622e.d861ac","name":"","topic":"Room/Humid","qos":"","retain":"","broker":"80e2b3a3.7a5c7","x":1010,"y":760,"wires":[]},{"id":"305252e9.c7dc4e","type":"exec","z":"678b622e.d861ac","command":"sudo python bme280_humid.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":770,"y":760,"wires":[["2d83ac0a.aeecd4"],[],[]]},{"id":"580d7b5b.4ba694","type":"mqtt in","z":"678b622e.d861ac","name":"","topic":"Room/Humid","qos":"2","datatype":"auto","broker":"80e2b3a3.7a5c7","x":1210,"y":800,"wires":[["5a0a1cbe.844304"]]},{"id":"81c5c984.d67158","type":"ui_media","z":"678b622e.d861ac","group":"b8a717ab.df4bc8","name":"","width":0,"height":0,"order":5,"category":"Timelapse","file":"download.png","layout":"adjust","showcontrols":true,"loop":true,"onstart":false,"scope":"local","tooltip":"","x":590,"y":440,"wires":[[]]},{"id":"156432ee.35ed3d","type":"camerapi-takephoto","z":"678b622e.d861ac","filemode":"1","filename":"photo1.JPEG","filedefpath":"0","filepath":"/home/pi/Pictures/","fileformat":"jpeg","resolution":"1","rotation":"0","fliph":"0","flipv":"0","brightness":"50","contrast":"0","sharpness":"0","quality":"80","imageeffect":"none","exposuremode":"auto","iso":"0","agcwait":"1.0","led":"0","awb":"auto","name":"","x":620,"y":400,"wires":[["24e24ff6.6680d"]]},{"id":"9a43727f.34051","type":"ui_template","z":"678b622e.d861ac","group":"f1395852.3a74f8","name":"","order":6,"width":0,"height":0,"format":"<script>\nvar value = \"1\";\n// or overwrite value in your callback function ...\nthis.scope.action = function() { return value; }\n\nfunction updateF() {\n  var source = '/home/pi/Pictures/photo1.JPEG',\n  timestamp = (new Date()).getTime(),\n  newUrl = source + '?_=' + timestamp;\n  document.getElementById(\"photo\").src = newUrl;\n}\n</script>\n\n<md-button ng-click=\"send({payload:action()})\" onclick=\"setTimeout(updateF, 2500);\" style=\"padding:40px; margin-bottom: 40px;\" >\n <ui-icon icon=\"camera\"></ui-icon>\n Take a photo<br>\n</md-button>\n\n<div style=\"margin-bottom:40px;\">\n <img src=\"/home/pi/Pictures/photo1.JPEG\" id=\"photo\" width=\"100%\" height=\"100%\">\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":430,"y":400,"wires":[["156432ee.35ed3d"]]},{"id":"24e24ff6.6680d","type":"debug","z":"678b622e.d861ac","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":810,"y":400,"wires":[]},{"id":"ca5513c9.7cc46","type":"exec","z":"678b622e.d861ac","command":"sudo python watering.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":770,"y":1220,"wires":[[],[],[]]},{"id":"cad0bfc1.ef5b5","type":"exec","z":"678b622e.d861ac","command":"sudo python fullspectrum.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":780,"y":1460,"wires":[[],[],[]]},{"id":"262a525e.03b71e","type":"ui_switch","z":"678b622e.d861ac","name":"","label":"Nutrition","tooltip":"","group":"f1395852.3a74f8","order":4,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":520,"y":1300,"wires":[["f869cd84.e524f"]]},{"id":"d23b0f10.1aef2","type":"ui_switch","z":"678b622e.d861ac","name":"","label":"Mist Sprinkler","tooltip":"","group":"f1395852.3a74f8","order":5,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":500,"y":1380,"wires":[["492d5bfe.ba10f4"]]},{"id":"f869cd84.e524f","type":"exec","z":"678b622e.d861ac","command":"sudo python nutrition.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":770,"y":1300,"wires":[[],[],[]]},{"id":"492d5bfe.ba10f4","type":"exec","z":"678b622e.d861ac","command":"sudo python sprinkler.py","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":770,"y":1380,"wires":[[],[],[]]},{"id":"2f9ef4f7.2c775c","type":"inject","z":"678b622e.d861ac","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":430,"y":320,"wires":[["4925554e.268b2c"]]},{"id":"27cda1ff.29d8ae","type":"template","z":"678b622e.d861ac","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<img width=\"320px\" height=\"240px\" src=\"/home/pi/timelapse/,{{{payload}}}\">","output":"str","x":960,"y":320,"wires":[["ad8324fa.bc8b48"]]},{"id":"ad8324fa.bc8b48","type":"ui_template","z":"678b622e.d861ac","group":"f1395852.3a74f8","name":"","order":0,"width":"6","height":"5","format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":1110,"y":320,"wires":[[]]},{"id":"ce40f288.4e241","type":"base64","z":"678b622e.d861ac","name":"","action":"str","property":"payload","x":810,"y":320,"wires":[["27cda1ff.29d8ae"]]},{"id":"4925554e.268b2c","type":"exec","z":"678b622e.d861ac","command":"sudo python timelapse.py","addpay":false,"append":"-w 320 -h 240 -o -","useSpawn":"false","timer":"","oldrc":false,"name":"","x":610,"y":320,"wires":[["ce40f288.4e241"],[],[]]},{"id":"56677cb7.9840b4","type":"inject","z":"678b622e.d861ac","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"","payloadType":"str","x":430,"y":260,"wires":[["f7696701.4cf1e8"]]},{"id":"f7696701.4cf1e8","type":"exec","z":"678b622e.d861ac","command":"raspistill","addpay":false,"append":"-w 320 -h 240 -o -","useSpawn":"false","timer":"","oldrc":false,"name":"","x":560,"y":260,"wires":[["e7f06c8d.c0a3b"],[],[]]},{"id":"e7f06c8d.c0a3b","type":"base64","z":"678b622e.d861ac","name":"","action":"str","property":"payload","x":720,"y":260,"wires":[["9e6ed9dc.f64ba8"]]},{"id":"9e6ed9dc.f64ba8","type":"template","z":"678b622e.d861ac","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<img width=\"320px\" height=\"240px\" src=\"data:image/jpg;base64,{{{payload}}}\">","output":"str","x":880,"y":260,"wires":[["28439a97.39e7a6"]]},{"id":"28439a97.39e7a6","type":"ui_template","z":"678b622e.d861ac","group":"c7a43587.2944e8","name":"","order":0,"width":"6","height":"5","format":"<div ng-bind-html=\"msg.payload\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":1020,"y":260,"wires":[[]]},{"id":"ab37021c.1fdf3","type":"ui_group","name":"Sign Out","tab":"1ff198ee.9dba57","order":3,"disp":false,"width":"6","collapse":false},{"id":"b8a717ab.df4bc8","type":"ui_group","name":"Room","tab":"2c212c27.10ea24","order":2,"disp":true,"width":"6","collapse":true},{"id":"51a8388b.ab9778","type":"ui_group","name":"Soil","tab":"2c212c27.10ea24","order":3,"disp":true,"width":"6","collapse":true},{"id":"45c6d15d.ac006","type":"ui_group","name":"Room","tab":"13f321fc.cc594e","order":1,"disp":true,"width":"6","collapse":true},{"id":"9febd0c2.a464a","type":"ui_group","name":"Soil","tab":"13f321fc.cc594e","order":2,"disp":true,"width":"6","collapse":true},{"id":"f1395852.3a74f8","type":"ui_group","name":"Control","tab":"2c212c27.10ea24","order":4,"disp":true,"width":"6","collapse":true},{"id":"7e553c8e.c96a84","type":"ui_group","name":"Sign_In","tab":"1ff198ee.9dba57","order":1,"disp":false,"width":"8","collapse":false},{"id":"80e2b3a3.7a5c7","type":"mqtt-broker","name":"","broker":"192.168.43.79","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"c7a43587.2944e8","type":"ui_group","name":"Default","tab":"fbd536a.22bf9c8","order":1,"disp":true,"width":"6","collapse":false},{"id":"1ff198ee.9dba57","type":"ui_tab","name":"Account","icon":"fa-user-circle","order":3,"disabled":false,"hidden":false},{"id":"2c212c27.10ea24","type":"ui_tab","name":"Home","icon":"fa-home","order":1,"disabled":false,"hidden":false},{"id":"13f321fc.cc594e","type":"ui_tab","name":"History","icon":"fa-history","order":2,"disabled":false,"hidden":false},{"id":"fbd536a.22bf9c8","type":"ui_tab","name":"Home","icon":"dashboard"}]

Can anyone help me figure this out? Thanks
Regards
Rey

If you open NR to the internet without dealing with the security issues, you are opening yourelf up to being hacked, Do a forum search about connecting to the internet and securing your site because this topic has talked about many times.

1 Like

Opening up anything to the Internet carries risk. Not just to you but also to other people (e.g. if your nice computing device gets "borrowed" by an attacker who then spams or attacks other people - part of a "botnet").

Don't do it unless you have to and only if you understand the risks and how to mitigate them.

If you do need to, first try to find ways to limit the exposure. For example, many of us use Telegram as an interface rather than exposing Node-RED itself. Going beyond telegram, some of us use services such as NGROK to provide a limited and protected link across the Internet rather than to it.

If you then do decide to make Node-RED available to the Internet, make sure that you have secured your connection before you do. Internet exposed endpoints will start to be attacked by bots within seconds.

Hi @TotallyInformation, @zenofmud, @Reyner
I'd like know your point of view about this tutorial.
Andreass uses doku DNS, VPN, and other resources to expose raspberry pi pot to the internet.

You guys think its secure?

Ok thankyou for your advice @zenofmud

@TotallyInformation thankyou for your suggestion for using the telegram. I have read your post about it. But I was thinking of using the bluemix (IBM Cloud that hosted node red). I have made the cloud foundry and copy the exact same node as the one that I made locally. But in the local flow I use the exec node which is not available in node-red bluemix. So, I was thinking of using MQTT to send the result of the python script to MQTT server which then be send over to the node red in bluemix. But the problem is that the MQTT node in bluemix won't connect to my MQTT node which I have made in the local node red... Any suggestion for this problem?

Reverse the MQTT flow. Make MQTT on the cloud be your broker and publish to it from your node-red. I believe you will need password protecton on the cloud broker and use it on your connection from node-red.

1 Like

the Video shows a VPN-Server as i know - so if only the vpn is the part to the net it should be save.
so your Computer will need a vpn client to connect to the device, then it will be like a LAN Connection.
But node Red is then also not "exposed" to the Internet

Can you explain more about reversing the MQTT flow. Sorry for the lack of knowledge here, I am a beginner in NR and MQTT

Change the MQTT_IN nodes to MQTT_OUT nodes and vice-versa.

Publish from you local network node-red to the cloud broker and subscribe on the cloud to the cloud broker to get the data to be displayed on the cloud dashboard.

Exposing a service on your local sub net to the Internet is basically a part-time job or more, keeping up with patches etc. The cloud providers live with it every day and probably share black-lists of compromised IP addresses from where attacks originate and have processes running to monitor service requests looking for suspicious "probing" activity. If you really need to do it, its worth paying for cloud provider's expertise.

Well, as usual, he does a good job at explaining it all. However, there is a lot of tech there and I'm not convinced that all of it helps everyone.

Docker

We see people regularly struggling with Docker. A basic Node-RED Pi configuration doesn't generally need a lot of stuff installed and as it likely (with the exception of some of the larger Pi4's) has limited resources, Docker may be an overhead you just don't need. Since Rasbian is based on Debian which is so well supported and has APT as a software manager, it is pretty easy to install all of the things you might want: Node.js, Node-RED, Mosquitto, InfluxDB, Telegraf and Grafana being the main ones. You will likely get Python along the way anyway.

VPN

This is another thing you may wish to think about before committing. VPN's can give great security allowing you to access your local network from a device elsewhere across the Internet. That's great but they can be hard to get - and keep - correctly configured. Get it wrong and you think you are secure but you aren't. They are also only as good as your best defended device. Use an Android mobile with it, you may be 1 install away from compromising your home network from anywhere in the world.

There are tools that provide VPN-like capabilities without the complexity of a full-scale VPN. Services such as NGROK and similar are much better suited to people without the skills to properly maintain and secure a VPN. Just note my write up on creating a secure NGROK connection because the default settings are certainly not secure.

With either style, you may wish to think about whether you really want all that exposure turned on all the time. This is where Node-RED with a Telegram bot can be incredibly useful. Telegram with a Node-RED bot provides a very small attack surface. Configure a command in your bot that turns on/off your VPN (or NGROK connection). Now you can still turn it on remotely to give access when you need it but you can leave it off when you don't.

Also don't forget that your router may have a VPN capability. It has the same issues as any other VPN but might be slightly easier to configure and at least doesn't need you to mess with the Pi.

DNS

This is another complex service that requires careful configuration and I wouldn't bother with it unless it is either really good at providing configuration wizards or unless you really know what you are doing.

For me, the main reasons to run your own DNS are:

  • You want to use "hairpin" DNS - that lets you use a public domain name on your private LAN without the traffic having to go out to the Internet and back. Really useful with Let's Encrypt which requires a domain name. I access all my internal services this way now so I get full TLS wire encryption using Let's Encrypt even internally. Again though, my router has this capability so I don't need a Pi to do it.
  • You want to provide a filtering DNS service to your houshold. E.g. using DNS to block the lookup of porn, gambling, etc.

Pihole is good for that 2nd point but depending on the traffic on your network, it might need its own dedicated Pi.

Dropbox

Yes, OK, this can be useful if you need to share files with other devices or you need to use it as a poor-man's "backup" - it isn't really a backup as it is too easy to delete or corrupt files, but still.

I used to use Dropbox to share TiddlyWiki files which, for a while, I used to use for project management and note keeping. These days I use OneNote for notes and other tools for project management and I never use my Dropbox. I have a NAS which I use for sharing files across the LAN, it has onward sync with a number of cloud sources including DropBox, OneDrive, SharePoint, etc. I can access it over the Internet if I need to as well. I also use it for local backup, its files are also backed up to the cloud.


So I'd say that, for most people, the approach is overkill. But if you need/want the services, I tend to trust his advice and guidance.

2 Likes

No, but see my comments on VPN's. I've been working with them for years. They are not a sinecure. They need careful configuration/management and are only as secure as the weakest client device. They are also more complex than many people need/want.

It work! Thankyou for your suggestion :slight_smile:

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.