From cd9f5a9bbe11c686136a9153a85a142b37eb767f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Tr=C3=A1vn=C3=ADk?= Date: Tue, 23 Dec 2025 12:23:01 +0100 Subject: [PATCH 1/4] feat(ui): improve local repository path display and messaging - Add shared client constants file with REPOSITORY_BASE - Show effective local path in repository info tab - Update host mount warning to clarify default path is safe when using recommended Docker setup - Update README to clarify local repositories can use custom paths --- README.md | 2 +- app/client/lib/constants.ts | 2 ++ .../repository-forms/local-repository-form.tsx | 9 +++++---- app/client/modules/repositories/tabs/info.tsx | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 app/client/lib/constants.ts diff --git a/README.md b/README.md index 8000055a..aef9976f 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ Now, when adding a new volume in the Zerobyte web interface, you can select "Dir A repository is where your backups will be securely stored encrypted. Zerobyte supports multiple storage backends for your backup repositories: -- **Local directories** - Store backups on local disk at `/var/lib/zerobyte/repositories/` +- **Local directories** - Store backups on local disk subfolder of `/var/lib/zerobyte/repositories/` or any other (mounted) path - **S3-compatible storage** - Amazon S3, MinIO, Wasabi, DigitalOcean Spaces, etc. - **Google Cloud Storage** - Google's cloud storage service - **Azure Blob Storage** - Microsoft Azure storage diff --git a/app/client/lib/constants.ts b/app/client/lib/constants.ts new file mode 100644 index 00000000..84464025 --- /dev/null +++ b/app/client/lib/constants.ts @@ -0,0 +1,2 @@ +/** Default base path for local repositories */ +export const REPOSITORY_BASE = "/var/lib/zerobyte/repositories"; diff --git a/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx b/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx index e0f5b4c1..5a31755c 100644 --- a/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx +++ b/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx @@ -1,6 +1,7 @@ import { useState } from "react"; import type { UseFormReturn } from "react-hook-form"; import { Check, Pencil, X, AlertTriangle } from "lucide-react"; +import { REPOSITORY_BASE } from "~/client/lib/constants"; import { Button } from "../../../../components/ui/button"; import { FormItem, FormLabel, FormDescription } from "../../../../components/ui/form"; import { DirectoryBrowser } from "../../../../components/directory-browser"; @@ -30,7 +31,7 @@ export const LocalRepositoryForm = ({ form }: Props) => { Repository Directory
- {form.watch("path") || "/var/lib/zerobyte/repositories"} + {form.watch("path") || REPOSITORY_BASE}
+ {getEffectiveLocalPath(repository) && ( +
+
Effective Local Path
+

{getEffectiveLocalPath(repository)}

+
+ )}
Created at

{new Date(repository.createdAt).toLocaleString()}

From a921fa4c80dda46d371347600c5b579e5e393430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Tr=C3=A1vn=C3=ADk?= Date: Tue, 23 Dec 2025 12:37:12 +0100 Subject: [PATCH 2/4] fix(info): optimize effective local path retrieval in RepositoryInfoTabContent --- app/client/modules/repositories/tabs/info.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/client/modules/repositories/tabs/info.tsx b/app/client/modules/repositories/tabs/info.tsx index efd52243..57c1b9aa 100644 --- a/app/client/modules/repositories/tabs/info.tsx +++ b/app/client/modules/repositories/tabs/info.tsx @@ -41,6 +41,7 @@ export const RepositoryInfoTabContent = ({ repository }: Props) => { const [showConfirmDialog, setShowConfirmDialog] = useState(false); const isImportedLocal = repository.type === "local" && repository.config.isExistingRepository; + const effectiveLocalPath = getEffectiveLocalPath(repository); const updateMutation = useMutation({ ...updateRepositoryMutation(), @@ -121,10 +122,10 @@ export const RepositoryInfoTabContent = ({ repository }: Props) => {
Status

{repository.status || "unknown"}

- {getEffectiveLocalPath(repository) && ( + {effectiveLocalPath && (
Effective Local Path
-

{getEffectiveLocalPath(repository)}

+

{effectiveLocalPath}

)}
From 2d6c9397c0d6e5e6beb669693044f2086c2fe461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Tr=C3=A1vn=C3=ADk?= Date: Sat, 3 Jan 2026 12:47:03 +0100 Subject: [PATCH 3/4] fix: handle imported repositories correctly in getEffectiveLocalPath - Imported repositories use config.path directly (matching server logic) - Removed unused isImportedLocal variable --- .../repository-forms/local-repository-form.tsx | 4 ++-- app/client/modules/repositories/tabs/info.tsx | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx b/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx index 5a31755c..ecc1122b 100644 --- a/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx +++ b/app/client/modules/repositories/components/repository-forms/local-repository-form.tsx @@ -54,8 +54,8 @@ export const LocalRepositoryForm = ({ form }: Props) => { If the path is not a host mount, you will lose your repository data when the container restarts.

- The default path {REPOSITORY_BASE} is - safe to use if you followed the recommended Docker Compose setup. + The default path {REPOSITORY_BASE} is safe to use if you + followed the recommended Docker Compose setup.

diff --git a/app/client/modules/repositories/tabs/info.tsx b/app/client/modules/repositories/tabs/info.tsx index 25308f82..fea1e191 100644 --- a/app/client/modules/repositories/tabs/info.tsx +++ b/app/client/modules/repositories/tabs/info.tsx @@ -28,7 +28,14 @@ type Props = { const getEffectiveLocalPath = (repository: Repository): string | null => { if (repository.type !== "local") return null; - const config = repository.config as { name: string; path?: string }; + const config = repository.config as { name: string; path?: string; isExistingRepository?: boolean }; + + if (config.isExistingRepository) { + // Imported repositories use the path directly + return config.path ?? null; + } + + // New repositories append the name to the base path const basePath = config.path || REPOSITORY_BASE; return `${basePath}/${config.name}`; }; @@ -40,7 +47,6 @@ export const RepositoryInfoTabContent = ({ repository }: Props) => { ); const [showConfirmDialog, setShowConfirmDialog] = useState(false); - const isImportedLocal = repository.type === "local" && repository.config.isExistingRepository; const effectiveLocalPath = getEffectiveLocalPath(repository); const updateMutation = useMutation({ From b7609a657417a993fa626113514848246c61169b Mon Sep 17 00:00:00 2001 From: Nicolas Meienberger Date: Mon, 5 Jan 2026 21:06:36 +0100 Subject: [PATCH 4/4] chore: remove needless comments --- app/client/lib/constants.ts | 1 - app/client/modules/repositories/tabs/info.tsx | 2 -- 2 files changed, 3 deletions(-) diff --git a/app/client/lib/constants.ts b/app/client/lib/constants.ts index 84464025..801c5768 100644 --- a/app/client/lib/constants.ts +++ b/app/client/lib/constants.ts @@ -1,2 +1 @@ -/** Default base path for local repositories */ export const REPOSITORY_BASE = "/var/lib/zerobyte/repositories"; diff --git a/app/client/modules/repositories/tabs/info.tsx b/app/client/modules/repositories/tabs/info.tsx index fea1e191..e22b8c6a 100644 --- a/app/client/modules/repositories/tabs/info.tsx +++ b/app/client/modules/repositories/tabs/info.tsx @@ -31,11 +31,9 @@ const getEffectiveLocalPath = (repository: Repository): string | null => { const config = repository.config as { name: string; path?: string; isExistingRepository?: boolean }; if (config.isExistingRepository) { - // Imported repositories use the path directly return config.path ?? null; } - // New repositories append the name to the base path const basePath = config.path || REPOSITORY_BASE; return `${basePath}/${config.name}`; };