跳转到内容

数据模型

id: UUID
name: String
group: String?
notes: String?
host: String
port: Int # 默认 22
username: String
authMethod: AuthMethod
proxyJumpID: UUID?
serverAliveInterval: Int # 默认 30 秒
createdAt: Date
updatedAt: Date

密码、私钥口令和 OTP 不属于该结构,而是通过独立的 SecretID 记录访问。

id: UUID
name: String
notes: String?
sshServerID: UUID
forwardingRules: [PortForwardRule]
createdAt: Date
updatedAt: Date
id: UUID
name: String
forwardingMode: ForwardingMode
localAddress: String # 默认 127.0.0.1
localPort: Int
remoteAddress: String # 默认 127.0.0.1
remotePort: Int? # dynamic 模式为 nil
enabled: Bool # 默认 true
notes: String?
.password(String)
.privateKey(path: String, passphrase: String?)
.mfa(password: String, otp: String)

该枚举使用自定义 Codable,以 type 字段作为类型判别符。

值对应能力
local本地转发 -L
remote远程转发 -R
dynamic动态 SOCKS5 -D
host: String
port: Int
username: String
authMethod: AuthMethod

跳板机运行时由 proxyJumpID 解析构造,不作为独立持久化实体。