diff --git a/uibuilder/.config/masterPackageList.json b/uibuilder/.config/masterPackageList.json new file mode 100644 index 0000000..bd56029 --- /dev/null +++ b/uibuilder/.config/masterPackageList.json @@ -0,0 +1,12 @@ +[ + "vue", + "bootstrap", + "bootstrap-vue", + "jquery", + "moonjs", + "reactjs", + "riot", + "angular", + "picnic", + "umbrellajs" +] \ No newline at end of file diff --git a/uibuilder/.config/packageList.json b/uibuilder/.config/packageList.json new file mode 100644 index 0000000..445d267 --- /dev/null +++ b/uibuilder/.config/packageList.json @@ -0,0 +1,7 @@ +[ + "vue", + "bootstrap", + "bootstrap-vue", + "jquery", + "socket.io" +] diff --git a/uibuilder/.config/sioMiddleware.js b/uibuilder/.config/sioMiddleware.js new file mode 100644 index 0000000..fa954fe --- /dev/null +++ b/uibuilder/.config/sioMiddleware.js @@ -0,0 +1,31 @@ +/* globals module, log */ +/** + * Template Socket.IO Connection Middleware for uibuilder. + * + * NOTES & WARNINGS: + * 1) This function is only called ONCE - when a new client connects. So any authentication/security processing is limited + * because you cannot use this to, for example, timeout/extend a session without further server processing of incoming messages. + * 2) Failing to either return or call `next()` will mean that your clients will never connect. + * 3) An error in this function will probably cause Node-RED to fail to start at all. + * 4) You have to restart Node-RED if you change this file. + * + * Allows custom processing for authentication, session management, connection validation, logging, rate limiting, etc. + */ + +//module.exports = function(socket, next) { + /* Some SIO related info that might be useful in security checks + * console.log('--socket.request.connection.remoteAddress--') + * console.dir(socket.request.connection.remoteAddress) + * console.log('--socket.handshake.address--') + * console.dir(socket.handshake.address) + * console.dir(io.sockets.connected) + */ + /* + if ( socket.request.headers.cookie) { + log.info('[uibuilder:Module] io.use - Authentication OK - ID: ' + socket.id) + log.info('[uibuilder:Module] Cookie', socket.request.headers.cookie) // socket.handshake.headers.cookie + return next() + } + next (new Error('UIbuilder:io.use - Authentication error - ID: ' + socket.id )) + */ +//} diff --git a/uibuilder/.config/sioUse.js b/uibuilder/.config/sioUse.js new file mode 100644 index 0000000..608e977 --- /dev/null +++ b/uibuilder/.config/sioUse.js @@ -0,0 +1,27 @@ +/* globals module, log */ +/** + * Template Socket.IO Use Middleware for uibuilder. + * + * NOTES & WARNINGS: + * 1) This function is called when a client sends a "packet" if data to the server. + * 2) Failing to either return or call `next()` will mean that your clients will never be able to get responses. + * 3) An error in this function will probably cause Node-RED to fail to start at all. + * 4) You have to restart Node-RED if you change this file. + * 5) If you call `next( new Error('blah') )` The error is sent back to the client and further proessing of the incoming msg stops. + * + * Allows you to process incoming data from clients. + * + * @see also https://cheatsheetseries.owasp.org/cheatsheets/HTML5_Security_Cheat_Sheet.html#websocket-implementation-hints + * + * @param {*} msg The msg send by a client (Socket.IO calls it a "packet") + * @param {function} next The callback to hand off to the next middleware + */ +// module.exports = function(msg, next) { +// //if (not some kind of error) { +// console.log('Socket.IO:sioUse.js - msg from client: ', msg) +// return next() +// //} else { +// // The error is sent back to the client and further processing of the msg stops +// // next(new Error('Oops! Some kind of error happened')) +// //} +// } diff --git a/uibuilder/.config/uibMiddleware.js b/uibuilder/.config/uibMiddleware.js new file mode 100644 index 0000000..fbe3f4d --- /dev/null +++ b/uibuilder/.config/uibMiddleware.js @@ -0,0 +1,18 @@ +/* globals module */ +/** + * Template ExpressJS Middleware for uibuilder. + * + * NOTES & WARNINGS: + * 1) This function is called EVERY TIME any web call is made to the URL defined by your uib instance. + * So it should be kept short and efficient. + * 2) Failing to either return or call `next()` will cause an ExpressJS error. + * 3) An error in this function will probably cause Node-RED to fail to start at all. + * 4) You have to restart Node-RED if you change this file. + * + * Allows custom processing for authentication, session management, custom logging, etc. + */ + +// module.exports = function(req,res,next) { +// console.log('[uibuilder:uibMiddleware] Custom ExpressJS middleware called.') +// next() +// } diff --git a/uibuilder/common/images/node-blue.ico b/uibuilder/common/images/node-blue.ico new file mode 100644 index 0000000..0b59203 Binary files /dev/null and b/uibuilder/common/images/node-blue.ico differ