Setup backup encryption in extra step
This commit is contained in:
@@ -20,12 +20,10 @@ function create() {
|
||||
if (error || result.status !== 200) return [error || result];
|
||||
return [null, result.body.backupTargets];
|
||||
},
|
||||
async add(name, format, provider, config, schedule, retention, limits = null, encryptionPassword = null, encryptedFilenames = null) {
|
||||
async add(name, format, provider, config, schedule, retention, limits = null) {
|
||||
const data = { name, format, provider, config, schedule, retention };
|
||||
|
||||
if (limits !== null) data.limits = limits;
|
||||
if (encryptionPassword !== null) data.encryptionPassword = encryptionPassword;
|
||||
if (encryptedFilenames !== null) data.encryptedFilenames = encryptedFilenames;
|
||||
|
||||
let error, result;
|
||||
try {
|
||||
@@ -126,6 +124,17 @@ function create() {
|
||||
if (error || result.status !== 200) return [error || result];
|
||||
return [null];
|
||||
},
|
||||
async setEncryption(id, encryptionPassword, encryptedFilenames, encryptionPasswordHint = '') {
|
||||
let error, result;
|
||||
try {
|
||||
result = await fetcher.post(`${API_ORIGIN}/api/v1/backup_targets/${id}/configure/encryption`, { encryptionPassword, encryptedFilenames, encryptionPasswordHint }, { access_token: accessToken });
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
|
||||
if (error || result.status !== 200) return [error || result];
|
||||
return [null];
|
||||
},
|
||||
async setConfig(id, config) {
|
||||
let error, result;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user