From 6a9dd2029e0985e5cbde1d11bdae16f3625b3ac1 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 19 Nov 2021 09:02:49 +0000 Subject: [PATCH] Remove expiry logic, this needs to be redone --- cmd/headscale/cli/utils.go | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/cmd/headscale/cli/utils.go b/cmd/headscale/cli/utils.go index 958fb89..98b5361 100644 --- a/cmd/headscale/cli/utils.go +++ b/cmd/headscale/cli/utils.go @@ -218,30 +218,6 @@ func absPath(path string) string { } func getHeadscaleConfig() headscale.Config { - // maxMachineRegistrationDuration is the maximum time headscale will allow a client to (optionally) request for - // the machine key expiry time. RegisterRequests with Expiry times that are more than - // maxMachineRegistrationDuration in the future will be clamped to (now + maxMachineRegistrationDuration) - maxMachineRegistrationDuration, _ := time.ParseDuration( - "10h", - ) // use 10h here because it is the length of a standard business day plus a small amount of leeway - if viper.GetDuration("max_machine_registration_duration") >= time.Second { - maxMachineRegistrationDuration = viper.GetDuration( - "max_machine_registration_duration", - ) - } - - // defaultMachineRegistrationDuration is the default time assigned to a machine registration if one is not - // specified by the tailscale client. It is the default amount of time a machine registration is valid for - // (ie the amount of time before the user has to re-authenticate when requesting a connection) - defaultMachineRegistrationDuration, _ := time.ParseDuration( - "8h", - ) // use 8h here because it's the length of a standard business day - if viper.GetDuration("default_machine_registration_duration") >= time.Second { - defaultMachineRegistrationDuration = viper.GetDuration( - "default_machine_registration_duration", - ) - } - dnsConfig, baseDomain := GetDNSConfig() derpConfig := GetDERPConfig() @@ -295,9 +271,6 @@ func getHeadscaleConfig() headscale.Config { Insecure: viper.GetBool("cli.insecure"), Timeout: viper.GetDuration("cli.timeout"), }, - - MaxMachineRegistrationDuration: maxMachineRegistrationDuration, - DefaultMachineRegistrationDuration: defaultMachineRegistrationDuration, } }