Asyncify SSH access, do not show SSH service if ssh is not well configured

This commit is contained in:
nicolas.dorier
2019-08-27 23:30:25 +09:00
parent 9a9e31c759
commit 9688798a4a
11 changed files with 220 additions and 153 deletions

View File

@@ -11,27 +11,8 @@ namespace BTCPayServer.Models.ServerViewModels
{
public class MaintenanceViewModel
{
public bool ExposedSSH { get; set; }
[Required]
public string UserName { get; set; }
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
[Display(Name = "Change domain")]
public string DNSDomain { get; set; }
public SshClient CreateSSHClient(string host)
{
return new SshClient(host, UserName, Password);
}
internal void SetConfiguredSSH(SSHSettings settings)
{
if(settings != null)
{
ExposedSSH = true;
UserName = "unknown";
Password = "unknown";
}
}
public bool CanUseSSH { get; internal set; }
}
}