headscale README

The project's README from github.com/juanfont/headscale. As one markdown file: README.md.

headscale logo

ci

An open source, self-hosted implementation of the Tailscale control server.

Join our Discord server for a chat.

Note: Always select the same GitHub tag as the released version you use to ensure you have the correct example configuration. The main branch might contain unreleased changes. The documentation is available for stable and development versions:

What is Tailscale

Tailscale is a modern VPN built on top of Wireguard. It works like an overlay network between the computers of your networks - using NAT traversal.

Everything in Tailscale is Open Source, except the GUI clients for proprietary OS (Windows and macOS/iOS), and the control server.

The control server works as an exchange point of Wireguard public keys for the nodes in the Tailscale network. It 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.

A Tailscale network (tailnet) is private network which Tailscale assigns to a user in terms of private users or an organisation.

Design goal

Headscale aims to implement a self-hosted, open source alternative to the Tailscale control server. Headscale's goal is to provide self-hosters and hobbyists with an open-source server they can use for their projects and labs. It implements a narrow scope, a single Tailscale network (tailnet), suitable for a personal use, or a small open-source organisation.

Supporting Headscale

If you like headscale and find it useful, there is a sponsorship and donation buttons available in the repo.

Features

Please see "Features" in the documentation.

Client OS support

Please see "Client and operating system support" in the documentation.

Running headscale

Please note that we do not support nor encourage the use of reverse proxies and container to run Headscale.

Please have a look at the documentation.

For NixOS users, a module is available in nix/.

Builds from main

Development builds from the main branch are available as container images and binaries. See the development builds documentation for details.

Talks

Disclaimer

This project is not associated with Tailscale Inc.

However, one of the active maintainers for Headscale is employed by Tailscale and he is allowed to spend work hours contributing to the project. Contributions from this maintainer are reviewed by other maintainers.

The maintainers work together on setting the direction for the project. The underlying principle is to serve the community of self-hosters, enthusiasts and hobbyists - while having a sustainable project.

Contributing

Please read the CONTRIBUTING.md file.

Have also a look at our AI_POLICY.md.

Requirements

To contribute to headscale you would need the latest version of Go and Buf (Protobuf generator).

We recommend using Nix to setup a development environment. This can be done with nix develop, which will install the tools and give you a shell. This guarantees that you will have the same dev env as headscale maintainers.

Code style

To ensure we have some consistency with a growing number of contributions, this project has adopted linting and style/formatting rules:

The Go code is linted with golangci-lint and formatted with golines (width 88) and gofumpt. Please configure your editor to run the tools while developing and make sure to run make lint and make fmt before committing any code.

The Proto code is linted with buf and formatted with clang-format.

The docs are formatted with mdformat.

The rest (Markdown, YAML, etc) is formatted with prettier.

Check out the .golangci.yaml and Makefile to see the specific configuration.

Install development tools

Install and activate:

nix develop

Testing and building

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:

make generate

Note: Please check in changes from gen/ in a separate commit to make it easier to review.

To run the tests:

make test

To build the program:

make build

Development workflow

We recommend using Nix for dependency management to ensure you have all required tools. If you prefer to manage dependencies yourself, you can use Make directly:

With Nix (recommended):

nix develop
make test
make build

With your own dependencies:

make test
make build

The Makefile will warn you if any required tools are missing and suggest running nix develop. Run make help to see all available targets.

Contributors

Made with contrib.rocks.

headscale (juanfont/headscale)

Searching Database…

44.7K ·GitHub
这是什么?Headscale 是 Tailscale 控制服务器的开源自托管实现,让你可以搭建自己的、兼容 Tailscale 的私有网络,无需为 Tailscale 的托管服务付费。
它是 Tailscale 应用的替代品,还是只替代其背后的服务器?它只替代控制服务器,也就是负责交换 WireGuard 公钥并分配 IP 地址的后端。连接时,你仍需在设备上安装常规的 Tailscale 客户端应用。
我该怎样让它运行起来?用 Go 从源码构建(推荐通过 `nix develop` 获取匹配的开发环境和 Make 目标),然后按照官方文档配置并运行服务器。
构建和运行它需要安装什么?构建 headscale 需要较新版本的 Go 工具链,以及 Buf(Protobuf 代码生成器)。Nix 可以自动为你配置这些依赖。
能像大多数自托管应用那样,把它放在反向代理后面,用容器运行吗?维护者明确表示,不支持也不鼓励在生产环境中将 Headscale 放在反向代理后面或运行在容器中。
这是为大公司还是为家庭实验室设计的?它面向自托管爱好者和业余玩家,功能范围有限,只支持单个 tailnet,适合个人使用或小型开源组织,不适用于多租户的企业部署。
Headscale 是否得到 Tailscale Inc. 的官方支持?不是。它是一个独立的开源项目。虽然其中一位维护者在 Tailscale 工作,并以该身份参与贡献,但该项目与这家公司并无关联。
什么是 'tailnet'?tailnet 是 Tailscale(以及 Headscale)分配给用户或组织的私有覆盖网络,它通过 NAT 穿透,利用 WireGuard 连接其设备。
能否在稳定版发布前试用未发布的功能?可以。main 分支的开发版本会以容器镜像和二进制文件的形式发布,与稳定版本的文档是分开的。
Tailscale 的托管服务与 Headscale 有什么不同?Tailscale 在 Windows、macOS 和 iOS 上的图形界面客户端以及托管的控制服务器都是专有软件;而 Headscale 则为该控制服务器组件提供了完全开源、可自托管的替代方案。
Creator
juanfont
Size
57.2 MB
Stars
44.7K
Age
6y
Commits · 90 Days