Skip to content

Comments

feat(backup): add more destination types support#3756

Open
xiaxia-unlimited wants to merge 1 commit intoDokploy:canaryfrom
xiaxia-unlimited:feature/add-more-backup-destinations
Open

feat(backup): add more destination types support#3756
xiaxia-unlimited wants to merge 1 commit intoDokploy:canaryfrom
xiaxia-unlimited:feature/add-more-backup-destinations

Conversation

@xiaxia-unlimited
Copy link

@xiaxia-unlimited xiaxia-unlimited commented Feb 19, 2026

Summary

Adds support for additional backup destinations using rclone:

New Providers Added

  • File Transfer: FTP, SFTP (SSH File Transfer)
  • Cloud Storage: Google Drive, OneDrive, Dropbox
  • Other: WebDAV, Backblaze B2, MEGA, pCloud, Box, hubic, Yandex Disk

Changes

  1. Frontend (): Added NON_S3_PROVIDERS array with 12 new provider options
  2. Backend (): Updated testConnection to support both S3 and non-S3 (native rclone) protocols

Technical Details

  • Non-S3 providers use rclone native protocols instead of S3 API
  • Authentication parameters are passed via provider-specific flags
  • Maintains backward compatibility with existing S3 providers

Fixes #416

Greptile Summary

Added support for 12 new backup destination providers (FTP, SFTP, Google Drive, OneDrive, Dropbox, WebDAV, Backblaze B2, MEGA, pCloud, Box, hubic, Yandex Disk) using rclone native protocols instead of S3 API.

Critical Issues:

  • Syntax error on line 43-47 prevents compilation - const declaration inside router object
  • Incorrect rclone flag format won't work with most providers (each has unique flag names)
  • OAuth-based providers (Drive, OneDrive, Dropbox, Box) require OAuth tokens, not username/password
  • Missing validation for unsupported providers in providerConfig mapping

Impact:
The code will not compile due to syntax error and won't function correctly for non-S3 providers even after fixing syntax issues.

Confidence Score: 0/5

  • This PR contains a critical syntax error that prevents compilation and multiple logical errors that break functionality
  • Score of 0 due to: (1) syntax error on line 43-47 that will cause compilation failure, (2) incorrect rclone flag format that won't work with any of the new providers, (3) fundamental authentication misunderstanding for OAuth providers, (4) missing type safety for provider mapping. The code cannot be merged in its current state.
  • apps/dokploy/server/api/routers/destination.ts requires immediate attention to fix syntax error and rclone implementation

Last reviewed commit: b664fed

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Adds support for additional backup destinations using rclone:
- FTP, SFTP (SSH File Transfer)
- Google Drive, OneDrive, Dropbox
- WebDAV, Backblaze B2, MEGA, pCloud
- Box, hubic, Yandex Disk

Fixes Dokploy#416
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 files reviewed, 4 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +43 to +47
// Non-S3 providers that use rclone native protocols
const NON_S3_PROVIDERS = [
"ftp", "sftp", "drive", "onedrive", "dropbox", "webdav",
"b2", "mega", "pcloud", "box", "hubic", "yandex"
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

invalid syntax: constant declaration inside router object definition will cause compilation error

Suggested change
// Non-S3 providers that use rclone native protocols
const NON_S3_PROVIDERS = [
"ftp", "sftp", "drive", "onedrive", "dropbox", "webdav",
"b2", "mega", "pcloud", "box", "hubic", "yandex"
];
});
// Non-S3 providers that use rclone native protocols
const NON_S3_PROVIDERS = [
"ftp", "sftp", "drive", "onedrive", "dropbox", "webdav",
"b2", "mega", "pcloud", "box", "hubic", "yandex"
];
export const destinationRouter = createTRPCRouter({
create: adminProcedure
.input(apiCreateDestination)
.mutation(async ({ input, ctx }) => {
try {
return await createDestintation(
input,
ctx.session.activeOrganizationId,
);
} catch (error) {
throw new TRPCError({
code: "BAD_REQUEST",
message: "Error creating the destination",
cause: error,
});
}
}),

Comment on lines +86 to +88
if (accessKey) rcloneFlags.push(`--${provider}-user="${accessKey}"`);
if (secretAccessKey) rcloneFlags.push(`--${provider}-pass="${secretAccessKey}"`);
if (endpoint) rcloneFlags.push(`--${provider}-url="${endpoint}"`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rclone flag format --${provider}-user is incorrect for most providers - each provider has specific flag names (e.g., FTP uses --ftp-user, SFTP uses --sftp-user, but Google Drive uses --drive-service-account-credentials, OneDrive uses --onedrive-client-id). check rclone documentation for correct flags per provider

if (secretAccessKey) rcloneFlags.push(`--${provider}-pass="${secretAccessKey}"`);
if (endpoint) rcloneFlags.push(`--${provider}-url="${endpoint}"`);

rcloneCommand = `rclone ls ${rcloneFlags.join(" ")} "${providerConfig[provider]}"`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing type safety: accessing providerConfig[provider] without checking if provider exists in the mapping will cause runtime error if an unsupported provider is passed

Suggested change
rcloneCommand = `rclone ls ${rcloneFlags.join(" ")} "${providerConfig[provider]}"`;
const remoteConfig = providerConfig[provider];
if (!remoteConfig) {
throw new TRPCError({
code: "BAD_REQUEST",
message: `Unsupported provider: ${provider}`,
});
}
rcloneCommand = `rclone ls ${rcloneFlags.join(" ")} "${remoteConfig}"`;

Comment on lines +61 to +76
if (isNonS3) {
// Non-S3 providers use rclone native protocols
const providerConfig: Record<string, string> = {
ftp: `:ftp:${bucket || ""}`,
sftp: `:sftp:${bucket || ""}`,
drive: `:drive:${bucket || ""}`,
onedrive: `:onedrive:${bucket || ""}`,
dropbox: `:dropbox:${bucket || ""}`,
webdav: `:webdav:${bucket || ""}`,
b2: `:b2:${bucket || ""}`,
mega: `:mega:${bucket || ""}`,
pcloud: `:pcloud:${bucket || ""}`,
box: `:box:${bucket || ""}`,
hubic: `:hubic:${bucket || ""}`,
yandex: `:yandex:${bucket || ""}`,
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

several providers (Google Drive, OneDrive, Dropbox, Box) require OAuth authentication flow, not simple username/password. the current implementation using accessKey/secretAccessKey won't work for these providers - they need OAuth tokens or service account credentials configured through rclone config

@MikeNoppo
Copy link

Cool feature, we need this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to backup to more destination types

2 participants