-
Notifications
You must be signed in to change notification settings - Fork 1
/
start.js
28 lines (24 loc) · 871 Bytes
/
start.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const BashShell = require("./src/lib/BashShell.js");
const secrets = require("./secrets").getSecrets("./");
function myHandler(event) {
console.log("SUBSHELL " + event.process + " " + event.type);
const printData = event.data.split("\n").map(ln => " " + ln).join("\n");
if (event.type === "err") {
console.error(printData);
} else {
console.log(printData);
}
}
if (secrets.USE_PROXY) {
const ratholeProxy = new BashShell("RatholeProxy");
ratholeProxy.handler = myHandler;
ratholeProxy.send("./rathole client.toml");
}
const mainServer = new BashShell("MainServer");
mainServer.handler = myHandler;
mainServer.send("cd src");
mainServer.send("node index.js");
const sandoxServer = new BashShell("SandboxServer");
sandoxServer.handler = myHandler;
sandoxServer.send("cd sandbox");
sandoxServer.send("node index.js");