Skip to content

Commit 21cf4b5

Browse files
feat(backups): add SFTP and FTP backup destination types
Add support for SFTP and FTP as backup destination types alongside existing S3 compatible storage. Uses rclone's native backends. Changes: - Add destinationType column to destination schema with migration - Add getRcloneFlags() and getRcloneRemote() to centralize rclone command generation for all destination types - Passwords are obscured via rclone obscure before storage - Shell-escape user inputs to prevent command injection - Update all backup, restore, and volume-backup modules - Add destination type selector in UI with conditional form fields - Add conditional validation (S3 fields required for S3, host/username required for SFTP/FTP) - Show destination type badge in destination list Fixes #168
1 parent ddfcd1a commit 21cf4b5

File tree

27 files changed

+8927
-260
lines changed

27 files changed

+8927
-260
lines changed

apps/dokploy/components/dashboard/settings/destination/handle-destinations.tsx

Lines changed: 376 additions & 159 deletions
Large diffs are not rendered by default.

apps/dokploy/components/dashboard/settings/destination/show-destinations.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ export const ShowDestinations = () => {
2424
<CardHeader className="">
2525
<CardTitle className="text-xl flex flex-row gap-2">
2626
<Database className="size-6 text-muted-foreground self-center" />
27-
S3 Destinations
27+
Backup Destinations
2828
</CardTitle>
2929
<CardDescription>
30-
Add your providers like AWS S3, Cloudflare R2, Wasabi,
31-
DigitalOcean Spaces etc.
30+
Add your backup destinations: S3 compatible storage (AWS,
31+
Cloudflare R2, Wasabi, etc.), SFTP, or FTP servers.
3232
</CardDescription>
3333
</CardHeader>
3434
<CardContent className="space-y-2 py-8 border-t">
@@ -60,6 +60,11 @@ export const ShowDestinations = () => {
6060
<div className="flex flex-col gap-1">
6161
<span className="text-sm">
6262
{index + 1}. {destination.name}
63+
<span className="text-xs bg-muted px-1.5 py-0.5 rounded ml-2 font-medium">
64+
{(
65+
destination.destinationType || "s3"
66+
).toUpperCase()}
67+
</span>
6368
</span>
6469
<span className="text-xs text-muted-foreground">
6570
Created at:{" "}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
ALTER TABLE "destination" ADD COLUMN "destinationType" text DEFAULT 's3' NOT NULL;--> statement-breakpoint
2+
ALTER TABLE "destination" ADD COLUMN "host" text;--> statement-breakpoint
3+
ALTER TABLE "destination" ADD COLUMN "port" integer;--> statement-breakpoint
4+
ALTER TABLE "destination" ADD COLUMN "username" text;--> statement-breakpoint
5+
ALTER TABLE "destination" ADD COLUMN "password" text;--> statement-breakpoint
6+
ALTER TABLE "destination" ADD COLUMN "basePath" text;

0 commit comments

Comments
 (0)