15
src/apps.js
15
src/apps.js
@@ -153,6 +153,7 @@ const appstore = require('./appstore.js'),
|
||||
fs = require('fs'),
|
||||
mail = require('./mail.js'),
|
||||
manifestFormat = require('cloudron-manifestformat'),
|
||||
mounts = require('./mounts.js'),
|
||||
once = require('once'),
|
||||
os = require('os'),
|
||||
path = require('path'),
|
||||
@@ -1903,6 +1904,20 @@ async function importApp(app, data, auditSource) {
|
||||
|
||||
// TODO: make this smarter to do a read-only test and check if the file exists in the storage backend
|
||||
if (backupConfig) {
|
||||
if (mounts.isMountProvider(backupConfig.provider)) {
|
||||
backupConfig.mountPoint = `/mnt/appimport-${app.id}`;
|
||||
error = mounts.validateMountOptions(backupConfig.provider, backupConfig.mountOptions);
|
||||
if (error) throw error;
|
||||
|
||||
const mountObject = { // keep this in sync with the import code in apptask
|
||||
name: `appimport-${app.id}`,
|
||||
hostPath: backupConfig.mountPoint,
|
||||
mountType: backupConfig.provider,
|
||||
mountOptions: backupConfig.mountOptions
|
||||
};
|
||||
await mounts.tryAddMount(mountObject, { timeout: 10 });
|
||||
|
||||
}
|
||||
error = await backups.testProviderConfig(backupConfig);
|
||||
if (error) throw error;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user