add better client sync schemes initialization,

add client sync scheme selects to localdb,
start on interrupt sync scheme implementation,
change sync endpoints to start with /sync/
This commit is contained in:
2023-07-11 22:06:41 +00:00
parent aa8148fc16
commit 178ff6168f
5 changed files with 83 additions and 32 deletions

View File

@@ -1,4 +1,4 @@
import {createHash} from "crypto";
import { createHash } from "crypto";
import { getUsedResources, requestPVE } from "./pve.js";
import { db } from "./db.js";
@@ -94,9 +94,8 @@ export async function approveResources (req, username, request) {
return approved; // if all requested resources pass, allow
}
export function getObjectHash (object, alg = "sha256", format = "hex") {
const hash = createHash(alg);
hash.update(JSON.stringify(object, Object.keys(object).sort()));
return hash.digest(format);
}
}