Control remote fleet workers over SSH with user, host, and key path
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
NS1 is marchon@70.88.205.138 using ~/.ssh/id_ed25519. Private key bytes stay off git. Spawn, health, and kill go through ssh; remote workers bind loopback only.
This commit is contained in:
parent
b325f6f697
commit
e89e006542
12 changed files with 425 additions and 34 deletions
|
|
@ -47,9 +47,13 @@ export function startControlServer(sup, mon) {
|
|||
const m = sup.addMachine(spec);
|
||||
return json(res, 200, { machine: m, machines: sup.status().machines });
|
||||
}
|
||||
const mach = url.pathname.match(/^\/api\/machines\/([^/]+)\/(enable|disable)$/);
|
||||
const mach = url.pathname.match(/^\/api\/machines\/([^/]+)\/(enable|disable|check)$/);
|
||||
if (mach && req.method === 'POST') {
|
||||
const [, id, op] = mach;
|
||||
if (op === 'check') {
|
||||
const check = await sup.checkMachine(id);
|
||||
return json(res, check.ok ? 200 : 400, { check, machines: sup.status().machines });
|
||||
}
|
||||
const m = sup.setMachineEnabled(id, op === 'enable');
|
||||
return json(res, 200, { machine: m, machines: sup.status().machines });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue