feat: cleanup dangling volumes and folders on startup and on schedule

This commit is contained in:
Nicolas Meienberger
2025-10-17 23:01:47 +02:00
parent 8a9d5fc3c8
commit 8fcc9ada74
13 changed files with 414 additions and 17 deletions

View File

@@ -1,6 +1,5 @@
import fs from "node:fs/promises";
import path from "node:path";
import { $ } from "bun";
type MountInfo = {
mountPoint: string;
@@ -22,7 +21,7 @@ function unescapeMount(s: string): string {
return s.replace(/\\([0-7]{3})/g, (_, oct) => String.fromCharCode(parseInt(oct, 8)));
}
async function readMountInfo(): Promise<MountInfo[]> {
export async function readMountInfo(): Promise<MountInfo[]> {
const text = await fs.readFile("/proc/self/mountinfo", "utf-8");
const result: MountInfo[] = [];