improve cold boot

This commit is contained in:
Nystik
2026-05-09 14:47:19 +02:00
parent e89f8d76fb
commit 6dfe2b5c81
6 changed files with 462 additions and 70 deletions

View File

@@ -8,6 +8,7 @@ const {
setIgnisMeta,
installBridgePlugin,
} = require("../bridge-plugin");
const bootstrapRoutes = require("./bootstrap");
const router = express.Router();
@@ -68,6 +69,7 @@ router.post("/create", async (req, res) => {
await installBridgePlugin(vaultPath);
config.refreshVaults();
bootstrapRoutes.invalidateVault(name);
res.json({ ok: true, id: name, path: vaultPath });
} catch (e) {
@@ -100,6 +102,8 @@ router.post("/rename", async (req, res) => {
await fs.promises.rename(vaultPath, newPath);
config.refreshVaults();
bootstrapRoutes.invalidateVault(vaultId);
bootstrapRoutes.invalidateVault(newName);
res.json({ ok: true, id: newName, path: newPath });
} catch (e) {
@@ -126,6 +130,7 @@ router.delete("/remove", async (req, res) => {
await fs.promises.rm(vaultPath, { recursive: true });
config.refreshVaults();
bootstrapRoutes.invalidateVault(vaultId);
res.json({ ok: true });
} catch (e) {