Merge branch 'canary' into nginx-static-spa-build

This commit is contained in:
Mauricio Siu
2025-05-26 02:59:03 -06:00
9 changed files with 43 additions and 28 deletions

View File

@@ -131,3 +131,5 @@ export {
export * from "./utils/schedules/utils";
export * from "./utils/schedules/index";
export * from "./lib/logger";

View File

@@ -0,0 +1,11 @@
import pino from "pino";
export const logger = pino({
transport: {
target: "pino-pretty",
options: {
colorize: true,
levelFirst: false,
},
},
});

View File

@@ -35,7 +35,7 @@ export const generateRandomDomain = ({
projectName,
}: Schema): string => {
const hash = randomBytes(3).toString("hex");
const slugIp = serverIp.replaceAll(".", "-");
const slugIp = serverIp.replaceAll(".", "-").replaceAll(":", "-");
return `${projectName}-${hash}${slugIp === "" ? "" : `-${slugIp}`}.traefik.me`;
};

View File

@@ -8,6 +8,7 @@ import { runMySqlBackup } from "./mysql";
import { runPostgresBackup } from "./postgres";
import { runWebServerBackup } from "./web-server";
import { runComposeBackup } from "./compose";
import { logger } from "@dokploy/server/lib/logger";
export const scheduleBackup = (backup: BackupSchedule) => {
const {
@@ -222,6 +223,17 @@ export const getBackupCommand = (
) => {
const containerSearch = getContainerSearchCommand(backup);
const backupCommand = generateBackupCommand(backup);
logger.info(
{
containerSearch,
backupCommand,
rcloneCommand,
logPath,
},
`Executing backup command: ${backup.databaseType} ${backup.backupType}`,
);
return `
set -eo pipefail;
echo "[$(date)] Starting backup process..." >> ${logPath};