Add sshfs/cifs/nfs backup storage to app import

This commit is contained in:
Johannes Zellner
2021-01-07 18:28:30 +01:00
parent a723cee47f
commit 46dabee6ee
2 changed files with 21 additions and 2 deletions

View File

@@ -83,16 +83,19 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.storageProvider = [
{ name: 'Amazon S3', value: 's3' },
{ name: 'Backblaze B2 (S3 API)', value: 'backblaze-b2' },
{ name: 'CIFS Mount', value: 'cifs' },
{ name: 'DigitalOcean Spaces', value: 'digitalocean-spaces' },
{ name: 'Exoscale SOS', value: 'exoscale-sos' },
{ name: 'Filesystem', value: 'filesystem' },
{ name: 'Google Cloud Storage', value: 'gcs' },
{ name: 'Linode Object Storage', value: 'linode-objectstorage' },
{ name: 'Minio', value: 'minio' },
{ name: 'NFS Mount', value: 'nfs' },
{ name: 'OVH Object Storage', value: 'ovh-objectstorage' },
{ name: 'Scaleway Object Storage', value: 'scaleway-objectstorage' },
// { name: 'No-op (Only for testing)', value: 'noop' },
{ name: 'S3 API Compatible (v4)', value: 's3-v4-compat' },
{ name: 'Scaleway Object Storage', value: 'scaleway-objectstorage' },
{ name: 'SSHFS Mount', value: 'sshfs' },
// { name: 'No-op (Only for testing)', value: 'noop' },
{ name: 'Wasabi', value: 'wasabi' }
];
@@ -915,6 +918,10 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
|| provider === 'linode-objectstorage' || provider === 'ovh-objectstorage';
};
$scope.mountlike = function (provider) {
return provider === 'sshfs' || provider === 'cifs' || provider === 'nfs';
};
$scope.importBackup = {
busy: false,
error: {},
@@ -923,6 +930,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
provider: '',
bucket: '',
prefix: '',
mountPoint: '',
accessKeyId: '',
secretAccessKey: '',
gcsKey: { keyFileName: '', content: '' },
@@ -937,6 +945,7 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
// $scope.importBackup.provider = ''; // do not clear since we call this function on provider change
$scope.importBackup.bucket = '';
$scope.importBackup.prefix = '';
$scope.importBackup.mountPoint = '';
$scope.importBackup.accessKeyId = '';
$scope.importBackup.secretAccessKey = '';
$scope.importBackup.gcsKey.keyFileName = '';
@@ -1014,6 +1023,9 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
$scope.importBackup.busy = false;
return;
}
} else if (backupConfig.provider === 'sshfs' || backupConfig.provider === 'cifs' || backupConfig.provider === 'nfs') {
backupConfig.mountPoint = $scope.importBackup.mountPoint;
backupConfig.prefix = $scope.importBackup.prefix;
} else if (backupConfig.provider === 'filesystem') {
var parts = backupId.split('/');
backupId = parts.pop() || parts.pop(); // removes any trailing slash. this is basename()