feat: restore compose backups from generic destinations

This commit is contained in:
Furox 2026-09-04 20:27:47 +03:00 committed by Furox88
parent b6c197be24
commit 4c14dc6f52

View File

@ -3,7 +3,7 @@ import type { Compose } from "@dokploy/server/services/compose";
import type { Destination } from "@dokploy/server/services/destination";
import { quote } from "shell-quote";
import type { z } from "zod";
import { getS3Credentials } from "../backups/utils";
import { getRclonePathAndFlags } from "../backups/utils";
import { execAsync, execAsyncRemote } from "../process/execAsync";
import { getRestoreCommand } from "./utils";
@ -24,9 +24,8 @@ export const restoreComposeBackup = async (
}
const { serverId, appName, composeType } = compose;
const rcloneFlags = getS3Credentials(destination);
const bucketPath = `:s3:${destination.bucket}`;
const backupPath = `${bucketPath}/${backupInput.backupFile}`;
const { flags: rcloneFlags, path: backupPath } =
await getRclonePathAndFlags(destination, backupInput.backupFile);
let rcloneCommand = `rclone cat ${rcloneFlags.join(" ")} ${quote([backupPath])} | gunzip`;
if (backupInput.metadata?.mongo) {