Enhance backup functionality by adding support for compose backups in various components. Update ShowBackups to clarify backup update requirements, modify initCronJobs to include compose backups, and improve logging for backup scheduling. Additionally, ensure that the scheduleBackup function retains the latest backups for compose types and document the addition of domains and backups in the Docker compose process.

This commit is contained in:
Mauricio Siu 2025-04-27 23:09:39 -06:00
parent 19bf4f27b6
commit 77d7dc1f22
4 changed files with 8 additions and 4 deletions

View File

@ -161,7 +161,7 @@ export const ShowBackups = ({
{backupType === "compose" && (
<AlertBlock type="info">
Deploy is required to apply changes after creating or
updating a backup.
updating the service name in the backup.
</AlertBlock>
)}
</div>

View File

@ -70,6 +70,7 @@ export const initCronJobs = async () => {
mysql: true,
mongo: true,
user: true,
compose: true,
},
});
@ -77,10 +78,10 @@ export const initCronJobs = async () => {
try {
if (backup.enabled) {
scheduleBackup(backup);
console.log(
`[Backup] ${backup.databaseType} Enabled with cron: [${backup.schedule}]`,
);
}
console.log(
`[Backup] ${backup.databaseType} Enabled with cron: [${backup.schedule}]`,
);
} catch (error) {
console.error(`[Backup] ${backup.databaseType} Error`, error);
}

View File

@ -40,6 +40,7 @@ export const scheduleBackup = (backup: BackupSchedule) => {
}
} else if (backup.backupType === "compose" && compose) {
await runComposeBackup(compose, backup);
await keepLatestNBackups(backup, compose.serverId);
}
});
};

View File

@ -210,6 +210,7 @@ export const addDomainToCompose = async (
result = randomized;
}
// Add domains to the compose
for (const domain of domains) {
const { serviceName, https } = domain;
if (!serviceName) {
@ -264,6 +265,7 @@ export const addDomainToCompose = async (
}
}
// Add backups to the compose
for (const backup of backups) {
const { backupId, serviceName, enabled } = backup;