Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Gin as web framework for TS2019 API #656

Merged
merged 33 commits into from Jun 26, 2022
Merged

Drop Gin as web framework for TS2019 API #656

merged 33 commits into from Jun 26, 2022

Conversation

juanfont
Copy link
Owner

Until now, and since the very beginning of Headscale, we have used Gin (https://github.com/gin-gonic/gin) as the web framework to serve the original Tailscale API (TS2019, as opposed to Tailscale API v2 aka. TS2021).

It served (no pun intended) us well. And for many other use cases Gin is great. But while implementing TS2021 I found some weird situations where Gin was flushing or closing connections that where meant to be kept.

This PR moves all the TS2019 endpoints to plain net/http handler functions. It also switches Gin's router to gorilla/mux.

@juanfont juanfont requested a review from kradalby as a code owner June 20, 2022 19:11
app.go Outdated Show resolved Hide resolved
@juanfont juanfont closed this Jun 20, 2022
@juanfont juanfont reopened this Jun 24, 2022
@kradalby
Copy link
Collaborator

Looks good;

  • Gin is still in go.mod, is there a reason why it cant be removed completely? (go mod tidy ?)
  • When changing go.mod, flake.nix must be updated with the new hash of modules (nix build)
  • It looks like golangci-lint is working again ;)

kradalby
kradalby previously approved these changes Jun 26, 2022
@juanfont juanfont merged commit 4a200c3 into main Jun 26, 2022
@juanfont juanfont deleted the abandon-gin branch June 26, 2022 14:01
@06kellyjac
Copy link

Drop Gin as web framework in Headscale in the changelog links to the wrong PR instead of this one :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants