diff --git a/cmd/server.go b/cmd/server.go index 4f08c96..45afdc5 100644 --- a/cmd/server.go +++ b/cmd/server.go @@ -27,6 +27,7 @@ var serverCmd = &cobra.Command{ func init() { rootCmd.AddCommand(serverCmd) serverCmd.PersistentFlags().StringP("clients", "c", "", "File to recover clients from") + serverCmd.Flags().Bool("insecure", false, "[UNSAFE] Do not use TLS encryption") } func setServerParameters(cmd *cobra.Command) error { @@ -38,5 +39,9 @@ func setServerParameters(cmd *cobra.Command) error { isUsingJSONParameter = true clientJSONPath = parameterClients } + insecure, err := cmd.Flags().GetBool("insecure") + if insecure == true { + servInsecure = true + } return nil } diff --git a/cmd/serverFunc.go b/cmd/serverFunc.go index 312f741..aa71a5b 100644 --- a/cmd/serverFunc.go +++ b/cmd/serverFunc.go @@ -21,6 +21,8 @@ var ( heartbeatRate time.Duration = 15 + servInsecure bool + isUsingJSONParameter bool clientJSONPath string = "/.config/tiamat/clients.json" )