Skip to content

Instantly share code, notes, and snippets.

@mlopezr
Created August 9, 2016 14:26
Show Gist options
  • Save mlopezr/b98f6853a12afee237117bfe682ad0ff to your computer and use it in GitHub Desktop.
Save mlopezr/b98f6853a12afee237117bfe682ad0ff to your computer and use it in GitHub Desktop.
Node-RED packaged for Sandstorm.io

Node-RED packaged for Sandstorm.io

Limitations

Sandstorm security model restricts outgoing and incoming connections. A hack exists to proxy connections, but the 'powerbox' feature will soon enable applications to selectively request the user authorization to perform such connections.

In the described setup this is not implemented. Therefore, only Node-RED interactions without a network are possible.

Prerequisites

Prepare the environment by following the instructions: https://docs.sandstorm.io/en/latest/vagrant-spk/packaging-tutorial/

Packaging instructions

git clone https://github.com/node-red/node-red.git
cd node-red
vagrant-spk setupvm node
vagrant-spk vm up
vagrant-spk init

Replace the last line in .sandstorm/launcher.sh with:

node red.js --port 8080 -u /var

Modify .sandstorm/sandstorm-pkgdef.capnp:

argv = ["/sandstorm-http-bridge", "8080", "--", "/opt/app/.sandstorm/launcher.sh"]

Change app description, etc in .sandstorm/sandstorm-pkgdef.capnp

Test using:

vagrant-spk dev

And then browse: http://local.sandstorm.io:6080/

Package it:

vagrant-spk pack nodered.spk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment