mio

package
v0.0.0-...-a8acacb Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: GPL-3.0 Imports: 22 Imported by: 0

README

Mio runs as root and actually sets the WireGuard configuration using a
combination of shell scripts and the wgctrl module. The main purpose is to
not run Node as root.

Documentation

Overview

Package mio provides a local RPC server to configure WireGuard. Its purpose is to try to reduce the number of programs running with high priviledges.

Index

Constants

This section is empty.

Variables

View Source
var CommandBash string
View Source
var CommandWg string
View Source
var CommandWgQuick string

Functions

func GenToken

func GenToken() ([]byte, string, error)

func Guard

func Guard(h http.Handler) http.Handler

Guard does nothing in linux as the connection is a socket, not via IP.

func Listen

func Listen() (lis net.Listener, addr string, err error)

func Main

func Main() error

Types

type ConfigureDeviceQ

type ConfigureDeviceQ struct {
	Token    []byte // put token here for simplicity
	Name     string
	Config   *wgtypes.Config
	Address  []net.IPNet
	PostUp   string
	PostDown string
}

type ForwardingQ

type ForwardingQ struct {
	Token  []byte // put token here for simplicity
	Type   ForwardingType
	Enable bool
}

type ForwardingType

type ForwardingType uint8
const (
	ForwardingTypeInvalid ForwardingType = iota
	ForwardingTypeIPv4
)

type Mio

type Mio struct {
	// contains filtered or unexported fields
}

func (*Mio) ConfigureDevice

func (sm *Mio) ConfigureDevice(q ConfigureDeviceQ, r *string) error

func (*Mio) Forwarding

func (sm *Mio) Forwarding(q ForwardingQ, r *string) error

func (*Mio) Ping

func (sm *Mio) Ping(q string, r *string) error

func (*Mio) RemoveDevice

func (sm *Mio) RemoveDevice(q RemoveDeviceQ, r *string) error

type RemoveDeviceQ

type RemoveDeviceQ struct {
	Token []byte // put token here for simplicity
	Name  string
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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