From 81dd9b23860ee3bcca6804dd79258bb80c368ae0 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Mon, 26 Sep 2022 11:34:04 +0200 Subject: [PATCH] format Signed-off-by: Kristoffer Dalby --- app.go | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/app.go b/app.go index 0f59a2ee63..a456f5733c 100644 --- a/app.go +++ b/app.go @@ -53,8 +53,10 @@ const ( ) ErrFailedPrivateKey = Error("failed to read or create private key") - ErrFailedNoisePrivateKey = Error("failed to read or create Noise protocol private key") - ErrSamePrivateKeys = Error("private key and noise private key are the same") + ErrFailedNoisePrivateKey = Error( + "failed to read or create Noise protocol private key", + ) + ErrSamePrivateKeys = Error("private key and noise private key are the same") ) const ( @@ -448,16 +450,20 @@ func (h *Headscale) createRouter(grpcMux *runtime.ServeMux) *mux.Router { router.HandleFunc("/health", h.HealthHandler).Methods(http.MethodGet) router.HandleFunc("/key", h.KeyHandler).Methods(http.MethodGet) router.HandleFunc("/register/{nkey}", h.RegisterWebAPI).Methods(http.MethodGet) - router.HandleFunc("/machine/{mkey}/map", h.PollNetMapHandler).Methods(http.MethodPost) + router.HandleFunc("/machine/{mkey}/map", h.PollNetMapHandler). + Methods(http.MethodPost) router.HandleFunc("/machine/{mkey}", h.RegistrationHandler).Methods(http.MethodPost) router.HandleFunc("/oidc/register/{nkey}", h.RegisterOIDC).Methods(http.MethodGet) router.HandleFunc("/oidc/callback", h.OIDCCallback).Methods(http.MethodGet) router.HandleFunc("/apple", h.AppleConfigMessage).Methods(http.MethodGet) - router.HandleFunc("/apple/{platform}", h.ApplePlatformConfig).Methods(http.MethodGet) + router.HandleFunc("/apple/{platform}", h.ApplePlatformConfig). + Methods(http.MethodGet) router.HandleFunc("/windows", h.WindowsConfigMessage).Methods(http.MethodGet) - router.HandleFunc("/windows/tailscale.reg", h.WindowsRegConfig).Methods(http.MethodGet) + router.HandleFunc("/windows/tailscale.reg", h.WindowsRegConfig). + Methods(http.MethodGet) router.HandleFunc("/swagger", SwaggerUI).Methods(http.MethodGet) - router.HandleFunc("/swagger/v1/openapiv2.json", SwaggerAPIv1).Methods(http.MethodGet) + router.HandleFunc("/swagger/v1/openapiv2.json", SwaggerAPIv1). + Methods(http.MethodGet) if h.cfg.DERP.ServerEnabled { router.HandleFunc("/derp", h.DERPHandler) @@ -477,7 +483,8 @@ func (h *Headscale) createRouter(grpcMux *runtime.ServeMux) *mux.Router { func (h *Headscale) createNoiseMux() *mux.Router { router := mux.NewRouter() - router.HandleFunc("/machine/register", h.NoiseRegistrationHandler).Methods(http.MethodPost) + router.HandleFunc("/machine/register", h.NoiseRegistrationHandler). + Methods(http.MethodPost) router.HandleFunc("/machine/map", h.NoisePollNetMapHandler) return router @@ -827,7 +834,6 @@ func (h *Headscale) getTLSSettings() (*tls.Config, error) { ReadTimeout: HTTPReadTimeout, } - go func() { err := server.ListenAndServe() log.Fatal().