2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

feat: ssh支持私钥密码,close #774

This commit is contained in:
2026-01-08 23:24:04 +08:00
parent 3afc00be2f
commit 89ace2360c
5 changed files with 61 additions and 14 deletions

View File

@@ -5,9 +5,10 @@ type SSHCreate struct {
Host string `json:"host" form:"host" validate:"required"`
Port uint `json:"port" form:"port" validate:"required|min:1|max:65535"`
AuthMethod string `json:"auth_method" form:"auth_method" validate:"required|in:password,publickey"`
User string `json:"user" form:"user" validate:"requiredIf:AuthMethod,password"`
User string `json:"user" form:"user" validate:"required"`
Password string `json:"password" form:"password" validate:"requiredIf:AuthMethod,password"`
Key string `json:"key" form:"key" validate:"requiredIf:AuthMethod,publickey"`
Passphrase string `json:"passphrase" form:"passphrase"`
Remark string `json:"remark" form:"remark"`
}
@@ -17,8 +18,9 @@ type SSHUpdate struct {
Host string `json:"host" form:"host" validate:"required"`
Port uint `json:"port" form:"port" validate:"required|min:1|max:65535"`
AuthMethod string `json:"auth_method" form:"auth_method" validate:"required|in:password,publickey"`
User string `json:"user" form:"user" validate:"requiredIf:AuthMethod,password"`
User string `json:"user" form:"user" validate:"required"`
Password string `json:"password" form:"password" validate:"requiredIf:AuthMethod,password"`
Key string `json:"key" form:"key" validate:"requiredIf:AuthMethod,publickey"`
Passphrase string `json:"passphrase" form:"passphrase"`
Remark string `json:"remark" form:"remark"`
}