diff --git a/cmd/headscale/cli/root.go b/cmd/headscale/cli/root.go index 270ca555..2c28c584 100644 --- a/cmd/headscale/cli/root.go +++ b/cmd/headscale/cli/root.go @@ -28,12 +28,12 @@ func initConfig() { if cfgFile != "" { err := headscale.LoadConfig(cfgFile, true) if err != nil { - log.Fatal().Caller().Err(err) + log.Fatal().Caller().Err(err).Msgf("Error loading config file %s", cfgFile) } } else { err := headscale.LoadConfig("", false) if err != nil { - log.Fatal().Caller().Err(err) + log.Fatal().Caller().Err(err).Msgf("Error loading config") } } diff --git a/config.go b/config.go index a792bab9..99e7a4cf 100644 --- a/config.go +++ b/config.go @@ -184,6 +184,10 @@ func LoadConfig(path string, isFile bool) error { errorText += "Fatal config error: set either tls_letsencrypt_hostname or tls_cert_path/tls_key_path, not both\n" } + if !viper.IsSet("noise_private_key_path") { + errorText += "Fatal config error: headscale now requires a new `noise_private_key_path` field in the config file for the Tailscale v2 protocol\n" + } + if (viper.GetString("tls_letsencrypt_hostname") != "") && (viper.GetString("tls_letsencrypt_challenge_type") == tlsALPN01ChallengeType) && (!strings.HasSuffix(viper.GetString("listen_addr"), ":443")) {