backups: use a real targetId

This commit is contained in:
Girish Ramakrishnan
2025-07-25 07:44:25 +02:00
parent cfce39c1de
commit 276db17f0c
12 changed files with 81 additions and 62 deletions
+17 -1
View File
@@ -173,6 +173,8 @@ exports = module.exports = {
checkMails,
clearMailQueue,
getDefaultBackupTarget,
mockApiServerOrigin: 'http://localhost:6060',
dashboardDomain: domain.domain,
dashboardFqdn: `my.${domain.domain}`,
@@ -218,7 +220,16 @@ async function databaseSetup() {
await database._clear();
await appstore._setApiServerOrigin(exports.mockApiServerOrigin);
await dashboard._setLocation(constants.DASHBOARD_SUBDOMAIN, exports.dashboardDomain);
await backupTargets._addDefault();
// duplicated here since we clear the database
await backupTargets.add({
provider: 'filesystem',
label: '',
config: { backupFolder: '/tmp/boxtest' },
format: 'tgz',
retention: { keepWithinSecs: 2 * 24 * 60 * 60 },
schedule: '00 00 23 * * *'
});
}
async function domainSetup() {
@@ -263,3 +274,8 @@ async function checkMails(number) {
// return for further investigation
return emails;
}
async function getDefaultBackupTarget() {
const result = await backupTargets.list(1, 1);
return result[0];
}