diff --git a/cmd/root.go b/cmd/root.go index 2c10b0c..9b51e1f 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -54,7 +54,7 @@ var rootCmd = &cobra.Command{ RPCPassword: viper.GetString("rpcpassword"), RPCHost: viper.GetString("rpchost"), RPCPort: viper.GetString("rpcport"), - NoTLSVeryInsecure: viper.GetBool("no-tls-very-insecure"), + NoTLS: viper.GetBool("no-tls"), GenCertVeryInsecure: viper.GetBool("gen-cert-very-insecure"), DataDir: viper.GetString("data-dir"), Redownload: viper.GetBool("redownload"), @@ -75,9 +75,8 @@ var rootCmd = &cobra.Command{ if /* !opts.Darkside && */ (opts.RPCUser == "" || opts.RPCPassword == "" || opts.RPCHost == "" || opts.RPCPort == "") { filesThatShouldExist = append(filesThatShouldExist, opts.HushConfPath) } - if !opts.NoTLSVeryInsecure && !opts.GenCertVeryInsecure { - filesThatShouldExist = append(filesThatShouldExist, - opts.TLSCertPath, opts.TLSKeyPath) + if !opts.NoTLS && !opts.GenCertVeryInsecure { + filesThatShouldExist = append(filesThatShouldExist, opts.TLSCertPath, opts.TLSKeyPath) } for _, filename := range filesThatShouldExist { @@ -132,9 +131,9 @@ func startServer(opts *common.Options) error { // gRPC initialization var server *grpc.Server - if opts.NoTLSVeryInsecure { - common.Log.Warningln("Starting insecure no-TLS (plaintext) server") - fmt.Println("Starting insecure server") + if opts.NoTLS { + common.Log.Warningln("Starting no-TLS (plaintext) server") + fmt.Println("Starting lightwalletd server") server = grpc.NewServer( grpc.StreamInterceptor( grpc_middleware.ChainStreamServer( @@ -330,7 +329,7 @@ func init() { rootCmd.Flags().String("rpcpassword", "", "RPC password") rootCmd.Flags().String("rpchost", "", "RPC host") rootCmd.Flags().String("rpcport", "", "RPC host port") - rootCmd.Flags().Bool("no-tls-very-insecure", false, "run without TLS, only safe if a reverse proxy like nginx does TLS on localhost") + rootCmd.Flags().Bool("no-tls", false, "run without TLS, only safe if a reverse proxy like nginx does TLS on localhost") rootCmd.Flags().Bool("gen-cert-very-insecure", false, "run with self-signed TLS certificate, only for debugging, DO NOT use in production") rootCmd.Flags().Bool("redownload", false, "re-fetch all blocks from hushd; reinitialize local cache files") rootCmd.Flags().Int("sync-from-height", -1, "re-fetch blocks from hushd start at this height") @@ -359,8 +358,8 @@ func init() { viper.BindPFlag("rpcpassword", rootCmd.Flags().Lookup("rpcpassword")) viper.BindPFlag("rpchost", rootCmd.Flags().Lookup("rpchost")) viper.BindPFlag("rpcport", rootCmd.Flags().Lookup("rpcport")) - viper.BindPFlag("no-tls-very-insecure", rootCmd.Flags().Lookup("no-tls-very-insecure")) - viper.SetDefault("no-tls-very-insecure", false) + viper.BindPFlag("no-tls", rootCmd.Flags().Lookup("no-tls")) + viper.SetDefault("no-tls", false) viper.BindPFlag("gen-cert-very-insecure", rootCmd.Flags().Lookup("gen-cert-very-insecure")) viper.SetDefault("gen-cert-very-insecure", false) viper.BindPFlag("redownload", rootCmd.Flags().Lookup("redownload")) diff --git a/common/common.go b/common/common.go index cb634e3..7cd9255 100644 --- a/common/common.go +++ b/common/common.go @@ -38,7 +38,7 @@ type Options struct { RPCPassword string `json:"rpcpassword"` RPCHost string `json:"rpchost"` RPCPort string `json:"rpcport"` - NoTLSVeryInsecure bool `json:"no_tls_very_insecure,omitempty"` + NoTLS bool `json:"no_tls,omitempty"` GenCertVeryInsecure bool `json:"gen_cert_very_insecure,omitempty"` Redownload bool `json:"redownload"` SyncFromHeight int `json:"sync_from_height"`