An open API service indexing awesome lists of open source software.

https://github.com/atsevan/wireguard-grpc

Wireguard configuration over gRPC without external dependencies.
https://github.com/atsevan/wireguard-grpc

golang grpc wireguard

Last synced: 12 months ago
JSON representation

Wireguard configuration over gRPC without external dependencies.

Awesome Lists containing this project

README

          

# Wireguard gRPC Service

![Wireguard-grpc logo](img/logo.png)

Wireguard gRPC aimed at managing Wireguard configurations.
The service gives a control over Wireguard setup via gRPC using native client without parsing output of wireguard-tools like `wg` and `wg-quick`.

Client example is at [client/main.go](client/main.go)

# Run with Docker
## Run
[Note] `docker run` requires NET_ADMIN docker capability

```
$ docker run -it --cap-add=NET_ADMIN -p 8080 docker.io/library/wireguard-grpc --insecure --host 0.0.0.0
```

## Build a docker image
```
$ make build-docker
```

# Build & Run locally

Run the server with mTLS
```
make cert # generate localhost certs for mutual authentication (mTLS)
make build # build a binary
sudo ./wireguard-grpc # run the server
```

Run the client
```
go run client/main.go
```

# Development

Run without TLS
```
# go run server/main.go -insecure # run the server w/o TLS
```

```
$ go run client/main.go -insecure # run the client w/o TLS
```

## Explore API with `grpcurl`
```
$ grpcurl -plaintext localhost:8080 describe WireGuard
WireGuard is a service:
service WireGuard {
rpc ConfigureDevice ( .ConfigureDeviceRequest ) returns ( .ConfigureDeviceResponse );
rpc Device ( .DeviceRequest ) returns ( .DeviceResponse );
rpc Devices ( .DevicesRequest ) returns ( .DevicesResponse );
}
```

### Configure wireguard device and add a peer
```
$ PEER_KEY=$(wg genkey)
$ grpcurl -plaintext -d @ localhost:8080 WireGuard/ConfigureDevice <