diff --git a/apps/dokploy/server/api/routers/backup.ts b/apps/dokploy/server/api/routers/backup.ts index 9bc73ce77..e34e208be 100644 --- a/apps/dokploy/server/api/routers/backup.ts +++ b/apps/dokploy/server/api/routers/backup.ts @@ -32,7 +32,7 @@ import { findDestinationById } from "@dokploy/server/services/destination"; import { checkServicePermissionAndAccess } from "@dokploy/server/services/permission"; import { runComposeBackup } from "@dokploy/server/utils/backups/compose"; import { - getS3Credentials, + getRclonePathAndFlags, normalizeS3Path, } from "@dokploy/server/utils/backups/utils"; import { @@ -497,8 +497,6 @@ export const backupRouter = createTRPCRouter({ }); } } - const rcloneFlags = getS3Credentials(destination); - const bucketPath = `:s3:${destination.bucket}`; const lastSlashIndex = input.search.lastIndexOf("/"); const baseDir = @@ -509,8 +507,8 @@ export const backupRouter = createTRPCRouter({ lastSlashIndex !== -1 ? input.search.slice(lastSlashIndex + 1) : input.search; - - const searchPath = baseDir ? `${bucketPath}/${baseDir}` : bucketPath; + const { flags: rcloneFlags, path: searchPath } = + await getRclonePathAndFlags(destination, baseDir); const listCommand = `rclone lsjson ${rcloneFlags.join(" ")} ${quote([searchPath])} --no-mimetype --no-modtime 2>/dev/null`; let stdout = "";