Compare commits

...

4 Commits

Author SHA1 Message Date
Juan Font Alonso 27e97cbd09 Use crosscompiling and enable CGO in goreleaser 2021-06-16 19:24:30 +02:00
Juan Font Alonso 39550e262c Improved readme 2021-06-16 19:05:30 +02:00
Juan Font cfef55447f Fix CI badge 2021-06-15 00:06:03 +02:00
Juan Font 9c276f33bd Change the README to include the new releases 2021-06-14 22:21:54 +02:00
2 changed files with 56 additions and 22 deletions
+48 -11
View File
@@ -4,29 +4,66 @@ before:
hooks:
- go mod tidy
builds:
- env:
- CGO_ENABLED=0
- id: darwin-amd64
main: ./cmd/headscale/headscale.go
mod_timestamp: '{{ .CommitTimestamp }}'
goos:
- linux
- windows
- darwin
goarch:
- amd64
env:
- PKG_CONFIG_SYSROOT_DIR=/sysroot/macos/amd64
- PKG_CONFIG_PATH=/sysroot/macos/amd64/usr/local/lib/pkgconfig
- CC=o64-clang
- CXX=o64-clang++
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}}
- id: linux-armhf
main: ./cmd/headscale/headscale.go
mod_timestamp: '{{ .CommitTimestamp }}'
goos:
- linux
goarch:
- arm
- arm64
goarm:
- 7
env:
- CC=arm-linux-gnueabihf-gcc
- CXX=arm-linux-gnueabihf-g++
- CGO_FLAGS=--sysroot=/sysroot/linux/armhf
- CGO_LDFLAGS=--sysroot=/sysroot/linux/armhf
- PKG_CONFIG_SYSROOT_DIR=/sysroot/linux/armhf
- PKG_CONFIG_PATH=/sysroot/linux/armhf/opt/vc/lib/pkgconfig:/sysroot/linux/armhf/usr/lib/arm-linux-gnueabihf/pkgconfig:/sysroot/linux/armhf/usr/lib/pkgconfig:/sysroot/linux/armhf/usr/local/lib/pkgconfig
flags:
- -mod=readonly
ldflags:
- -s -w -X main.version={{.Version}}
- id: linux-amd64
env:
- CGO_ENABLED=1
goos:
- linux
goarch:
- amd64
goarm:
- 6
- 7
main: ./cmd/headscale/headscale.go
mod_timestamp: '{{ .CommitTimestamp }}'
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
amd64: x86_64
- id: golang-cross
builds:
- darwin-amd64
- linux-armhf
- linux-amd64
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
format: zip
# wrap_in_directory: true
checksum:
name_template: 'checksums.txt'
+8 -11
View File
@@ -1,6 +1,6 @@
# Headscale
[![Join the chat at https://gitter.im/headscale-dev/community](https://badges.gitter.im/headscale-dev/community.svg)](https://gitter.im/headscale-dev/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ![ci](https://github.com/juanfont/headscale/actions/workflows/ci.yml/badge.svg)
[![Join the chat at https://gitter.im/headscale-dev/community](https://badges.gitter.im/headscale-dev/community.svg)](https://gitter.im/headscale-dev/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) ![ci](https://github.com/juanfont/headscale/actions/workflows/test.yml/badge.svg)
An open source implementation of the Tailscale coordination server.
@@ -39,10 +39,8 @@ Suggestions/PRs welcomed!
## Running it
1. Compile the headscale binary
```shell
make
```
1. Download the Headscale binary https://github.com/juanfont/headscale/releases, and place it somewhere in your PATH
2. (Optional, you can also use SQLite) Get yourself a PostgreSQL DB running
@@ -63,14 +61,14 @@ Suggestions/PRs welcomed!
cp config.json.sqlite.example config.json
```
4. Create a namespace (equivalent to a user in tailscale.com)
4. Create a namespace (a namespace is a 'tailnet', a group of Tailscale nodes that can talk to each other)
```shell
./headscale namespace create myfirstnamespace
headscale namespace create myfirstnamespace
```
5. Run the server
```shell
./headscale serve
headscale serve
```
6. Add your first machine
@@ -82,14 +80,14 @@ Suggestions/PRs welcomed!
8. In the server, register your machine to a namespace with the CLI
```shell
./headscale -n myfirstnamespace node register YOURMACHINEKEY
headscale -n myfirstnamespace node register YOURMACHINEKEY
```
Alternatively, you can use Auth Keys to register your machines:
1. Create an authkey
```shell
./headscale -n myfirstnamespace preauthkey create --reusable --expiration 24h
headscale -n myfirstnamespace preauthkey create --reusable --expiration 24h
```
2. Use the authkey from your machine to register it
@@ -162,7 +160,6 @@ To get a certificate automatically via [Let's Encrypt](https://letsencrypt.org/)
1. We have nothing to do with Tailscale, or Tailscale Inc.
2. The purpose of writing this was to learn how Tailscale works.
3. ~~I don't use Headscale myself.~~