feat: enable restic cache

This commit is contained in:
Nicolas Meienberger
2025-10-23 21:10:36 +02:00
parent f7718055eb
commit d58c4f793d
6 changed files with 5 additions and 14 deletions

View File

@@ -139,8 +139,6 @@ const checkHealth = async (path: string) => {
const mount = await getMountForPath(path);
console.log(mount);
if (!mount || mount.fstype !== "fuse") {
throw new Error(`Path ${path} is not mounted as WebDAV.`);
}

View File

@@ -14,6 +14,7 @@ import { getStatFs, type StatFs } from "../../utils/mountinfo";
import { createVolumeBackend } from "../backends/backend";
import type { UpdateVolumeBody } from "./volume.dto";
import { getVolumePath } from "./helpers";
import { logger } from "../../utils/logger";
const listVolumes = async () => {
const volumes = await db.query.volumesTable.findMany({});
@@ -137,7 +138,7 @@ const updateVolume = async (name: string, volumeData: UpdateVolumeBody) => {
JSON.stringify(existing.config) !== JSON.stringify(volumeData.config) && volumeData.config !== undefined;
if (configChanged) {
console.log("Unmounting existing volume before applying new config");
logger.debug("Unmounting existing volume before applying new config");
const backend = createVolumeBackend(existing);
await backend.unmount();
}

View File

@@ -79,6 +79,7 @@ const buildRepoUrl = (config: RepositoryConfig): string => {
const buildEnv = async (config: RepositoryConfig) => {
const env: Record<string, string> = {
RESTIC_CACHE_DIR: "/tmp/restic-cache",
RESTIC_PASSWORD_FILE: RESTIC_PASS_FILE,
};