From 1d81333685d06d15b93ef693970899ad784da7d6 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Sun, 3 Oct 2021 12:06:50 -0400 Subject: [PATCH 1/6] Make sure that goreleaser uses the appropriate version string when building the headscale executable. --- .goreleaser.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index fd25563c..7b1ea605 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -19,7 +19,7 @@ builds: flags: - -mod=readonly ldflags: - - -s -w -X main.version={{.Version}} + - -s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=v{{.Version}} - id: linux-armhf main: ./cmd/headscale/headscale.go mod_timestamp: '{{ .CommitTimestamp }}' @@ -39,7 +39,7 @@ builds: flags: - -mod=readonly ldflags: - - -s -w -X main.version={{.Version}} + - -s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=v{{.Version}} - id: linux-amd64 @@ -54,6 +54,8 @@ builds: - 7 main: ./cmd/headscale/headscale.go mod_timestamp: '{{ .CommitTimestamp }}' + ldflags: + - -s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=v{{.Version}} archives: - id: golang-cross From 8fa0fe65bacc000eac3a876e0dece01e42be55b4 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Sun, 3 Oct 2021 12:26:38 -0600 Subject: [PATCH 2/6] Add the ability to specify registration ACME email and ACME URL. --- app.go | 8 ++++++++ cmd/headscale/cli/utils.go | 3 +++ config.json.postgres.example | 2 ++ config.json.sqlite.example | 2 ++ 4 files changed, 15 insertions(+) diff --git a/app.go b/app.go index 8be137cf..1e6b7bcf 100644 --- a/app.go +++ b/app.go @@ -12,6 +12,7 @@ import ( "github.com/rs/zerolog/log" "github.com/gin-gonic/gin" + "golang.org/x/crypto/acme" "golang.org/x/crypto/acme/autocert" "gorm.io/gorm" "inet.af/netaddr" @@ -44,6 +45,9 @@ type Config struct { TLSCertPath string TLSKeyPath string + ACMEURL string + ACMEEmail string + DNSConfig *tailcfg.DNSConfig } @@ -195,6 +199,10 @@ func (h *Headscale) Serve() error { Prompt: autocert.AcceptTOS, HostPolicy: autocert.HostWhitelist(h.cfg.TLSLetsEncryptHostname), Cache: autocert.DirCache(h.cfg.TLSLetsEncryptCacheDir), + Client: &acme.Client{ + DirectoryURL: h.cfg.ACMEURL, + }, + Email: h.cfg.ACMEEmail, } s.TLSConfig = m.TLSConfig() diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index 7ada6693..ac739a02 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -169,6 +169,9 @@ func getHeadscaleApp() (*headscale.Headscale, error) { TLSCertPath: absPath(viper.GetString("tls_cert_path")), TLSKeyPath: absPath(viper.GetString("tls_key_path")), + ACMEEmail: absPath(viper.GetString("acme_email")), + ACMEURL: absPath(viper.GetString("acme_url")), + DNSConfig: GetDNSConfig(), } diff --git a/config.json.postgres.example b/config.json.postgres.example index aba72063..e9118204 100644 --- a/config.json.postgres.example +++ b/config.json.postgres.example @@ -10,6 +10,8 @@ "db_name": "headscale", "db_user": "foo", "db_pass": "bar", + "acme_url": "https://acme-v02.api.letsencrypt.org/directory", + "acme_email": "", "tls_letsencrypt_hostname": "", "tls_letsencrypt_listen": ":http", "tls_letsencrypt_cache_dir": ".cache", diff --git a/config.json.sqlite.example b/config.json.sqlite.example index b22e5ace..5afa450f 100644 --- a/config.json.sqlite.example +++ b/config.json.sqlite.example @@ -6,6 +6,8 @@ "ephemeral_node_inactivity_timeout": "30m", "db_type": "sqlite3", "db_path": "db.sqlite", + "acme_url": "https://acme-v02.api.letsencrypt.org/directory", + "acme_email": "", "tls_letsencrypt_hostname": "", "tls_letsencrypt_listen": ":http", "tls_letsencrypt_cache_dir": ".cache", From 817cc1e567624f365f014bd31b985b509fa358b5 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Sun, 3 Oct 2021 14:02:44 -0600 Subject: [PATCH 3/6] these are not files! --- cmd/headscale/cli/utils.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index ac739a02..ca09bf51 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -169,8 +169,8 @@ func getHeadscaleApp() (*headscale.Headscale, error) { TLSCertPath: absPath(viper.GetString("tls_cert_path")), TLSKeyPath: absPath(viper.GetString("tls_key_path")), - ACMEEmail: absPath(viper.GetString("acme_email")), - ACMEURL: absPath(viper.GetString("acme_url")), + ACMEEmail: viper.GetString("acme_email"), + ACMEURL: viper.GetString("acme_url"), DNSConfig: GetDNSConfig(), } From 566c2bc1fb1e73a84c85f147c8dc39994a8e8f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=C3=B6tterman?= Date: Mon, 4 Oct 2021 14:58:36 +0300 Subject: [PATCH 4/6] Document client OS support in a table --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index 45c648ac..766e9465 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,16 @@ Headscale implements this coordination server. - [x] Share nodes between ~~users~~ namespaces - [ ] MagicDNS / Smart DNS +## Client OS support + +| OS | Supports headscale | +| --- | --- | +| Linux | Yes | +| macOS | Yes | +| Windows | Yes | +| Android | [You need to compile the client yourself](https://github.com/juanfont/headscale/issues/58#issuecomment-885255270) | +| iOS | Not yet | + ## Roadmap 🤷 Suggestions/PRs welcomed! From fcc6991d627c27ba56d8a88e4965c9e0118dda15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=C3=B6tterman?= Date: Mon, 4 Oct 2021 17:23:31 +0300 Subject: [PATCH 5/6] Update README.md Co-authored-by: Kristoffer Dalby --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 766e9465..5c3cc54d 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Headscale implements this coordination server. | OS | Supports headscale | | --- | --- | | Linux | Yes | +| OpenBSD | Yes | | macOS | Yes | | Windows | Yes | | Android | [You need to compile the client yourself](https://github.com/juanfont/headscale/issues/58#issuecomment-885255270) | From ed0b31d0727cccd1290dff3299f3bfee910d4ef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20T=C3=B6tterman?= Date: Mon, 4 Oct 2021 17:23:38 +0300 Subject: [PATCH 6/6] Update README.md Co-authored-by: Kristoffer Dalby --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5c3cc54d..5f691a6c 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Headscale implements this coordination server. | --- | --- | | Linux | Yes | | OpenBSD | Yes | -| macOS | Yes | +| macOS | Yes (see `/apple` on your headscale for more information) | | Windows | Yes | | Android | [You need to compile the client yourself](https://github.com/juanfont/headscale/issues/58#issuecomment-885255270) | | iOS | Not yet |