From 8ffb42962a4f118de9bcbceb5b3dab2223cd526f Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 17 Mar 2023 21:46:51 +0700 Subject: [PATCH 1/3] Use rcode string in error message So it's clearer what went wrong. --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index 81366c5..47c2315 100644 --- a/config.go +++ b/config.go @@ -185,7 +185,7 @@ func (uc *UpstreamConfig) SetupBootstrapIP() { return } if r.Rcode != dns.RcodeSuccess { - ProxyLog.Error().Msgf("could not resolve domain return code: %d, upstream", r.Rcode) + ProxyLog.Error().Msgf("could not resolve domain %q, return code: %s", uc.Domain, dns.RcodeToString[r.Rcode]) return } if len(r.Answer) == 0 { From c401c4ef871642ac8ba74575a555dd6a0c5d6111 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 17 Mar 2023 21:52:34 +0700 Subject: [PATCH 2/3] cmd/ctrld: do not set default iface value for uninstall command Fixed #30 --- cmd/ctrld/cli.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/ctrld/cli.go b/cmd/ctrld/cli.go index bea5161..ec33ac6 100644 --- a/cmd/ctrld/cli.go +++ b/cmd/ctrld/cli.go @@ -351,7 +351,10 @@ func initCLI() { PreRun: checkHasElevatedPrivilege, Use: "uninstall", Short: "Stop and uninstall the ctrld service", - Args: cobra.NoArgs, + Long: `Stop and uninstall the ctrld service. + +NOTE: Uninstalling will set DNS to values provided by DHCP.`, + Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { prog := &prog{} s, err := service.New(prog, svcConfig) @@ -365,13 +368,16 @@ func initCLI() { } initLogging() if doTasks(tasks) { + if iface == "" { + iface = "auto" + } prog.resetDNS() mainLog.Info().Msg("Service uninstalled") return } }, } - uninstallCmd.Flags().StringVarP(&iface, "iface", "", "auto", `Reset DNS setting for iface, "auto" means the default interface gateway`) + uninstallCmd.Flags().StringVarP(&iface, "iface", "", "", `Reset DNS setting for iface, use "auto" for the default gateway interface`) listIfacesCmd := &cobra.Command{ Use: "list", From a7a5501ea598b6152cefe256857a6c68c30e7f38 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Fri, 17 Mar 2023 22:22:54 +0700 Subject: [PATCH 3/3] Bump version to v1.1.3 --- cmd/ctrld/cli.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/ctrld/cli.go b/cmd/ctrld/cli.go index ec33ac6..dc172d3 100644 --- a/cmd/ctrld/cli.go +++ b/cmd/ctrld/cli.go @@ -70,7 +70,7 @@ func initCLI() { rootCmd := &cobra.Command{ Use: "ctrld", Short: strings.TrimLeft(rootShortDesc, "\n"), - Version: "1.1.2", + Version: "1.1.3", } rootCmd.PersistentFlags().CountVarP( &verbose,