2021-10-10 12:00:45 +01:00
# headscale
2021-04-24 21:26:38 +00:00
2021-10-10 12:00:45 +01:00
![ci ](https://github.com/juanfont/headscale/actions/workflows/test.yml/badge.svg )
2021-04-24 21:26:38 +00:00
2021-07-03 16:10:22 +02:00
An open source, self-hosted implementation of the Tailscale coordination server.
2020-06-21 11:58:25 +02:00
2021-10-10 12:00:45 +01:00
Join our [Discord ](https://discord.gg/XcQxk2VHjx ) server for a chat.
2021-10-25 19:38:11 +01:00
**Note:** Always select the same GitHub tag as the released version you use to ensure you have the correct example configuration and documentation. The `main` branch might contain unreleased changes.
2021-03-17 21:58:38 +01:00
## Overview
2022-02-17 17:55:40 -08:00
Tailscale is [a modern VPN ](https://tailscale.com/ ) built on top of [Wireguard ](https://www.wireguard.com/ ). It [works like an overlay network ](https://tailscale.com/blog/how-tailscale-works/ ) between the computers of your networks - using [NAT traversal ](https://tailscale.com/blog/how-nat-traversal-works/ ).
2021-03-17 21:58:38 +01:00
2021-05-08 16:56:27 +02:00
Everything in Tailscale is Open Source, except the GUI clients for proprietary OS (Windows and macOS/iOS), and the 'coordination/control server'.
2021-03-17 21:58:38 +01:00
2021-07-03 12:01:19 +02:00
The control server works as an exchange point of Wireguard public keys for the nodes in the Tailscale network. It also assigns the IP addresses of the clients, creates the boundaries between each user, enables sharing machines between users, and exposes the advertised routes of your nodes.
2021-03-17 21:58:38 +01:00
2021-10-21 20:48:29 +02:00
headscale implements this coordination server.
2020-06-21 11:58:25 +02:00
2022-02-13 11:07:45 +00:00
## Support
If you like `headscale` and find it useful, there is sponsorship and donation buttons available in the repo.
If you would like to sponsor features, bugs or prioritisation, reach out to one of the maintainers.
2021-02-24 22:23:36 +01:00
## Status
2021-07-03 12:01:19 +02:00
- [x] Base functionality (nodes can communicate with each other)
2021-02-24 22:23:36 +01:00
- [x] Node registration through the web flow
2021-09-19 12:07:17 +02:00
- [x] Network changes are relayed to the nodes
2021-10-21 20:48:29 +02:00
- [x] Namespaces support (~tailnets in Tailscale.com naming)
2021-07-03 12:01:19 +02:00
- [x] Routing (advertise & accept, including exit nodes)
- [x] Node registration via pre-auth keys (including reusable keys, and ephemeral node support)
2021-09-26 20:47:39 +01:00
- [x] JSON-formatted output
- [x] ACLs
2021-09-26 20:51:07 +01:00
- [x] Taildrop (File Sharing)
2021-09-26 20:47:39 +01:00
- [x] Support for alternative IP ranges in the tailnets (default Tailscale's 100.64.0.0/10)
- [x] DNS (passing DNS servers to nodes)
2021-10-19 18:25:59 +01:00
- [x] Single-Sign-On (via Open ID Connect)
2021-10-19 21:01:36 +02:00
- [x] Share nodes between namespaces
2021-10-04 20:27:45 +02:00
- [x] MagicDNS (see `docs/` )
2021-02-24 22:23:36 +01:00
2021-10-04 14:58:36 +03:00
## Client OS support
2021-10-04 20:27:45 +02:00
| OS | Supports headscale |
| ------- | ----------------------------------------------------------------------------------------------------------------- |
| Linux | Yes |
| OpenBSD | Yes |
| macOS | Yes (see `/apple` on your headscale for more information) |
2022-02-11 08:26:22 +00:00
| Windows | Yes [docs ](./docs/windows-client.md ) |
2021-10-04 14:58:36 +03:00
| Android | [You need to compile the client yourself ](https://github.com/juanfont/headscale/issues/58#issuecomment-885255270 ) |
2021-10-04 20:27:45 +02:00
| iOS | Not yet |
2021-10-04 14:58:36 +03:00
2022-02-17 17:55:40 -08:00
## Roadmap
2021-02-24 22:23:36 +01:00
Suggestions/PRs welcomed!
2020-06-21 11:58:25 +02:00
2021-10-19 21:02:45 +02:00
## Running headscale
2021-10-19 23:22:56 +02:00
Please have a look at the documentation under [`docs/` ](docs/ ).
2021-10-19 21:02:45 +02:00
2021-02-24 22:23:36 +01:00
## Disclaimer
2021-05-08 16:56:27 +02:00
1. We have nothing to do with Tailscale, or Tailscale Inc.
2021-12-24 16:40:18 +01:00
2. The purpose of Headscale is maintaining a working, self-hosted Tailscale control panel.
2021-05-08 14:12:22 +02:00
2021-10-26 20:53:10 +00:00
## Contributing
2021-09-26 20:47:39 +01:00
2021-11-06 07:43:41 +00:00
To contribute to Headscale you would need the lastest version of [Go ](https://golang.org ) and [Buf ](https://buf.build )(Protobuf generator).
2021-08-05 19:19:25 +01:00
2021-11-14 08:08:03 +00:00
### Code style
2022-01-15 16:32:52 +09:00
To ensure we have some consistency with a growing number of contributions, this project has adopted linting and style/formatting rules:
2021-11-14 08:08:03 +00:00
2021-11-14 08:09:33 +00:00
The **Go** code is linted with [`golangci-lint` ](https://golangci-lint.run ) and
formatted with [`golines` ](https://github.com/segmentio/golines ) (width 88) and
2021-11-14 08:08:03 +00:00
[`gofumpt` ](https://github.com/mvdan/gofumpt ).
2021-11-14 08:09:33 +00:00
Please configure your editor to run the tools while developing and make sure to
2021-11-14 08:08:03 +00:00
run `make lint` and `make fmt` before committing any code.
2021-11-14 08:09:33 +00:00
The **Proto** code is linted with [`buf` ](https://docs.buf.build/lint/overview ) and
2021-11-14 08:08:03 +00:00
formatted with [`clang-format` ](https://clang.llvm.org/docs/ClangFormat.html ).
2022-01-15 16:32:52 +09:00
The **rest** (Markdown, YAML, etc) is formatted with [`prettier` ](https://prettier.io ).
2021-11-14 08:08:03 +00:00
Check out the `.golangci.yaml` and `Makefile` to see the specific configuration.
2021-10-26 20:53:10 +00:00
### Install development tools
2021-04-23 22:54:15 -04:00
2021-10-26 20:53:10 +00:00
- Go
- Buf
- Protobuf tools:
2021-04-23 22:54:15 -04:00
2021-11-13 08:11:55 +00:00
```shell
2021-10-27 06:40:39 +00:00
make install-protobuf-plugins
2021-04-23 22:54:15 -04:00
```
2021-10-27 06:40:39 +00:00
### Testing and building
2021-04-23 22:54:15 -04:00
2022-01-15 16:32:52 +09:00
Some parts of the project require the generation of Go code from Protobuf (if changes are made in `proto/` ) and it must be (re-)generated with:
2021-05-22 20:15:29 -04:00
2021-10-26 20:53:10 +00:00
```shell
make generate
2021-10-10 22:52:30 +08:00
```
2021-11-13 08:11:55 +00:00
2021-10-27 06:40:39 +00:00
**Note**: Please check in changes from `gen/` in a separate commit to make it easier to review.
2021-10-10 22:52:30 +08:00
2021-10-26 20:53:10 +00:00
To run the tests:
2021-10-10 22:52:30 +08:00
2021-10-26 20:53:10 +00:00
```shell
make test
2021-04-23 22:54:15 -04:00
```
2021-10-26 20:53:10 +00:00
To build the program:
2021-04-23 22:54:15 -04:00
2021-10-26 20:53:10 +00:00
```shell
make build
2021-04-23 22:54:15 -04:00
```
2021-05-08 14:12:22 +02:00
2021-10-21 20:36:26 +02:00
## Contributors
2021-10-19 20:59:33 +02:00
2021-10-21 21:38:02 +00:00
< table >
< tr >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/juanfont >
< img src = https://avatars.githubusercontent.com/u/181059?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Juan Font / >
< br / >
< sub style = "font-size:14px" > < b > Juan Font< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/kradalby >
< img src = https://avatars.githubusercontent.com/u/98431?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Kristoffer Dalby / >
< br / >
< sub style = "font-size:14px" > < b > Kristoffer Dalby< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/cure >
< img src = https://avatars.githubusercontent.com/u/149135?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Ward Vandewege / >
< br / >
< sub style = "font-size:14px" > < b > Ward Vandewege< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/ohdearaugustin >
< img src = https://avatars.githubusercontent.com/u/14001491?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = ohdearaugustin/ >
< br / >
< sub style = "font-size:14px" > < b > ohdearaugustin< / b > < / sub >
< / a >
< / td >
2021-10-31 09:34:07 +00:00
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/unreality >
< img src = https://avatars.githubusercontent.com/u/352522?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = unreality/ >
< br / >
< sub style = "font-size:14px" > < b > unreality< / b > < / sub >
< / a >
< / td >
2021-10-21 21:38:02 +00:00
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/qbit >
< img src = https://avatars.githubusercontent.com/u/68368?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Aaron Bieber / >
< br / >
< sub style = "font-size:14px" > < b > Aaron Bieber< / b > < / sub >
< / a >
< / td >
2021-10-31 09:34:07 +00:00
< / tr >
< tr >
2021-10-21 21:38:02 +00:00
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/ptman >
< img src = https://avatars.githubusercontent.com/u/24669?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Paul Tötterman / >
< br / >
< sub style = "font-size:14px" > < b > Paul Tötterman< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/cmars >
< img src = https://avatars.githubusercontent.com/u/23741?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Casey Marshall / >
< br / >
< sub style = "font-size:14px" > < b > Casey Marshall< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/SilverBut >
< img src = https://avatars.githubusercontent.com/u/6560655?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Silver Bullet / >
< br / >
< sub style = "font-size:14px" > < b > Silver Bullet< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/t56k >
< img src = https://avatars.githubusercontent.com/u/12165422?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = thomas/ >
< br / >
< sub style = "font-size:14px" > < b > thomas< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/awoimbee >
< img src = https://avatars.githubusercontent.com/u/22431493?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Arthur Woimbée / >
< br / >
< sub style = "font-size:14px" > < b > Arthur Woimbée< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/fkr >
< img src = https://avatars.githubusercontent.com/u/51063?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Felix Kronlage-Dammers / >
< br / >
< sub style = "font-size:14px" > < b > Felix Kronlage-Dammers< / b > < / sub >
< / a >
< / td >
2021-10-31 09:34:07 +00:00
< / tr >
< tr >
2021-10-21 21:38:02 +00:00
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/felixonmars >
< img src = https://avatars.githubusercontent.com/u/1006477?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Felix Yan / >
< br / >
< sub style = "font-size:14px" > < b > Felix Yan< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/shaananc >
< img src = https://avatars.githubusercontent.com/u/2287839?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Shaanan Cohney / >
< br / >
< sub style = "font-size:14px" > < b > Shaanan Cohney< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/Teteros >
< img src = https://avatars.githubusercontent.com/u/5067989?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Teteros/ >
< br / >
< sub style = "font-size:14px" > < b > Teteros< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/gitter-badger >
< img src = https://avatars.githubusercontent.com/u/8518239?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = The Gitter Badger / >
< br / >
< sub style = "font-size:14px" > < b > The Gitter Badger< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/tianon >
< img src = https://avatars.githubusercontent.com/u/161631?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Tianon Gravi / >
< br / >
< sub style = "font-size:14px" > < b > Tianon Gravi< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/woudsma >
< img src = https://avatars.githubusercontent.com/u/6162978?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Tjerk Woudsma / >
< br / >
< sub style = "font-size:14px" > < b > Tjerk Woudsma< / b > < / sub >
< / a >
< / td >
2021-10-31 09:34:07 +00:00
< / tr >
< tr >
2021-10-21 21:38:02 +00:00
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/zekker6 >
< img src = https://avatars.githubusercontent.com/u/1367798?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = Zakhar Bessarab / >
< br / >
< sub style = "font-size:14px" > < b > Zakhar Bessarab< / b > < / sub >
< / a >
< / td >
2021-10-22 06:58:20 +00:00
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/derelm >
< img src = https://avatars.githubusercontent.com/u/465155?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = derelm/ >
< br / >
< sub style = "font-size:14px" > < b > derelm< / b > < / sub >
< / a >
< / td >
2021-10-21 21:38:02 +00:00
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/ignoramous >
< img src = https://avatars.githubusercontent.com/u/852289?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = ignoramous/ >
< br / >
< sub style = "font-size:14px" > < b > ignoramous< / b > < / sub >
< / a >
< / td >
< td align = "center" style = "word-wrap: break-word; width: 150.0; height: 150.0" >
< a href = https://github.com/xpzouying >
< img src = https://avatars.githubusercontent.com/u/3946563?v=4 width = "100;" style = "border-radius:50%;align-items:center;justify-content:center;overflow:hidden;padding-top:10px" alt = zy/ >
< br / >
< sub style = "font-size:14px" > < b > zy< / b > < / sub >
< / a >
< / td >
< / tr >
< / table >