[PR #204] [MERGED] Initial work preparing for API/gRPC #1319

Closed
opened 2025-12-29 02:29:40 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/juanfont/headscale/pull/204
Author: @kradalby
Created: 10/26/2021
Status: Merged
Merged: 10/28/2021
Merged by: @kradalby

Base: mainHead: api-playground


📝 Commits (10+)

  • b096a2e Create an initial gRPC service
  • a9da7c8 Update go.mod
  • caa4d33 Add an initial grpcv1 service (implementing the proto generated service)
  • 2f045b2 Refactor tls and wire up grpc, grpc gateway/api
  • b8c89cd Add readme and makefile entry about code generation
  • 11d9875 Ignore generated files for docker
  • 6e76494 Add grpc step to dockerfile
  • 8f2ef6a Prepare for checking in generated code
  • d426577 Check in generated code
  • 2d92719 Dont try to generate code on every make build

📊 Changes

19 files changed (+1626 additions, -48 deletions)

View changed files

📝 .dockerignore (+0 -1)
📝 .github/workflows/lint.yml (+0 -19)
.golangci.yaml (+7 -0)
📝 Dockerfile (+4 -2)
📝 Makefile (+11 -2)
📝 README.md (+34 -0)
📝 app.go (+105 -22)
buf.gen.yaml (+21 -0)
gen/go/v1/headscale.pb.go (+702 -0)
gen/go/v1/headscale.pb.gw.go (+185 -0)
gen/go/v1/headscale_grpc.pb.go (+101 -0)
gen/openapiv2/v1/headscale.swagger.json (+210 -0)
📝 go.mod (+9 -1)
📝 go.sum (+84 -1)
grpcv1.go (+34 -0)
proto/buf.lock (+24 -0)
proto/buf.yaml (+12 -0)
proto/v1/headscale.proto (+71 -0)
tools.go (+12 -0)

📄 Description

This PR starts the work on preparing for generating an API with Protobuf for HTTP and gRPC.

The idea is that this can be used for many things, but most importantly:

  • API allowing users to interact
  • CLI can run away from the server machine/not comm via DB
  • Web UI
  • Terraform?

I need help testing that the TLS setup is still working as intended after moving it, @cure could you have a look?

Please note: This PR does not check in generated code, to compile locally, you need run make generate and follow the new steps in the README.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/juanfont/headscale/pull/204 **Author:** [@kradalby](https://github.com/kradalby) **Created:** 10/26/2021 **Status:** ✅ Merged **Merged:** 10/28/2021 **Merged by:** [@kradalby](https://github.com/kradalby) **Base:** `main` ← **Head:** `api-playground` --- ### 📝 Commits (10+) - [`b096a2e`](https://github.com/juanfont/headscale/commit/b096a2e7e50b4eca45caabeacc94a3a9fb8b9191) Create an initial gRPC service - [`a9da7c8`](https://github.com/juanfont/headscale/commit/a9da7c8fd9e59c4320fe4a2d2fc7a7406ba0f59f) Update go.mod - [`caa4d33`](https://github.com/juanfont/headscale/commit/caa4d33cbd1d3db42c21fd59ca72b3f469f41b3e) Add an initial grpcv1 service (implementing the proto generated service) - [`2f045b2`](https://github.com/juanfont/headscale/commit/2f045b20fbaf630d6bbeb0c28ad62856d014653a) Refactor tls and wire up grpc, grpc gateway/api - [`b8c89cd`](https://github.com/juanfont/headscale/commit/b8c89cd63ca413bcce3a217779d8fb2f7aabc62a) Add readme and makefile entry about code generation - [`11d9875`](https://github.com/juanfont/headscale/commit/11d987549fb0d234e1695325d9b27c8e15595386) Ignore generated files for docker - [`6e76494`](https://github.com/juanfont/headscale/commit/6e764942a2c084e803c26ad749b0b384cc86e0e0) Add grpc step to dockerfile - [`8f2ef6a`](https://github.com/juanfont/headscale/commit/8f2ef6a57de373cdeb5fb2236dbfd233bb57a15f) Prepare for checking in generated code - [`d426577`](https://github.com/juanfont/headscale/commit/d4265779ef81fb083fb97ccf73e5b74e3601b2f4) Check in generated code - [`2d92719`](https://github.com/juanfont/headscale/commit/2d9271909526e0ccdef9a750e673e34e9b3c68e3) Dont try to generate code on every make build ### 📊 Changes **19 files changed** (+1626 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `.dockerignore` (+0 -1) 📝 `.github/workflows/lint.yml` (+0 -19) ➕ `.golangci.yaml` (+7 -0) 📝 `Dockerfile` (+4 -2) 📝 `Makefile` (+11 -2) 📝 `README.md` (+34 -0) 📝 `app.go` (+105 -22) ➕ `buf.gen.yaml` (+21 -0) ➕ `gen/go/v1/headscale.pb.go` (+702 -0) ➕ `gen/go/v1/headscale.pb.gw.go` (+185 -0) ➕ `gen/go/v1/headscale_grpc.pb.go` (+101 -0) ➕ `gen/openapiv2/v1/headscale.swagger.json` (+210 -0) 📝 `go.mod` (+9 -1) 📝 `go.sum` (+84 -1) ➕ `grpcv1.go` (+34 -0) ➕ `proto/buf.lock` (+24 -0) ➕ `proto/buf.yaml` (+12 -0) ➕ `proto/v1/headscale.proto` (+71 -0) ➕ `tools.go` (+12 -0) </details> ### 📄 Description This PR starts the work on preparing for generating an API with Protobuf for HTTP and gRPC. The idea is that this can be used for many things, but most importantly: - API allowing users to interact - CLI can run away from the server machine/not comm via DB - Web UI - Terraform? I need help testing that the TLS setup is still working as intended after moving it, @cure could you have a look? Please note: This PR does _not_ check in generated code, to compile locally, you need run `make generate` and follow the new steps in the README. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 02:29:40 +01:00
adam closed this issue 2025-12-29 02:29:40 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/headscale#1319