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.
- Host: GitHub
- URL: https://github.com/atsevan/wireguard-grpc
- Owner: atsevan
- License: apache-2.0
- Created: 2023-09-03T20:55:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-04T18:15:35.000Z (about 1 year ago)
- Last Synced: 2025-03-04T19:24:38.984Z (about 1 year ago)
- Topics: golang, grpc, wireguard
- Language: Go
- Homepage:
- Size: 7.28 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Wireguard gRPC Service

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 <