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

View File

@@ -99,6 +99,8 @@ exports = module.exports = {
aliasDomains: []
},
getDefaultBackupTarget,
mockApiServerOrigin: 'http://localhost:6060',
dashboardDomain: 'test.example.com',
dashboardFqdn: 'my.test.example.com',
@@ -115,7 +117,15 @@ async function setupServer() {
await database.initialize();
await database._clear();
await appstore._setApiServerOrigin(exports.mockApiServerOrigin);
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 * * *'
});
await oidcServer.stop();
await server.start();
debug('Set up server complete');
@@ -231,3 +241,8 @@ async function waitForAsyncTask(es) {
});
});
}
async function getDefaultBackupTarget() {
const result = await backupTargets.list(1, 1);
return result[0];
}