{"id":16304753,"url":"https://github.com/moznion/wiregarden","last_synced_at":"2025-03-16T13:31:51.637Z","repository":{"id":39640487,"uuid":"341949624","full_name":"moznion/wiregarden","owner":"moznion","description":"A broker daemon to provision the WireGuard peers over gRPC.","archived":false,"fork":false,"pushed_at":"2025-03-14T13:57:10.000Z","size":531,"stargazers_count":10,"open_issues_count":11,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T14:36:29.799Z","etag":null,"topics":["golang","grpc","wireguard"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moznion.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-24T15:44:33.000Z","updated_at":"2022-09-09T09:43:52.000Z","dependencies_parsed_at":"2023-01-21T23:16:51.346Z","dependency_job_id":"f156889a-1c6a-4030-b793-c5b7bf3fb835","html_url":"https://github.com/moznion/wiregarden","commit_stats":{"total_commits":150,"total_committers":4,"mean_commits":37.5,"dds":0.3533333333333334,"last_synced_commit":"c57bb01ecc5086dad8991371692de6a419498d0a"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fwiregarden","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fwiregarden/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fwiregarden/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moznion%2Fwiregarden/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moznion","download_url":"https://codeload.github.com/moznion/wiregarden/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243818171,"owners_count":20352629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","grpc","wireguard"],"created_at":"2024-10-10T21:04:43.054Z","updated_at":"2025-03-16T13:31:51.136Z","avatar_url":"https://github.com/moznion.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wiregarden [![Go Reference](https://pkg.go.dev/badge/github.com/moznion/wiregarden.svg)](https://pkg.go.dev/github.com/moznion/wiregarden) [![Check](https://github.com/moznion/wiregarden/actions/workflows/check.yml/badge.svg)](https://github.com/moznion/wiregarden/actions/workflows/check.yml)\n\nA broker daemon to provision the [WireGuard](https://www.wireguard.com/) peers over [gRPC](https://grpc.io/).\n\n## Usage\n\n### gRPC Server\n\n```\n$ wiregarden-server --port $PORT\n```\n\nNote: if you faced like `operation not permitted` error, please run the server by the legit user.\n\n### Client\n\nSee the example: [examples/wiregarden-client](https://github.com/moznion/wiregarden/tree/main/examples/wiregarden-client)\n\nThe following code is a simple example to retrieve peers of `wg0` device.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/moznion/wiregarden/grpc/messages\"\n\t\"google.golang.org/grpc\"\n\t\"google.golang.org/grpc/credentials/insecure\"\n)\n\nfunc main() {\n\tconn, err := grpc.Dial(\"127.0.0.1:54321\", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithBlock())\n\tif err != nil {\n\t\tlog.Fatalf(\"did not connect: %v\", err)\n\t}\n\tdefer func() {\n\t\t_ = conn.Close()\n\t}()\n\tpeersClient := messages.NewPeersClient(conn)\n\n\tresp, err := peersClient.GetPeers(context.Background(), \u0026messages.GetPeersRequest{\n\t\tDeviceName: \"wg0\",\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Printf(\"%#v\\n\", resp.Peers)\n}\n```\n\n## Features\n\nCurrently, it supports the following features:\n\n- GetDevices\n- GetPeers\n- RegisterPeers\n- DeletePeers\n\n## Hooks - **EXPERIMENTAL FEATURE**\n\nIt provides \"hook\" mechanism by the following interfaces:\n\n- [handlers.PeersRegistrationHook](https://pkg.go.dev/github.com/moznion/wiregarden/grpc/handlers#PeersRegistrationHook) for `RegisterPeers`\n- [handlers.PeersDeletionHook](https://pkg.go.dev/github.com/moznion/wiregarden/grpc/handlers#PeersDeletionHook) for `DeletePeers`\n\nIf you'd like to do the hook(s) on any operations, please pass the implementation(s) of the interface to [handlers.Peers](https://pkg.go.dev/github.com/moznion/wiregarden/grpc/handlers#Peers) struct.\n\nNote: currently it doesn't provide a way to register the hooks by the default `wiregarden-server` command. If you'd like to run the server with the hooks, please make your own server launcher based on the [cmd/wiregarden-server/main.go](./cmd/wiregarden-server/main.go).\n\nAnd, `RegisterPeersRequest.HooksPayload []byte` and `DeletePeersRequest.HooksPayload []byte` are the extension properties for each hook.\n\n## Logging\n\nInternally, this application / library uses [rs/zerolog](https://github.com/rs/zerolog) as a logger. You can configure the logger according to the manner of the zerolog. Please refer to the document of that.\n\n## gRPC Library\n\nIt provides the wiregarden gRPC library for Java. Please refer to [this page](./ext/lib/java).\n\n## Development Guide\n\n### Pre-requirements\n\n- Docker\n\n### How to build a server binary\n\n```\n$ make build GOOS=linux GOARCH=amd64\n```\n\nPlease change the `$GOOS` and `GOARCH` to your desired ones.\n\n### How to generate protobuf files\n\n#### Preparation\n\n```sh\n$ make container4protogen\n```\n\n#### Generate code\n\n```sh\n$ make proto\n```\n\n### E2E Testing\n\nIf you'd like to run the E2E tests, please set the environment value `E2E_TEST` with the non-empty value.\n\n#### Build a container image for E2E testing\n\n```\n$ make e2e-docker-container\n```\n\n#### Push a container image to GitHub Docker Registry\n\n```\n$ make e2e-docker-push DOCKER_USER=${GITHUB_USERNAME} DOCKER_PSWD_FILE=/path/to/your/github/token/file\n```\n\n## Author\n\nmoznion (\u003cmoznion@mail.moznion.net\u003e)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fwiregarden","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoznion%2Fwiregarden","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoznion%2Fwiregarden/lists"}