warp

package
v1.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

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 Disable

func Disable() error

Disable stops the WARP WireGuard interface.

func Enable

func Enable() error

Enable starts the WARP WireGuard interface.

func IsRunning

func IsRunning() bool

IsRunning checks if the WARP interface is active.

func IsSetUp

func IsSetUp() bool

IsSetUp checks if WARP has been configured.

func RefreshRouting

func RefreshRouting(cfg *config.Config) error

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.

func Setup

func Setup(cfg *config.Config, log func(string)) error

Setup registers a WARP account, generates WireGuard config, and creates the systemd service.

func Uninstall

func Uninstall()

Uninstall removes all WARP configuration and services.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL