From ef51d665c8461791642af836ca5a5c6f9c93eec8 Mon Sep 17 00:00:00 2001 From: bcrooker Date: Fri, 27 Feb 2026 14:46:47 -0500 Subject: [PATCH] feat(backups): add custom restic params to backup schedules Allows users to pass arbitrary restic flags via a new advanced section in the create/edit schedule form. Includes DB migration, schema update, DTO, service, and restic command changes. --- app/client/api-client/types.gen.ts | 7 + .../create-schedule-form/advanced-section.tsx | 35 + .../components/create-schedule-form/index.tsx | 22 + .../components/create-schedule-form/types.ts | 4 +- .../components/create-schedule-form/utils.ts | 1 + .../modules/backups/routes/backup-details.tsx | 1 + .../modules/backups/routes/create-backup.tsx | 1 + .../migration.sql | 1 + .../snapshot.json | 2045 +++++++++++++++++ app/server/db/schema.ts | 1 + app/server/modules/backups/backup.helpers.ts | 1 + app/server/modules/backups/backups.dto.ts | 3 + app/server/modules/backups/backups.service.ts | 1 + app/server/utils/restic/commands/backup.ts | 8 + vite.config.ts | 4 + 15 files changed, 2134 insertions(+), 1 deletion(-) create mode 100644 app/client/modules/backups/components/create-schedule-form/advanced-section.tsx create mode 100644 app/drizzle/20260227000000_add-custom-restic-params/migration.sql create mode 100644 app/drizzle/20260227000000_add-custom-restic-params/snapshot.json diff --git a/app/client/api-client/types.gen.ts b/app/client/api-client/types.gen.ts index 1ead72fd..2d951cf6 100644 --- a/app/client/api-client/types.gen.ts +++ b/app/client/api-client/types.gen.ts @@ -2202,6 +2202,7 @@ export type ListBackupSchedulesResponses = { name: string; nextBackupAt: number | null; oneFileSystem: boolean; + customResticParams: Array | null; repository: { compressionMode: "auto" | "max" | "off" | null; config: @@ -2485,6 +2486,7 @@ export type CreateBackupScheduleData = { excludePatterns?: Array; includePatterns?: Array; oneFileSystem?: boolean; + customResticParams?: Array; retentionPolicy?: { keepDaily?: number; keepHourly?: number; @@ -2519,6 +2521,7 @@ export type CreateBackupScheduleResponses = { name: string; nextBackupAt: number | null; oneFileSystem: boolean; + customResticParams: Array | null; repositoryId: string; retentionPolicy: { keepDaily?: number; @@ -2584,6 +2587,7 @@ export type GetBackupScheduleResponses = { name: string; nextBackupAt: number | null; oneFileSystem: boolean; + customResticParams: Array | null; repository: { compressionMode: "auto" | "max" | "off" | null; config: @@ -2866,6 +2870,7 @@ export type UpdateBackupScheduleData = { includePatterns?: Array; name?: string; oneFileSystem?: boolean; + customResticParams?: Array; retentionPolicy?: { keepDaily?: number; keepHourly?: number; @@ -2902,6 +2907,7 @@ export type UpdateBackupScheduleResponses = { name: string; nextBackupAt: number | null; oneFileSystem: boolean; + customResticParams: Array | null; repositoryId: string; retentionPolicy: { keepDaily?: number; @@ -2947,6 +2953,7 @@ export type GetBackupScheduleForVolumeResponses = { name: string; nextBackupAt: number | null; oneFileSystem: boolean; + customResticParams: Array | null; repository: { compressionMode: "auto" | "max" | "off" | null; config: diff --git a/app/client/modules/backups/components/create-schedule-form/advanced-section.tsx b/app/client/modules/backups/components/create-schedule-form/advanced-section.tsx new file mode 100644 index 00000000..8859e071 --- /dev/null +++ b/app/client/modules/backups/components/create-schedule-form/advanced-section.tsx @@ -0,0 +1,35 @@ +import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "~/client/components/ui/form"; +import { Textarea } from "~/client/components/ui/textarea"; +import type { UseFormReturn } from "react-hook-form"; +import type { InternalFormValues } from "./types"; + +type AdvancedSectionProps = { + form: UseFormReturn; +}; + +export const AdvancedSection = ({ form }: AdvancedSectionProps) => { + return ( + ( + + Custom restic parameters + +