Documentation
¶
Index ¶
Constants ¶
View Source
const ( WarpDir = "/etc/slipgate/warp" WarpConf = "/etc/slipgate/warp/wg0.conf" ProfileFile = "/etc/slipgate/warp/wgcf-profile.conf" // legacy wgcf profile ServiceName = "slipgate-warp" RouteTable = 200 // SocksUser is a dedicated system user for the SOCKS5 proxy so its // outbound traffic can be routed through WARP independently of the // tunnel processes that also run as config.SystemUser. SocksUser = "slipgate-socks" // NaiveUser is a dedicated system user for the Caddy/NaiveProxy // process so its forward-proxy traffic can be routed through WARP. NaiveUser = "slipgate-naive" )
View Source
const (
AccountJSON = "/etc/slipgate/warp/account.json"
)
Variables ¶
This section is empty.
Functions ¶
func RefreshRouting ¶
RefreshRouting regenerates the wg0.conf with current user UIDs and restarts if running.
func RemoveUsers ¶
func RemoveUsers()
RemoveUsers removes the dedicated SOCKS and NaiveProxy system users created for WARP routing.
func SaveAccount ¶ added in v1.5.0
func SaveAccount(account *WarpAccount) error
SaveAccount writes the WARP account to disk.
Types ¶
type WarpAccount ¶ added in v1.5.0
type WarpAccount struct {
DeviceID string `json:"device_id"`
Token string `json:"token"`
PrivateKey string `json:"private_key"` // base64 WireGuard private key
PublicKey string `json:"public_key"` // base64 WireGuard public key
PeerKey string `json:"peer_key"` // base64 peer (Cloudflare) public key
Endpoint string `json:"endpoint"` // peer endpoint (host:port)
Addresses []string `json:"addresses"` // interface addresses (IPv4, IPv6)
ClientID string `json:"client_id"` // base64 client_id from WARP API
Reserved [3]byte `json:"reserved"` // decoded reserved bytes from client_id
}
WarpAccount holds all WARP registration data.
func LoadAccount ¶ added in v1.5.0
func LoadAccount() (*WarpAccount, error)
LoadAccount reads the WARP account from disk.
Click to show internal directories.
Click to hide internal directories.