1
0
mirror of https://github.com/juanfont/headscale.git synced 2024-12-20 19:09:07 +01:00

Make config get function global

This commit is contained in:
Kristoffer Dalby 2022-05-31 12:49:41 +02:00
parent 3e078f0494
commit 5bfae22c8f

View File

@ -277,7 +277,7 @@ func absPath(path string) string {
return path return path
} }
func getHeadscaleConfig() headscale.Config { func GetHeadscaleConfig() headscale.Config {
dnsConfig, baseDomain := GetDNSConfig() dnsConfig, baseDomain := GetDNSConfig()
derpConfig := GetDERPConfig() derpConfig := GetDERPConfig()
logConfig := GetLogTailConfig() logConfig := GetLogTailConfig()
@ -416,7 +416,7 @@ func getHeadscaleApp() (*headscale.Headscale, error) {
return nil, err return nil, err
} }
cfg := getHeadscaleConfig() cfg := GetHeadscaleConfig()
app, err := headscale.NewHeadscale(cfg) app, err := headscale.NewHeadscale(cfg)
if err != nil { if err != nil {
@ -440,7 +440,7 @@ func getHeadscaleApp() (*headscale.Headscale, error) {
} }
func getHeadscaleCLIClient() (context.Context, v1.HeadscaleServiceClient, *grpc.ClientConn, context.CancelFunc) { func getHeadscaleCLIClient() (context.Context, v1.HeadscaleServiceClient, *grpc.ClientConn, context.CancelFunc) {
cfg := getHeadscaleConfig() cfg := GetHeadscaleConfig()
log.Debug(). log.Debug().
Dur("timeout", cfg.CLI.Timeout). Dur("timeout", cfg.CLI.Timeout).