@@ -498,52 +498,53 @@ func (sf *ServerForm) createAlgorithmAutocomplete(suggestions []string) func(str
498
498
func (sf * ServerForm ) getDefaultValues () ServerFormData {
499
499
if sf .mode == ServerFormEdit && sf .original != nil {
500
500
return ServerFormData {
501
- Alias : sf .original .Alias ,
502
- Host : sf .original .Host ,
503
- User : sf .original .User ,
504
- Port : fmt .Sprint (sf .original .Port ),
505
- Key : strings .Join (sf .original .IdentityFiles , ", " ),
506
- Tags : strings .Join (sf .original .Tags , ", " ),
507
- ProxyJump : sf .original .ProxyJump ,
508
- ProxyCommand : sf .original .ProxyCommand ,
509
- RemoteCommand : sf .original .RemoteCommand ,
510
- RequestTTY : sf .original .RequestTTY ,
511
- ConnectTimeout : sf .original .ConnectTimeout ,
512
- ConnectionAttempts : sf .original .ConnectionAttempts ,
513
- BindAddress : sf .original .BindAddress ,
514
- BindInterface : sf .original .BindInterface ,
515
- LocalForward : strings .Join (sf .original .LocalForward , ", " ),
516
- RemoteForward : strings .Join (sf .original .RemoteForward , ", " ),
517
- DynamicForward : strings .Join (sf .original .DynamicForward , ", " ),
518
- PubkeyAuthentication : sf .original .PubkeyAuthentication ,
519
- PasswordAuthentication : sf .original .PasswordAuthentication ,
520
- PreferredAuthentications : sf .original .PreferredAuthentications ,
521
- IdentitiesOnly : sf .original .IdentitiesOnly ,
522
- AddKeysToAgent : sf .original .AddKeysToAgent ,
523
- IdentityAgent : sf .original .IdentityAgent ,
524
- ForwardAgent : sf .original .ForwardAgent ,
525
- ForwardX11 : sf .original .ForwardX11 ,
526
- ForwardX11Trusted : sf .original .ForwardX11Trusted ,
527
- ControlMaster : sf .original .ControlMaster ,
528
- ControlPath : sf .original .ControlPath ,
529
- ControlPersist : sf .original .ControlPersist ,
530
- ServerAliveInterval : sf .original .ServerAliveInterval ,
531
- ServerAliveCountMax : sf .original .ServerAliveCountMax ,
532
- Compression : sf .original .Compression ,
533
- TCPKeepAlive : sf .original .TCPKeepAlive ,
534
- StrictHostKeyChecking : sf .original .StrictHostKeyChecking ,
535
- UserKnownHostsFile : sf .original .UserKnownHostsFile ,
536
- HostKeyAlgorithms : sf .original .HostKeyAlgorithms ,
537
- PubkeyAcceptedAlgorithms : sf .original .PubkeyAcceptedAlgorithms ,
538
- MACs : sf .original .MACs ,
539
- Ciphers : sf .original .Ciphers ,
540
- KexAlgorithms : sf .original .KexAlgorithms ,
541
- LocalCommand : sf .original .LocalCommand ,
542
- PermitLocalCommand : sf .original .PermitLocalCommand ,
543
- SendEnv : strings .Join (sf .original .SendEnv , ", " ),
544
- SetEnv : strings .Join (sf .original .SetEnv , ", " ),
545
- LogLevel : sf .original .LogLevel ,
546
- BatchMode : sf .original .BatchMode ,
501
+ Alias : sf .original .Alias ,
502
+ Host : sf .original .Host ,
503
+ User : sf .original .User ,
504
+ Port : fmt .Sprint (sf .original .Port ),
505
+ Key : strings .Join (sf .original .IdentityFiles , ", " ),
506
+ Tags : strings .Join (sf .original .Tags , ", " ),
507
+ ProxyJump : sf .original .ProxyJump ,
508
+ ProxyCommand : sf .original .ProxyCommand ,
509
+ RemoteCommand : sf .original .RemoteCommand ,
510
+ RequestTTY : sf .original .RequestTTY ,
511
+ ConnectTimeout : sf .original .ConnectTimeout ,
512
+ ConnectionAttempts : sf .original .ConnectionAttempts ,
513
+ BindAddress : sf .original .BindAddress ,
514
+ BindInterface : sf .original .BindInterface ,
515
+ LocalForward : strings .Join (sf .original .LocalForward , ", " ),
516
+ RemoteForward : strings .Join (sf .original .RemoteForward , ", " ),
517
+ DynamicForward : strings .Join (sf .original .DynamicForward , ", " ),
518
+ PubkeyAuthentication : sf .original .PubkeyAuthentication ,
519
+ PasswordAuthentication : sf .original .PasswordAuthentication ,
520
+ PreferredAuthentications : sf .original .PreferredAuthentications ,
521
+ IdentitiesOnly : sf .original .IdentitiesOnly ,
522
+ AddKeysToAgent : sf .original .AddKeysToAgent ,
523
+ IdentityAgent : sf .original .IdentityAgent ,
524
+ ForwardAgent : sf .original .ForwardAgent ,
525
+ ForwardX11 : sf .original .ForwardX11 ,
526
+ ForwardX11Trusted : sf .original .ForwardX11Trusted ,
527
+ ControlMaster : sf .original .ControlMaster ,
528
+ ControlPath : sf .original .ControlPath ,
529
+ ControlPersist : sf .original .ControlPersist ,
530
+ ServerAliveInterval : sf .original .ServerAliveInterval ,
531
+ ServerAliveCountMax : sf .original .ServerAliveCountMax ,
532
+ Compression : sf .original .Compression ,
533
+ TCPKeepAlive : sf .original .TCPKeepAlive ,
534
+ StrictHostKeyChecking : sf .original .StrictHostKeyChecking ,
535
+ UserKnownHostsFile : sf .original .UserKnownHostsFile ,
536
+ HostKeyAlgorithms : sf .original .HostKeyAlgorithms ,
537
+ PubkeyAcceptedAlgorithms : sf .original .PubkeyAcceptedAlgorithms ,
538
+ HostbasedAcceptedAlgorithms : sf .original .HostbasedAcceptedAlgorithms ,
539
+ MACs : sf .original .MACs ,
540
+ Ciphers : sf .original .Ciphers ,
541
+ KexAlgorithms : sf .original .KexAlgorithms ,
542
+ LocalCommand : sf .original .LocalCommand ,
543
+ PermitLocalCommand : sf .original .PermitLocalCommand ,
544
+ SendEnv : strings .Join (sf .original .SendEnv , ", " ),
545
+ SetEnv : strings .Join (sf .original .SetEnv , ", " ),
546
+ LogLevel : sf .original .LogLevel ,
547
+ BatchMode : sf .original .BatchMode ,
547
548
}
548
549
}
549
550
return ServerFormData {
@@ -827,6 +828,14 @@ func (sf *ServerForm) createAdvancedForm() {
827
828
}
828
829
}
829
830
831
+ // HostbasedAcceptedAlgorithms with autocomplete support
832
+ form .AddInputField ("HostbasedAcceptedAlgorithms:" , defaultValues .HostbasedAcceptedAlgorithms , 40 , nil , nil )
833
+ if itemCount := form .GetFormItemCount (); itemCount > 0 {
834
+ if field , ok := form .GetFormItem (itemCount - 1 ).(* tview.InputField ); ok {
835
+ field .SetAutocompleteFunc (sf .createAlgorithmAutocomplete (pubkeyAlgorithms ))
836
+ }
837
+ }
838
+
830
839
form .AddTextView ("[yellow]Command Execution[-]" , "" , 0 , 1 , true , false )
831
840
form .AddInputField ("LocalCommand:" , defaultValues .LocalCommand , 40 , nil , nil )
832
841
@@ -908,13 +917,14 @@ type ServerFormData struct {
908
917
TCPKeepAlive string
909
918
910
919
// Security settings
911
- StrictHostKeyChecking string
912
- UserKnownHostsFile string
913
- HostKeyAlgorithms string
914
- PubkeyAcceptedAlgorithms string
915
- MACs string
916
- Ciphers string
917
- KexAlgorithms string
920
+ StrictHostKeyChecking string
921
+ UserKnownHostsFile string
922
+ HostKeyAlgorithms string
923
+ PubkeyAcceptedAlgorithms string
924
+ HostbasedAcceptedAlgorithms string
925
+ MACs string
926
+ Ciphers string
927
+ KexAlgorithms string
918
928
919
929
// Command execution
920
930
LocalCommand string
@@ -1089,52 +1099,53 @@ func (sf *ServerForm) dataToServer(data ServerFormData) domain.Server {
1089
1099
}
1090
1100
1091
1101
return domain.Server {
1092
- Alias : data .Alias ,
1093
- Host : data .Host ,
1094
- User : data .User ,
1095
- Port : port ,
1096
- IdentityFiles : keys ,
1097
- Tags : tags ,
1098
- ProxyJump : data .ProxyJump ,
1099
- ProxyCommand : data .ProxyCommand ,
1100
- RemoteCommand : data .RemoteCommand ,
1101
- RequestTTY : data .RequestTTY ,
1102
- ConnectTimeout : data .ConnectTimeout ,
1103
- ConnectionAttempts : data .ConnectionAttempts ,
1104
- BindAddress : data .BindAddress ,
1105
- BindInterface : data .BindInterface ,
1106
- LocalForward : splitComma (data .LocalForward ),
1107
- RemoteForward : splitComma (data .RemoteForward ),
1108
- DynamicForward : splitComma (data .DynamicForward ),
1109
- PubkeyAuthentication : data .PubkeyAuthentication ,
1110
- PasswordAuthentication : data .PasswordAuthentication ,
1111
- PreferredAuthentications : data .PreferredAuthentications ,
1112
- IdentitiesOnly : data .IdentitiesOnly ,
1113
- AddKeysToAgent : data .AddKeysToAgent ,
1114
- IdentityAgent : data .IdentityAgent ,
1115
- ForwardAgent : data .ForwardAgent ,
1116
- ForwardX11 : data .ForwardX11 ,
1117
- ForwardX11Trusted : data .ForwardX11Trusted ,
1118
- ControlMaster : data .ControlMaster ,
1119
- ControlPath : data .ControlPath ,
1120
- ControlPersist : data .ControlPersist ,
1121
- ServerAliveInterval : data .ServerAliveInterval ,
1122
- ServerAliveCountMax : data .ServerAliveCountMax ,
1123
- Compression : data .Compression ,
1124
- TCPKeepAlive : data .TCPKeepAlive ,
1125
- StrictHostKeyChecking : data .StrictHostKeyChecking ,
1126
- UserKnownHostsFile : data .UserKnownHostsFile ,
1127
- HostKeyAlgorithms : data .HostKeyAlgorithms ,
1128
- PubkeyAcceptedAlgorithms : data .PubkeyAcceptedAlgorithms ,
1129
- MACs : data .MACs ,
1130
- Ciphers : data .Ciphers ,
1131
- KexAlgorithms : data .KexAlgorithms ,
1132
- LocalCommand : data .LocalCommand ,
1133
- PermitLocalCommand : data .PermitLocalCommand ,
1134
- SendEnv : splitComma (data .SendEnv ),
1135
- SetEnv : splitComma (data .SetEnv ),
1136
- LogLevel : data .LogLevel ,
1137
- BatchMode : data .BatchMode ,
1102
+ Alias : data .Alias ,
1103
+ Host : data .Host ,
1104
+ User : data .User ,
1105
+ Port : port ,
1106
+ IdentityFiles : keys ,
1107
+ Tags : tags ,
1108
+ ProxyJump : data .ProxyJump ,
1109
+ ProxyCommand : data .ProxyCommand ,
1110
+ RemoteCommand : data .RemoteCommand ,
1111
+ RequestTTY : data .RequestTTY ,
1112
+ ConnectTimeout : data .ConnectTimeout ,
1113
+ ConnectionAttempts : data .ConnectionAttempts ,
1114
+ BindAddress : data .BindAddress ,
1115
+ BindInterface : data .BindInterface ,
1116
+ LocalForward : splitComma (data .LocalForward ),
1117
+ RemoteForward : splitComma (data .RemoteForward ),
1118
+ DynamicForward : splitComma (data .DynamicForward ),
1119
+ PubkeyAuthentication : data .PubkeyAuthentication ,
1120
+ PasswordAuthentication : data .PasswordAuthentication ,
1121
+ PreferredAuthentications : data .PreferredAuthentications ,
1122
+ IdentitiesOnly : data .IdentitiesOnly ,
1123
+ AddKeysToAgent : data .AddKeysToAgent ,
1124
+ IdentityAgent : data .IdentityAgent ,
1125
+ ForwardAgent : data .ForwardAgent ,
1126
+ ForwardX11 : data .ForwardX11 ,
1127
+ ForwardX11Trusted : data .ForwardX11Trusted ,
1128
+ ControlMaster : data .ControlMaster ,
1129
+ ControlPath : data .ControlPath ,
1130
+ ControlPersist : data .ControlPersist ,
1131
+ ServerAliveInterval : data .ServerAliveInterval ,
1132
+ ServerAliveCountMax : data .ServerAliveCountMax ,
1133
+ Compression : data .Compression ,
1134
+ TCPKeepAlive : data .TCPKeepAlive ,
1135
+ StrictHostKeyChecking : data .StrictHostKeyChecking ,
1136
+ UserKnownHostsFile : data .UserKnownHostsFile ,
1137
+ HostKeyAlgorithms : data .HostKeyAlgorithms ,
1138
+ PubkeyAcceptedAlgorithms : data .PubkeyAcceptedAlgorithms ,
1139
+ HostbasedAcceptedAlgorithms : data .HostbasedAcceptedAlgorithms ,
1140
+ MACs : data .MACs ,
1141
+ Ciphers : data .Ciphers ,
1142
+ KexAlgorithms : data .KexAlgorithms ,
1143
+ LocalCommand : data .LocalCommand ,
1144
+ PermitLocalCommand : data .PermitLocalCommand ,
1145
+ SendEnv : splitComma (data .SendEnv ),
1146
+ SetEnv : splitComma (data .SetEnv ),
1147
+ LogLevel : data .LogLevel ,
1148
+ BatchMode : data .BatchMode ,
1138
1149
}
1139
1150
}
1140
1151
0 commit comments