Add field to skip backup for an app

This skips the app from a backup when doing a full box backup and
simply reuses the previous backup.

The app can still be explicitly backed up using 'cloudron backup'
and explicitly restored using 'cloudron restore --backup'.

When restoring the box, it all depends on the app's last backup.

Fixes #311
This commit is contained in:
Girish Ramakrishnan
2017-08-16 14:12:07 -07:00
parent 67a2ba957e
commit 78ec8e5c0c
9 changed files with 45 additions and 5 deletions

View File

@@ -415,6 +415,7 @@ function install(data, auditSource, callback) {
sso = 'sso' in data ? data.sso : null,
debugMode = data.debugMode || null,
robotsTxt = data.robotsTxt || null,
enableBackup = 'enableBackup' in data ? data.enableBackup : true,
backupId = data.backupId || null;
assert(data.appStoreId || data.manifest); // atleast one of them is required
@@ -484,7 +485,8 @@ function install(data, auditSource, callback) {
sso: sso,
debugMode: debugMode,
mailboxName: (location ? location : manifest.title.toLowerCase().replace(/[^a-zA-Z0-9]/g, '')) + '.app',
lastBackupId: backupId
lastBackupId: backupId,
enableBackup: enableBackup
};
appdb.add(appId, appStoreId, manifest, location, portBindings, data, function (error) {
@@ -583,6 +585,8 @@ function configure(appId, data, auditSource, callback) {
}
}
if ('enableBackup' in data) values.enableBackup = data.enableBackup;
values.oldConfig = getAppConfig(app);
debug('Will configure app with id:%s values:%j', appId, values);