diff --git a/src/js/restore.js b/src/js/restore.js index 1a393f474..0807271a2 100644 --- a/src/js/restore.js +++ b/src/js/restore.js @@ -47,7 +47,10 @@ app.controller('RestoreController', ['$scope', 'Client', function ($scope, Clien remoteDir: '', username: '', password: '', - diskPath: '' + diskPath: '', + user: '', + port: 22, + privateKey: '' }; $scope.sysinfo = { @@ -261,6 +264,10 @@ app.controller('RestoreController', ['$scope', 'Client', function ($scope, Clien if (backupConfig.provider === 'cifs') { backupConfig.mountOptions.username = $scope.mountOptions.username; backupConfig.mountOptions.password = $scope.mountOptions.password; + } else if (backupConfig.provider === 'sshfs') { + backupConfig.mountOptions.user = $scope.mountOptions.user; + backupConfig.mountOptions.port = $scope.mountOptions.port; + backupConfig.mountOptions.privateKey = $scope.mountOptions.privateKey; } } else if (backupConfig.provider === 'ext4') { backupConfig.mountOptions.diskPath = $scope.diskPath; diff --git a/src/restore.html b/src/restore.html index 7aacf252a..6e6e0fed7 100644 --- a/src/restore.html +++ b/src/restore.html @@ -129,6 +129,24 @@ + +
+ + +
+ + +
+ + +
+ + +
+ + +
+
diff --git a/src/translation/en.json b/src/translation/en.json index 61607e20f..c6f63fdbc 100644 --- a/src/translation/en.json +++ b/src/translation/en.json @@ -487,7 +487,10 @@ "username": "Username", "password": "Password", "configureMount": "Specify mount point configuration", - "setupMountDescription": "When checked, Cloudron will configure the mount point on the server" + "setupMountDescription": "When checked, Cloudron will configure the mount point on the server", + "port": "Port", + "user": "User", + "privateKey": "Private Key" }, "check": { "noop": "Cloudron backups are disabled. Please ensure this server is backed up using alternate means. See https://docs.cloudron.io/backups/#storage-providers for more information.", diff --git a/src/views/backups.html b/src/views/backups.html index a88e844d2..d44d6e230 100644 --- a/src/views/backups.html +++ b/src/views/backups.html @@ -167,6 +167,24 @@
+ +
+ + +
+ + +
+ + +
+ + +
+ + +
+
diff --git a/src/views/backups.js b/src/views/backups.js index f4a267100..978f6b47b 100644 --- a/src/views/backups.js +++ b/src/views/backups.js @@ -433,7 +433,10 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat remoteDir: '', username: '', password: '', - diskPath: '' + diskPath: '', + user: '', + port: 22, + privateKey: '' }, clearProviderFields: function () { @@ -457,7 +460,7 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat $scope.configureBackup.syncConcurrency = $scope.configureBackup.provider === 's3' ? 20 : 10; $scope.configureBackup.copyConcurrency = $scope.configureBackup.provider === 's3' ? 500 : 10; - $scope.configureBackup.mount = { host: '', remoteDir: '', username: '', password: '', diskPath: '' }; + $scope.configureBackup.mount = { host: '', remoteDir: '', username: '', password: '', diskPath: '', user: '', port: 22, privateKey: '' }; }, show: function () { @@ -513,7 +516,10 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat remoteDir: mountOptions.remoteDir || '', username: mountOptions.username || '', password: mountOptions.password || '', - diskPath: mountOptions.diskPath || '' + diskPath: mountOptions.diskPath || '', + user: mountOptions.user || '', + port: mountOptions.port || 22, + privateKey: mountOptions.privateKey || '' }; $('#configureBackupModal').modal('show'); @@ -603,6 +609,10 @@ angular.module('Application').controller('BackupsController', ['$scope', '$locat if (backupConfig.provider === 'cifs') { backupConfig.mountOptions.username = $scope.configureBackup.mountOptions.username; backupConfig.mountOptions.password = $scope.configureBackup.mountOptions.password; + } else if (backupConfig.provider === 'sshfs') { + backupConfig.mountOptions.user = $scope.configureBackup.mountOptions.user; + backupConfig.mountOptions.port = $scope.configureBackup.mountOptions.port; + backupConfig.mountOptions.privateKey = $scope.configureBackup.mountOptions.privateKey; } } else if (backupConfig.provider === 'ext4') { backupConfig.mountOptions.diskPath = $scope.configureBackup.diskPath;