From 8def29a6883a24e214020463cfb25bc6a169d2e1 Mon Sep 17 00:00:00 2001 From: Furox Date: Fri, 4 Sep 2026 20:25:04 +0300 Subject: [PATCH] feat: restore postgres from generic destinations --- packages/server/src/utils/restore/postgres.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/server/src/utils/restore/postgres.ts b/packages/server/src/utils/restore/postgres.ts index 05dcf38a3..89b49b371 100644 --- a/packages/server/src/utils/restore/postgres.ts +++ b/packages/server/src/utils/restore/postgres.ts @@ -3,7 +3,7 @@ import type { Destination } from "@dokploy/server/services/destination"; import type { Postgres } from "@dokploy/server/services/postgres"; 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"; @@ -16,11 +16,8 @@ export const restorePostgresBackup = async ( try { const { appName, databaseUser, serverId } = postgres; - const rcloneFlags = getS3Credentials(destination); - const bucketPath = `:s3:${destination.bucket}`; - - const backupPath = `${bucketPath}/${backupInput.backupFile}`; - + const { flags: rcloneFlags, path: backupPath } = + await getRclonePathAndFlags(destination, backupInput.backupFile); const rcloneCommand = `rclone cat ${rcloneFlags.join(" ")} ${quote([backupPath])} | gunzip`; const command = getRestoreCommand({