mirror of
https://github.com/juanfont/headscale.git
synced 2024-12-23 16:37:34 +00:00
41f6740ddd
tests for that feature. Other fixes: clean up a few typos in comments. Fix a bug that caused the tests to run four times each. Be more consistent in the use of log rather than fmt to print errors and notices.
27 lines
490 B
Go
27 lines
490 B
Go
package cli
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var ServeCmd = &cobra.Command{
|
|
Use: "serve",
|
|
Short: "Launches the headscale server",
|
|
Args: func(cmd *cobra.Command, args []string) error {
|
|
return nil
|
|
},
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
h, err := getHeadscaleApp()
|
|
if err != nil {
|
|
log.Fatalf("Error initializing: %s", err)
|
|
}
|
|
go h.ExpireEphemeralNodes(5000)
|
|
err = h.Serve()
|
|
if err != nil {
|
|
log.Fatalf("Error initializing: %s", err)
|
|
}
|
|
},
|
|
}
|