Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultPort = "22" DefaultIdentityFile = "~/.ssh/id_rsa" DefaultAllowedIP = "0.0.0.0/0" DefaultTimeout = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func EncodeBase64ToHex ¶
EncodeBase64ToHex encodes a base64 string to a hex string as required by WireGuard
Types ¶
type ConfigType ¶
type ConfigType int
const ( ConfigTypeWireGuard ConfigType = iota ConfigTypeTailscale ConfigTypeDirect )
type SshConfig ¶
type SshConfig struct {
// SSH settings
User string // SSH user
HostName string // SSH host to connect to
Port string // SSH port to connect to
IdentityFile string // Path to SSH identity file
HostKey ssh.PublicKey // SSH host key
LocalForward string // Local forward
Timeout time.Duration // SSH connection timeout
}
type TailscaleConfig ¶
type TailscaleConfig struct {
// Tailscale settings
AuthKey string // Tailscale auth key
}
type WireSshConfig ¶
type WireSshConfig struct {
Type ConfigType // Tunnel type
SshConfig SshConfig
WireguardConfig WireguardConfig
TailscaleConfig TailscaleConfig
}
WireSshConfig represents the configuration for a WireGuard, Tailscale, or Direct tunnel.
func LoadConfig ¶
func LoadConfig(host, wireSshConfigFile string) (*WireSshConfig, error)
LoadConfig loads and validates the configuration for the given host from the specified config file. Returns a WireSshConfig or an error if loading or validation fails.
type WireguardConfig ¶
type WireguardConfig struct {
// WireGuard settings
PrivateKey string // WireGuard private key
PublicKey string // WireGuard public key
IPAddress netip.Addr // WireGuard IP address
DNSServer netip.Addr // WireGuard DNS server
AllowedIP string // WireGuard allowed IP
WGServer string // WireGuard server
WGServerIP net.IP // WireGuard server IP
WGPort string // WireGuard port
}
Click to show internal directories.
Click to hide internal directories.