This repository has been archived by the owner on Apr 6, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 43df3d6
Showing
10 changed files
with
178 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
var path = require("path"); | ||
var port = process.env.PORT || 5656; | ||
|
||
module.exports = { | ||
name: "VFS", | ||
tmpdir: __dirname + "/../.architect", | ||
basePath: __dirname + "/..", | ||
containers: { | ||
master: { | ||
title: "VFS", | ||
plugins: [{ | ||
packagePath: "connect-architect/connect", | ||
port: port | ||
}, { | ||
packagePath: "./local", | ||
uid: process.getuid(), | ||
gid: process.getgid(), | ||
umask: 0750, | ||
root: path.normalize(__dirname + "/../"), | ||
skipSearchCheck: false, | ||
httpRoot: "http://localhost:" + port + "/" | ||
}, { | ||
packagePath: "./http-adapter", | ||
mount: "/vfs" | ||
}, { | ||
packagePath: "architect/plugins/architect.log" | ||
}] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var port = process.env.PORT || 5656; | ||
|
||
module.exports = { | ||
name: "VFS SSH", | ||
tmpdir: __dirname + "/../.architect", | ||
basePath: __dirname + "/..", | ||
containers: { | ||
master: { | ||
title: "VFS SSH", | ||
plugins: [{ | ||
packagePath: "connect-architect/connect", | ||
port: port | ||
}, { | ||
packagePath: "./ssh", | ||
host: "localhost", | ||
root: process.env.HOME + "/", | ||
nodePath: process.execPath, | ||
httpRoot: "http://localhost:" + port + "/" | ||
}, { | ||
packagePath: "./http-adapter", | ||
mount: "/" | ||
}, { | ||
packagePath: "architect/plugins/architect.log" | ||
}] | ||
} | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var assert = require("assert"); | ||
|
||
module.exports = function setup(options, imports, register) { | ||
|
||
assert(options.mount, "option 'mount' is required"); | ||
|
||
imports.connect.useMain(require("vfs/http-adapter/restful")(options.mount, imports.vfs)); | ||
|
||
register(null, { | ||
"vfs-rest": {} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "vfs.http-adapter", | ||
"version": "0.0.1", | ||
"main": "http-adapter-ext.js", | ||
"private": true, | ||
|
||
"plugin": { | ||
"provides": ["vfs-rest"], | ||
"consumes" : [ | ||
"vfs", | ||
"connect" | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var assert = require("assert"); | ||
|
||
module.exports = function setup(options, imports, register) { | ||
|
||
assert.equal(typeof options.uid, "number", "option 'uid' is required"); | ||
assert.equal(typeof options.gid, "number", "option 'gid' is required"); | ||
assert(options.root, "option 'root' is required"); | ||
|
||
register(null, { | ||
"vfs": require("vfs/local")(options) | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "vfs.local", | ||
"version": "0.0.1", | ||
"main": "local-ext.js", | ||
"private": true, | ||
|
||
"plugin": { | ||
"provides": ["vfs"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "vfs-architect", | ||
"description": "architect plugins for vfs", | ||
"version": "0.0.1", | ||
|
||
"author": "ajax.org B.V. <info@ajax.org>", | ||
"contributors": [ | ||
{ "name": "Fabian Jakobs", "email": "fabian@c9.io" } | ||
], | ||
|
||
"dependencies": { | ||
"architect": "~0.0.3", | ||
"vfs": "~0.0.1" | ||
}, | ||
|
||
"repository" : { | ||
"type" : "git", | ||
"url" : "http://github.com/c9/vfs-architect.git" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env node | ||
|
||
var path = require('path'); | ||
var architect = require("architect"); | ||
|
||
var configName = process.argv[2] || "default"; | ||
|
||
var configPath = path.resolve(__dirname, "./configs/", configName); | ||
var config = require(configPath); | ||
|
||
architect.createApp(config, function (err, app) { | ||
if (err) { | ||
console.error("While starting the '%s':", configPath); | ||
throw err; | ||
} | ||
console.log("Started '%s'!", configPath); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "vfs.ssh", | ||
"version": "0.0.1", | ||
"main": "ssh-ext.js", | ||
"private": true, | ||
|
||
"plugin": { | ||
"provides": ["vfs"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
var assert = require("assert"); | ||
|
||
module.exports = function setup(options, imports, register) { | ||
|
||
assert(options.root, "option 'root' is required"); | ||
assert(options.host, "option 'host' is required"); | ||
assert(options.nodePath, "option 'nodePath' is required"); | ||
|
||
require("vfs/ssh")({ | ||
pingInterval: options.pingInterval || 5000, //ms | ||
serverAliveInterval: options.serverAliveInterval || 10, //sec | ||
nodePath: options.nodePath, | ||
host: options.host, | ||
key: options.keyFile || null, | ||
umask: options.umask || 0750, | ||
uid: options.uid || process.getuid(), | ||
gid: options.uid || process.getgid(), | ||
skipSearchCheck: options.skipSearchCheck || false, | ||
root: options.root, | ||
httpRoot: options.httpRoot || null | ||
}, function(err, vfs) { | ||
register(err, { | ||
"vfs": vfs | ||
}); | ||
}) | ||
} |