-
Notifications
You must be signed in to change notification settings - Fork 610
Description
As a potential user, I'm finding the focus of the documentation and tooling a bit different than what I'd hope for. I think my aims are still in line with the direction of the project though.
My hope is to have a tool—let's call it toast
for arguments sake—that builds a bootable disk image when run in a node repository (i.e. a directory containing a package.json file). I don't particularly care if it's built from source—in fact, I'd probably rather that toast
would download a pre-built image. The downloaded image should be combined with the contents of the repository such that the resultant image can be booted by qemu, and the js file pointed to by "main" in the package.json file should then be started automatically.
I specifically do not care about users, or any other direct form of interaction or administration. My goal in terms of administration is that when I want to change things, I modify the source code in my package, re-run toast
generating a new image, and upload it—entirely replacing the old image. In view of this, I would recommend a read-only filesystem.
Beyond this, some facility or API for mounting additional disks would be nice, but if that proves insurmountable then I would rather store my state elsewhere on the network rather than store my state alongside my application. Perhaps arguments passed on the command line to toast
could be stored in the image as well, and be referenced by the running script, allowing an application to be more easily instanced.
Example
main.js
var http = require('http');
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hello World\n");
});
server.listen(process.argv[2]);
package.json
{
"main": "index.js"
}
Command Line
$ toast -o hello.img --ip=192.168.0.10/24 --args="80"
$ qemu -net ... hello.img
... I hope I'm not talking like a crazy person here.