Export CSV on every table, edit recurring maintenance, runs-on nothing, and run package checks outside the agent sandbox
- Export CSV for the small tables that had none (reads the table as shown) - Servers page shows a skeleton while loading instead of "No servers registered yet" - Recurring maintenance schedules can be edited (PUT /schedules/:id) - A server can be set to run on nothing (servers.no_parent, migration 0028) - Linux agent v3: package-manager question runs in ExecStartPre=-+ outside the sandbox, with --prepare-updates and --check-updates modes - Docs: README, DATABASE, AGENT_UPDATE Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c17e9aa140
commit
540ab704b7
32 files changed
+3003
-66
No files matched your search
@@ -61,6 +61,14 @@ describe("resolveParents", () => {
|
||||
assert.equal(parents.get(6), undefined, "not its own parent");
|
||||
});
|
||||
|
||||
test("one said to run on nothing is not guessed at, and a link set by hand clears that", () => {
|
||||
const rows = [row(1, "pve1"), { ...row(2, "web", { proxmoxNode: "pve1" }), noParent: true }, { ...row(3, "db", { proxmoxNode: "pve1", parentServerId: 1 }), noParent: true }];
|
||||
const parents = resolveParents(rows);
|
||||
assert.equal(parents.get(2), undefined, "no guess");
|
||||
assert.equal(parents.get(3), undefined, "no link either while it is set");
|
||||
assert.deepEqual(resolveParents([row(1, "pve1"), row(2, "web", { proxmoxNode: "pve1" })]).get(2), { parentId: 1, auto: true }, "unset, it is found again");
|
||||
});
|
||||
|
||||
test("a server is not its own node", () => {
|
||||
assert.equal(resolveParents([row(1, "pve1", { proxmoxNode: "pve1" })]).size, 0);
|
||||
});
|
||||
@@ -297,6 +305,34 @@ describe("the routes", () => {
|
||||
assert.equal((await (await call("GET", `/servers/${guestId}/detail`)).json()).relations.parent, null, "back to working it out");
|
||||
});
|
||||
|
||||
test("an admin can say a server runs on nothing, even when its Proxmox node would be found, and take that back", async () => {
|
||||
const detailOf = async () => (await call("GET", `/servers/${guestId}/detail`)).json();
|
||||
await db.update(servers).set({ proxmoxNode: "rack" }).where(eq(servers.id, guestId));
|
||||
assert.deepEqual((await detailOf()).relations.parent, { id: hostId, name: "rack", auto: true }, "found from the node");
|
||||
|
||||
assert.equal((await call("PATCH", `/servers/${guestId}`, { noParent: true })).status, 200);
|
||||
let d = await detailOf();
|
||||
assert.equal(d.relations.parent, null);
|
||||
assert.equal(d.server.noParent, true);
|
||||
assert.deepEqual((await (await call("GET", `/servers/${hostId}/detail`)).json()).relations.children, [], "and the host no longer lists it");
|
||||
|
||||
// choosing a server by hand ends it; so does going back to automatic
|
||||
assert.equal((await call("PATCH", `/servers/${guestId}`, { parentServerId: hostId })).status, 200);
|
||||
d = await detailOf();
|
||||
assert.equal(d.server.noParent, false);
|
||||
assert.deepEqual(d.relations.parent, { id: hostId, name: "rack", auto: false });
|
||||
await call("PATCH", `/servers/${guestId}`, { noParent: true });
|
||||
assert.equal((await call("PATCH", `/servers/${guestId}`, { parentServerId: null })).status, 200);
|
||||
d = await detailOf();
|
||||
assert.equal(d.server.noParent, false);
|
||||
assert.deepEqual(d.relations.parent, { id: hostId, name: "rack", auto: true });
|
||||
|
||||
who = "operator";
|
||||
assert.equal((await call("PATCH", `/servers/${guestId}`, { noParent: true })).status, 403);
|
||||
who = "admin";
|
||||
await db.update(servers).set({ proxmoxNode: null }).where(eq(servers.id, guestId));
|
||||
});
|
||||
|
||||
test("removing the host sets the servers on it free", async () => {
|
||||
await call("PATCH", `/servers/${guestId}`, { parentServerId: hostId });
|
||||
assert.equal((await call("DELETE", `/servers/${hostId}`)).status, 204);
|
||||
|
||||
Reference in new issue
Block a user