mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Asyncify SSH access, do not show SSH service if ssh is not well configured
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user