[FEATURE] Initial Anti-Storage

This commit is contained in:
Dunemask 2024-01-23 14:50:41 -07:00
parent b84fba6153
commit 9f0689f6a4
6 changed files with 95 additions and 57 deletions

View file

@ -15,8 +15,14 @@ const dnsRegex = new RegExp(
function backupPayloadFilter(req, res) {
const serverSpec = req.body;
const { backupHost, backupBucket, backupId, backupKey, backupInterval } =
serverSpec;
const {
storage,
backupHost,
backupBucket,
backupId,
backupKey,
backupInterval,
} = serverSpec;
// TODO: Impliment non creation time backups
if (
!!backupHost ||
@ -25,6 +31,8 @@ function backupPayloadFilter(req, res) {
!!backupKey ||
!!backupInterval
) {
if (storage === 0)
return res.status(400).send("Backups cannot be used if storage is zero!");
// If any keys are required, all are required
if (
!(