增加服务器管理认证方式
This commit is contained in:
parent
2165427ec1
commit
9868a32bc7
@ -1,5 +1,6 @@
|
||||
package com.qqchen.deploy.backend.deploy.dto;
|
||||
|
||||
import com.qqchen.deploy.backend.deploy.enums.AuthTypeEnum;
|
||||
import com.qqchen.deploy.backend.deploy.enums.OsTypeEnum;
|
||||
import com.qqchen.deploy.backend.deploy.enums.ServerStatusEnum;
|
||||
import com.qqchen.deploy.backend.framework.dto.BaseDTO;
|
||||
@ -34,6 +35,26 @@ public class ServerDTO extends BaseDTO {
|
||||
*/
|
||||
private String sshUser;
|
||||
|
||||
/**
|
||||
* 认证方式
|
||||
*/
|
||||
private AuthTypeEnum authType;
|
||||
|
||||
/**
|
||||
* SSH密码(加密存储)
|
||||
*/
|
||||
private String sshPassword;
|
||||
|
||||
/**
|
||||
* SSH私钥(加密存储)
|
||||
*/
|
||||
private String sshPrivateKey;
|
||||
|
||||
/**
|
||||
* 私钥密码(加密存储)
|
||||
*/
|
||||
private String sshPassphrase;
|
||||
|
||||
/**
|
||||
* 服务器分类ID
|
||||
*/
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.qqchen.deploy.backend.deploy.entity;
|
||||
|
||||
import com.qqchen.deploy.backend.deploy.enums.AuthTypeEnum;
|
||||
import com.qqchen.deploy.backend.deploy.enums.OsTypeEnum;
|
||||
import com.qqchen.deploy.backend.deploy.enums.ServerStatusEnum;
|
||||
import com.qqchen.deploy.backend.framework.domain.Entity;
|
||||
@ -41,6 +42,31 @@ public class Server extends Entity<Long> {
|
||||
@Column(name = "ssh_user", length = 50)
|
||||
private String sshUser;
|
||||
|
||||
/**
|
||||
* 认证方式
|
||||
*/
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "auth_type", length = 20)
|
||||
private AuthTypeEnum authType;
|
||||
|
||||
/**
|
||||
* SSH密码(加密存储)
|
||||
*/
|
||||
@Column(name = "ssh_password", length = 500)
|
||||
private String sshPassword;
|
||||
|
||||
/**
|
||||
* SSH私钥(加密存储)
|
||||
*/
|
||||
@Column(name = "ssh_private_key", columnDefinition = "TEXT")
|
||||
private String sshPrivateKey;
|
||||
|
||||
/**
|
||||
* 私钥密码(加密存储)
|
||||
*/
|
||||
@Column(name = "ssh_passphrase", length = 500)
|
||||
private String sshPassphrase;
|
||||
|
||||
/**
|
||||
* 服务器分类ID
|
||||
*/
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.qqchen.deploy.backend.deploy.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* SSH认证方式枚举
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AuthTypeEnum {
|
||||
|
||||
PASSWORD("密码认证", "使用用户名和密码进行SSH认证"),
|
||||
KEY("密钥认证", "使用SSH私钥进行认证");
|
||||
|
||||
private final String name;
|
||||
private final String description;
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.qqchen.deploy.backend.deploy.query;
|
||||
|
||||
import com.qqchen.deploy.backend.deploy.enums.AuthTypeEnum;
|
||||
import com.qqchen.deploy.backend.deploy.enums.OsTypeEnum;
|
||||
import com.qqchen.deploy.backend.deploy.enums.ServerStatusEnum;
|
||||
import com.qqchen.deploy.backend.framework.annotation.QueryField;
|
||||
@ -33,6 +34,12 @@ public class ServerQuery extends BaseQuery {
|
||||
@QueryField(field = "categoryId")
|
||||
private Long categoryId;
|
||||
|
||||
/**
|
||||
* 认证方式
|
||||
*/
|
||||
@QueryField(field = "authType")
|
||||
private AuthTypeEnum authType;
|
||||
|
||||
/**
|
||||
* 操作系统类型
|
||||
*/
|
||||
|
||||
@ -1030,6 +1030,10 @@ CREATE TABLE deploy_server (
|
||||
host_ip VARCHAR(50) NOT NULL UNIQUE COMMENT 'IP地址',
|
||||
ssh_port INT DEFAULT 22 COMMENT 'SSH端口',
|
||||
ssh_user VARCHAR(50) NULL COMMENT 'SSH用户名',
|
||||
auth_type VARCHAR(20) DEFAULT 'PASSWORD' COMMENT '认证方式:PASSWORD/KEY',
|
||||
ssh_password VARCHAR(500) NULL COMMENT 'SSH密码(加密存储)',
|
||||
ssh_private_key TEXT NULL COMMENT 'SSH私钥(加密存储)',
|
||||
ssh_passphrase VARCHAR(500) NULL COMMENT '私钥密码(加密存储)',
|
||||
category_id BIGINT NULL COMMENT '服务器分类ID',
|
||||
os_type VARCHAR(20) NULL COMMENT '操作系统类型:LINUX/WINDOWS/MACOS/UNIX/OTHER',
|
||||
os_version VARCHAR(100) NULL COMMENT '操作系统版本:CentOS 7.9',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user