feat: restore mariadb from generic destinations

This commit is contained in:
Furox 2026-09-04 20:27:19 +03:00 committed by Furox88
parent 8dd3c1e8cf
commit 1d4ae272c0

View File

@ -3,7 +3,7 @@ import type { Destination } from "@dokploy/server/services/destination";
import type { Mariadb } from "@dokploy/server/services/mariadb";
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,10 +16,8 @@ export const restoreMariadbBackup = async (
try {
const { appName, serverId, databaseUser, databasePassword } = mariadb;
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({