tailscale: Add tailssh server

This commit is contained in:
世界
2026-05-28 18:42:58 +08:00
parent 775a05162c
commit f18b01b7fe
31 changed files with 2863 additions and 3 deletions
+25
View File
@@ -29,6 +29,31 @@ type TailscaleEndpointOptions struct {
SystemInterfaceName string `json:"system_interface_name,omitempty"`
SystemInterfaceMTU uint32 `json:"system_interface_mtu,omitempty"`
UDPTimeout UDPTimeoutCompat `json:"udp_timeout,omitempty"`
SSHServer *TailscaleSSHServerOptions `json:"ssh_server,omitempty"`
}
type _TailscaleSSHServerOptions struct {
Enabled bool `json:"enabled,omitempty"`
DisablePTY bool `json:"disable_pty,omitempty"`
DisableSFTP bool `json:"disable_sftp,omitempty"`
DisableForwarding bool `json:"disable_forwarding,omitempty"`
}
type TailscaleSSHServerOptions _TailscaleSSHServerOptions
func (o TailscaleSSHServerOptions) MarshalJSON() ([]byte, error) {
if !o.DisablePTY && !o.DisableSFTP && !o.DisableForwarding {
return json.Marshal(o.Enabled)
}
return json.Marshal(_TailscaleSSHServerOptions(o))
}
func (o *TailscaleSSHServerOptions) UnmarshalJSON(bytes []byte) error {
err := json.Unmarshal(bytes, &o.Enabled)
if err == nil {
return nil
}
return json.UnmarshalDisallowUnknownFields(bytes, (*_TailscaleSSHServerOptions)(o))
}
type TailscaleDNSServerOptions struct {