feat: browse backup files across all destination types

This commit is contained in:
Furox 2026-09-04 20:30:58 +03:00 committed by Furox88
parent 549d7de528
commit 55dccaddfa

View File

@ -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 = "";