数据模型
SSHServerConfiguration
Section titled “SSHServerConfiguration”id: UUIDname: Stringgroup: String?notes: String?host: Stringport: Int # 默认 22username: StringauthMethod: AuthMethodproxyJumpID: UUID?serverAliveInterval: Int # 默认 30 秒createdAt: DateupdatedAt: Date密码、私钥口令和 OTP 不属于该结构,而是通过独立的 SecretID 记录访问。
TunnelConfiguration
Section titled “TunnelConfiguration”id: UUIDname: Stringnotes: String?sshServerID: UUIDforwardingRules: [PortForwardRule]createdAt: DateupdatedAt: DatePortForwardRule
Section titled “PortForwardRule”id: UUIDname: StringforwardingMode: ForwardingModelocalAddress: String # 默认 127.0.0.1localPort: IntremoteAddress: String # 默认 127.0.0.1remotePort: Int? # dynamic 模式为 nilenabled: Bool # 默认 truenotes: String?AuthMethod
Section titled “AuthMethod”.password(String).privateKey(path: String, passphrase: String?).mfa(password: String, otp: String)该枚举使用自定义 Codable,以 type 字段作为类型判别符。
ForwardingMode
Section titled “ForwardingMode”| 值 | 对应能力 |
|---|---|
local | 本地转发 -L |
remote | 远程转发 -R |
dynamic | 动态 SOCKS5 -D |
ProxyJumpConfig
Section titled “ProxyJumpConfig”host: Stringport: Intusername: StringauthMethod: AuthMethod跳板机运行时由 proxyJumpID 解析构造,不作为独立持久化实体。