@@ -79,6 +79,7 @@ const Schema = z
7979 schedule : z . string ( ) . min ( 1 , "Schedule (Cron) required" ) ,
8080 prefix : z . string ( ) . min ( 1 , "Prefix required" ) ,
8181 enabled : z . boolean ( ) ,
82+ includeEncryptionKey : z . boolean ( ) ,
8283 database : z . string ( ) . min ( 1 , "Database required" ) ,
8384 keepLatestCount : z . coerce . number ( ) . optional ( ) ,
8485 serviceName : z . string ( ) . nullable ( ) ,
@@ -223,6 +224,7 @@ export const HandleBackup = ({
223224 : "" ,
224225 destinationId : "" ,
225226 enabled : true ,
227+ includeEncryptionKey : true ,
226228 prefix : "/" ,
227229 schedule : "" ,
228230 keepLatestCount : undefined ,
@@ -262,6 +264,7 @@ export const HandleBackup = ({
262264 : "" ,
263265 destinationId : backup ?. destinationId ?? "" ,
264266 enabled : backup ?. enabled ?? true ,
267+ includeEncryptionKey : backup ?. includeEncryptionKey ?? true ,
265268 prefix : backup ?. prefix ?? "/" ,
266269 schedule : backup ?. schedule ?? "" ,
267270 keepLatestCount : backup ?. keepLatestCount ?? undefined ,
@@ -309,6 +312,7 @@ export const HandleBackup = ({
309312 prefix : data . prefix ,
310313 schedule : data . schedule ,
311314 enabled : data . enabled ,
315+ includeEncryptionKey : data . includeEncryptionKey ,
312316 database : data . database ,
313317 keepLatestCount : data . keepLatestCount ?? null ,
314318 databaseType : data . databaseType || databaseType ,
@@ -665,6 +669,31 @@ export const HandleBackup = ({
665669 </ FormItem >
666670 ) }
667671 />
672+ { databaseType === "web-server" && (
673+ < FormField
674+ control = { form . control }
675+ name = "includeEncryptionKey"
676+ render = { ( { field } ) => (
677+ < FormItem className = "flex flex-row items-center justify-between rounded-lg border p-3 " >
678+ < div className = "space-y-0.5" >
679+ < FormLabel > Include encryption key</ FormLabel >
680+ < FormDescription >
681+ Stores the encryption key inside the backup so
682+ environment variables can be restored on a new server.
683+ Anyone with access to the backup file can decrypt
684+ them.
685+ </ FormDescription >
686+ </ div >
687+ < FormControl >
688+ < Switch
689+ checked = { field . value }
690+ onCheckedChange = { field . onChange }
691+ />
692+ </ FormControl >
693+ </ FormItem >
694+ ) }
695+ />
696+ ) }
668697 { backupType === "compose" && (
669698 < >
670699 { form . watch ( "databaseType" ) === "postgres" && (
0 commit comments