From 60e846f7bbb56954505401651dbf239b9195759f Mon Sep 17 00:00:00 2001 From: Mohammed Date: Sat, 16 Mar 2024 14:35:21 +0000 Subject: [PATCH 1/2] delete syslog from whole of the repo --- Makefile | 5 --- cmd/address-resolver/commands/root.go | 12 ------- cmd/dmsg-monitor/commands/root.go | 11 ------- cmd/liveness-checker/commands/root.go | 23 ++++--------- cmd/network-monitor/commands/root.go | 11 ------- cmd/node-visualizer/commands/root.go | 11 ------- cmd/route-finder/commands/root.go | 12 ------- cmd/tpd-monitor/commands/root.go | 12 ------- cmd/transport-discovery/commands/root.go | 12 ------- internal/config/env.go | 2 -- internal/config/env_test.go | 41 +++++++++++------------- internal/config/external_services.go | 3 +- internal/config/runners.go | 24 +++++++------- internal/config/skywire.go | 14 ++++---- internal/config/visors.go | 2 +- vendor/modules.txt | 2 -- 16 files changed, 45 insertions(+), 152 deletions(-) diff --git a/Makefile b/Makefile index 9b06e05a..98e41920 100644 --- a/Makefile +++ b/Makefile @@ -248,10 +248,5 @@ vendor-integration-check: ## Check compatibility of master@skywire-services with ## : ## _ [Other] -run-syslog: ## Run syslog-ng in docker. Logs are mounted under /tmp/syslog - -mkdir -p /tmp/syslog - -docker container rm syslog-ng -f - docker run -d -p 514:514/udp -v /tmp/syslog:/var/log --name syslog-ng balabit/syslog-ng:latest - help: @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$|^##.*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' diff --git a/cmd/address-resolver/commands/root.go b/cmd/address-resolver/commands/root.go index 7ffc13ec..5c54d6c6 100644 --- a/cmd/address-resolver/commands/root.go +++ b/cmd/address-resolver/commands/root.go @@ -5,14 +5,12 @@ import ( "context" "fmt" "log" - "log/syslog" "os" "path/filepath" "strings" "time" cc "github.com/ivanpirog/coloredcobra" - logrussyslog "github.com/sirupsen/logrus/hooks/syslog" "github.com/skycoin/dmsg/pkg/direct" "github.com/skycoin/dmsg/pkg/dmsg" "github.com/skycoin/dmsg/pkg/dmsghttp" @@ -43,7 +41,6 @@ var ( metricsAddr string redisURL string redisPoolSize int - syslogAddr string tag string logLvl string testing bool @@ -60,7 +57,6 @@ func init() { RootCmd.Flags().StringVar(&redisURL, "redis", "redis://localhost:6379", "connections string for a redis store\033[0m") RootCmd.Flags().IntVar(&redisPoolSize, "redis-pool-size", 10, "redis connection pool size\033[0m") RootCmd.Flags().StringVarP(&logLvl, "loglvl", "l", "info", "set log level one of: info, error, warn, debug, trace, panic") - RootCmd.Flags().StringVar(&syslogAddr, "syslog", "", "syslog server address. E.g. localhost:514\033[0m") RootCmd.Flags().StringVar(&tag, "tag", "address_resolver", "logging tag\033[0m") RootCmd.Flags().BoolVarP(&testing, "testing", "t", false, "enable testing to start without redis\033[0m") RootCmd.Flags().StringVar(&dmsgDisc, "dmsg-disc", "http://dmsgd.skywire.skycoin.com", "url of dmsg-discovery\033[0m") @@ -157,14 +153,6 @@ skywire svc ar --addr ":9093" --redis "redis://localhost:6379" --sk $(tail -n1 a logger.WithError(err).Warn("No SecKey found. Skipping serving on dmsghttp.") } - if syslogAddr != "" { - hook, err := logrussyslog.NewSyslogHook("udp", syslogAddr, syslog.LOG_INFO, tag) - if err != nil && logger != nil { - logger.Fatalf("Unable to connect to syslog daemon on %v", syslogAddr) - } - logging.AddHook(hook) - } - metricsutil.ServeHTTPMetrics(logger, metricsAddr) var m armetrics.Metrics diff --git a/cmd/dmsg-monitor/commands/root.go b/cmd/dmsg-monitor/commands/root.go index 876e3bd5..ec48499e 100644 --- a/cmd/dmsg-monitor/commands/root.go +++ b/cmd/dmsg-monitor/commands/root.go @@ -5,13 +5,11 @@ import ( "context" "fmt" "log" - "log/syslog" "os" "path/filepath" "strings" "time" - logrussyslog "github.com/sirupsen/logrus/hooks/syslog" "github.com/skycoin/skywire-utilities/pkg/buildinfo" "github.com/skycoin/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire-utilities/pkg/cmdutil" @@ -28,7 +26,6 @@ var ( utURL string addr string tag string - syslogAddr string logLvl string sleepDeregistration time.Duration batchSize int @@ -42,7 +39,6 @@ func init() { RootCmd.Flags().StringVarP(&dmsgURL, "dmsg-url", "d", "", "url to dmsg data.\033[0m") RootCmd.Flags().StringVarP(&utURL, "ut-url", "u", "", "url to uptime tracker visor data.\033[0m") RootCmd.Flags().StringVar(&tag, "tag", "dmsg_monitor", "logging tag\033[0m") - RootCmd.Flags().StringVar(&syslogAddr, "syslog", "", "syslog server address. E.g. localhost:514\033[0m") RootCmd.Flags().StringVarP(&logLvl, "loglvl", "l", "info", "set log level one of: info, error, warn, debug, trace, panic") } @@ -88,13 +84,6 @@ var RootCmd = &cobra.Command{ srvURLs.UT = utURL logger := mLogger.PackageLogger(tag) - if syslogAddr != "" { - hook, err := logrussyslog.NewSyslogHook("udp", syslogAddr, syslog.LOG_INFO, tag) - if err != nil { - logger.Fatalf("Unable to connect to syslog daemon on %v", syslogAddr) - } - logging.AddHook(hook) - } logger.WithField("addr", addr).Info("Serving DMSG-Monitor API...") diff --git a/cmd/liveness-checker/commands/root.go b/cmd/liveness-checker/commands/root.go index d55f7597..9f5efd7b 100644 --- a/cmd/liveness-checker/commands/root.go +++ b/cmd/liveness-checker/commands/root.go @@ -5,12 +5,10 @@ import ( "context" "fmt" "log" - "log/syslog" "os" "path/filepath" "strings" - logrussyslog "github.com/sirupsen/logrus/hooks/syslog" "github.com/skycoin/skywire-utilities/pkg/buildinfo" "github.com/skycoin/skywire-utilities/pkg/cmdutil" "github.com/skycoin/skywire-utilities/pkg/logging" @@ -27,20 +25,18 @@ const ( ) var ( - confPath string - addr string - tag string - syslogAddr string - logLvl string - redisURL string - testing bool + confPath string + addr string + tag string + logLvl string + redisURL string + testing bool ) func init() { RootCmd.Flags().StringVarP(&addr, "addr", "a", ":9081", "address to bind to.\033[0m") RootCmd.Flags().StringVarP(&confPath, "config", "c", "liveness-checker.json", "config file location.\033[0m") RootCmd.Flags().StringVar(&tag, "tag", "liveness_checker", "logging tag\033[0m") - RootCmd.Flags().StringVar(&syslogAddr, "syslog", "", "syslog server address. E.g. localhost:514\033[0m") RootCmd.Flags().StringVarP(&logLvl, "loglvl", "l", "info", "set log level one of: info, error, warn, debug, trace, panic") RootCmd.Flags().StringVar(&redisURL, "redis", "redis://localhost:6379", "connections string for a redis store\033[0m") RootCmd.Flags().BoolVarP(&testing, "testing", "t", false, "enable testing to start without redis\033[0m") @@ -91,13 +87,6 @@ var RootCmd = &cobra.Command{ conf, confAPI := api.InitConfig(confPath, mLogger) logger := mLogger.PackageLogger(tag) - if syslogAddr != "" { - hook, err := logrussyslog.NewSyslogHook("udp", syslogAddr, syslog.LOG_INFO, tag) - if err != nil { - logger.Fatalf("Unable to connect to syslog daemon on %v", syslogAddr) - } - logging.AddHook(hook) - } ctx, cancel := cmdutil.SignalContext(context.Background(), logger) defer cancel() diff --git a/cmd/network-monitor/commands/root.go b/cmd/network-monitor/commands/root.go index acf8776b..c787d39f 100644 --- a/cmd/network-monitor/commands/root.go +++ b/cmd/network-monitor/commands/root.go @@ -5,13 +5,11 @@ import ( "context" "fmt" "log" - "log/syslog" "os" "path/filepath" "strings" "time" - logrussyslog "github.com/sirupsen/logrus/hooks/syslog" "github.com/skycoin/skywire-utilities/pkg/buildinfo" "github.com/skycoin/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire-utilities/pkg/cmdutil" @@ -38,7 +36,6 @@ var ( utURL string addr string tag string - syslogAddr string logLvl string metricsAddr string redisURL string @@ -56,7 +53,6 @@ func init() { RootCmd.Flags().StringVarP(&arURL, "ar-url", "v", "", "url to address resolver.\033[0m") RootCmd.Flags().StringVarP(&utURL, "ut-url", "u", "", "url to uptime tracker visor data.\033[0m") RootCmd.Flags().StringVar(&tag, "tag", "network_monitor", "logging tag\033[0m") - RootCmd.Flags().StringVar(&syslogAddr, "syslog", "", "syslog server address. E.g. localhost:514\033[0m") RootCmd.Flags().StringVarP(&logLvl, "loglvl", "l", "info", "set log level one of: info, error, warn, debug, trace, panic") RootCmd.Flags().StringVarP(&metricsAddr, "metrics", "m", "", "address to bind metrics API to\033[0m") RootCmd.Flags().StringVar(&redisURL, "redis", "redis://localhost:6379", "connections string for a redis store\033[0m") @@ -129,13 +125,6 @@ var RootCmd = &cobra.Command{ srvURLs.UT = utURL logger := mLogger.PackageLogger("network_monitor") - if syslogAddr != "" { - hook, err := logrussyslog.NewSyslogHook("udp", syslogAddr, syslog.LOG_INFO, tag) - if err != nil { - logger.Fatalf("Unable to connect to syslog daemon on %v", syslogAddr) - } - logging.AddHook(hook) - } logger.WithField("addr", addr).Info("Serving discovery API...") diff --git a/cmd/node-visualizer/commands/root.go b/cmd/node-visualizer/commands/root.go index b3a45311..dfff85cc 100644 --- a/cmd/node-visualizer/commands/root.go +++ b/cmd/node-visualizer/commands/root.go @@ -5,14 +5,12 @@ import ( "context" "fmt" "log" - "log/syslog" "net/http" "os" "path/filepath" "strings" "time" - logrussyslog "github.com/sirupsen/logrus/hooks/syslog" "github.com/skycoin/skywire-utilities/pkg/buildinfo" "github.com/skycoin/skywire-utilities/pkg/cmdutil" "github.com/skycoin/skywire-utilities/pkg/logging" @@ -27,7 +25,6 @@ var ( addr string metricsAddr string logEnabled bool - syslogAddr string tag string testing bool ) @@ -36,7 +33,6 @@ func init() { RootCmd.Flags().StringVarP(&addr, "addr", "a", ":9081", "address to bind to\033[0m") RootCmd.Flags().StringVarP(&metricsAddr, "metrics", "m", "", "address to bind metrics API to\033[0m") RootCmd.Flags().BoolVarP(&logEnabled, "log", "l", true, "enable request logging\033[0m") - RootCmd.Flags().StringVar(&syslogAddr, "syslog", "", "syslog server address. E.g. localhost:514\033[0m") RootCmd.Flags().StringVar(&tag, "tag", "node-visualizer", "logging tag\033[0m") RootCmd.Flags().BoolVarP(&testing, "testing", "t", false, "enable testing to start without redis\033[0m") } @@ -63,13 +59,6 @@ var RootCmd = &cobra.Command{ const loggerTag = "node_visualizer" logger := logging.MustGetLogger(loggerTag) - if syslogAddr != "" { - hook, err := logrussyslog.NewSyslogHook("udp", syslogAddr, syslog.LOG_INFO, tag) - if err != nil { - logger.Fatalf("Unable to connect to syslog daemon on %v", syslogAddr) - } - logging.AddHook(hook) - } metricsutil.ServeHTTPMetrics(logger, metricsAddr) diff --git a/cmd/route-finder/commands/root.go b/cmd/route-finder/commands/root.go index df929fbd..54e5b32e 100644 --- a/cmd/route-finder/commands/root.go +++ b/cmd/route-finder/commands/root.go @@ -5,13 +5,11 @@ import ( "context" "fmt" "log" - "log/syslog" "os" "path/filepath" "strings" "time" - logrussyslog "github.com/sirupsen/logrus/hooks/syslog" "github.com/skycoin/dmsg/pkg/direct" "github.com/skycoin/dmsg/pkg/dmsg" "github.com/skycoin/dmsg/pkg/dmsghttp" @@ -35,7 +33,6 @@ var ( metricsAddr string pgHost string pgPort string - syslogAddr string logLvl string tag string testing bool @@ -49,7 +46,6 @@ func init() { RootCmd.Flags().StringVarP(&metricsAddr, "metrics", "m", "", "address to bind metrics API to\033[0m") RootCmd.Flags().StringVar(&pgHost, "pg-host", "localhost", "host of postgres\033[0m") RootCmd.Flags().StringVar(&pgPort, "pg-port", "5432", "port of postgres\033[0m") - RootCmd.Flags().StringVar(&syslogAddr, "syslog", "", "syslog server address. E.g. localhost:514\033[0m") RootCmd.Flags().StringVarP(&logLvl, "loglvl", "l", "info", "set log level one of: info, error, warn, debug, trace, panic") RootCmd.Flags().StringVar(&tag, "tag", "route_finder", "logging tag\033[0m") RootCmd.Flags().BoolVarP(&testing, "testing", "t", false, "enable testing to start without redis\033[0m") @@ -121,14 +117,6 @@ PG_USER="postgres" PG_DATABASE="rf" PG_PASSWORD="" route-finder --addr ":9092" logger.WithError(err).Warn("No SecKey found. Skipping serving on dmsghttp.") } - if syslogAddr != "" { - hook, err := logrussyslog.NewSyslogHook("udp", syslogAddr, syslog.LOG_INFO, tag) - if err != nil && logger != nil { - logger.Fatalf("Unable to connect to syslog daemon on %v", syslogAddr) - } - logging.AddHook(hook) - } - metricsutil.ServeHTTPMetrics(logger, metricsAddr) var dmsgAddr string diff --git a/cmd/tpd-monitor/commands/root.go b/cmd/tpd-monitor/commands/root.go index a8e1de70..e2c59544 100644 --- a/cmd/tpd-monitor/commands/root.go +++ b/cmd/tpd-monitor/commands/root.go @@ -5,13 +5,11 @@ import ( "context" "fmt" "log" - "log/syslog" "os" "path/filepath" "strings" "time" - logrussyslog "github.com/sirupsen/logrus/hooks/syslog" "github.com/skycoin/skywire-utilities/pkg/buildinfo" "github.com/skycoin/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire-utilities/pkg/cmdutil" @@ -30,7 +28,6 @@ var ( addr string logLvl string tag string - syslogAddr string sleepDeregistration time.Duration ) @@ -43,7 +40,6 @@ func init() { RootCmd.Flags().StringVar(&tpdURL, "tpd-url", "", "url to transport discovery.\033[0m") RootCmd.Flags().StringVar(&arURL, "ar-url", "", "url to address resolver.\033[0m") RootCmd.Flags().StringVar(&tag, "tag", "tpd-monitor", "logging tag\033[0m") - RootCmd.Flags().StringVar(&syslogAddr, "syslog", "", "syslog server address. E.g. localhost:514\033[0m") } // RootCmd contains the root command @@ -92,14 +88,6 @@ var RootCmd = &cobra.Command{ srvURLs.TPD = tpdURL srvURLs.AR = arURL - if syslogAddr != "" { - hook, err := logrussyslog.NewSyslogHook("udp", syslogAddr, syslog.LOG_INFO, tag) - if err != nil { - logger.Fatalf("Unable to connect to syslog daemon on %v", syslogAddr) - } - logging.AddHook(hook) - } - logger.WithField("addr", addr).Info("Serving TPD-Monitor API...") monitorSign, _ := cipher.SignPayload([]byte(conf.PK.Hex()), conf.SK) //nolint diff --git a/cmd/transport-discovery/commands/root.go b/cmd/transport-discovery/commands/root.go index af90bfa2..6ec5aa25 100644 --- a/cmd/transport-discovery/commands/root.go +++ b/cmd/transport-discovery/commands/root.go @@ -5,13 +5,11 @@ import ( "context" "fmt" "log" - "log/syslog" "os" "path/filepath" "strings" "time" - logrussyslog "github.com/sirupsen/logrus/hooks/syslog" "github.com/skycoin/dmsg/pkg/direct" "github.com/skycoin/dmsg/pkg/dmsg" "github.com/skycoin/dmsg/pkg/dmsghttp" @@ -45,7 +43,6 @@ var ( redisPoolSize int pgHost string pgPort string - syslogAddr string logLvl string tag string testing bool @@ -63,7 +60,6 @@ func init() { RootCmd.Flags().IntVar(&redisPoolSize, "redis-pool-size", 10, "redis connection pool size\033[0m") RootCmd.Flags().StringVar(&pgHost, "pg-host", "localhost", "host of postgres\033[0m") RootCmd.Flags().StringVar(&pgPort, "pg-port", "5432", "port of postgres\033[0m") - RootCmd.Flags().StringVar(&syslogAddr, "syslog", "", "syslog server address. E.g. localhost:514\033[0m") RootCmd.Flags().StringVarP(&logLvl, "loglvl", "l", "info", "set log level one of: info, error, warn, debug, trace, panic") RootCmd.Flags().StringVar(&tag, "tag", "transport_discovery", "logging tag\033[0m") RootCmd.Flags().BoolVarP(&testing, "testing", "t", false, "enable testing to start without redis\033[0m") @@ -132,14 +128,6 @@ PG_USER="postgres" PG_DATABASE="tpd" PG_PASSWORD="" transport-discovery --sk $(t api.WhitelistPKs.Set(v) } - if syslogAddr != "" { - hook, err := logrussyslog.NewSyslogHook("udp", syslogAddr, syslog.LOG_INFO, tag) - if err != nil { - logger.Fatalf("Unable to connect to syslog daemon on %v", syslogAddr) - } - logging.AddHook(hook) - } - var gormDB *gorm.DB if !testing { diff --git a/internal/config/env.go b/internal/config/env.go index 656760b1..5a6cd38d 100644 --- a/internal/config/env.go +++ b/internal/config/env.go @@ -22,8 +22,6 @@ type ExternalServicesConfig struct { RedisAddress string `json:"redis,omitempty"` RedisCmd string `json:"redis_cmd,omitempty"` MetricsAddress string `json:"metrics,omitempty"` - SyslogAddress string `json:"syslog,omitempty"` - SyslogCmd string `json:"syslog_cmd,omitempty"` } // RunnersConfig defines how each service is run diff --git a/internal/config/env_test.go b/internal/config/env_test.go index dabfe5a5..18fa1520 100644 --- a/internal/config/env_test.go +++ b/internal/config/env_test.go @@ -81,11 +81,8 @@ func ExampleEnvConfig_AddVisorExplicitly() { func ExampleEnvConfig_AddVisor() { publicEnv := &EnvConfig{ Description: "Example of environment configuration with global skywire-services and 3 skywire-visors", - ExternalServices: ExternalServicesConfig{ - SyslogAddress: "localhost:514", - }, Runners: RunnersConfig{ - SkywireVisor: "go run ./cmd/skywire-visor {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", + SkywireVisor: "go run ./cmd/skywire-visor {{.Name}}.json --tag {{.Name}}", }, Skywire: DefaultPublicSkywire(), } @@ -107,25 +104,24 @@ func ExampleEnvConfig_AddVisor() { fmt.Printf("%v %v: %v\n", n, visor.Name, visor.Cmd) } - // Output: 0 VisorA: go run ./cmd/skywire-visor VisorA.json --syslog localhost:514 --tag VisorA - // 1 VisorB: go run ./cmd/skywire-visor VisorB.json --syslog localhost:514 --tag VisorB - // 2 VisorC: go run ./cmd/skywire-visor VisorC.json --syslog localhost:514 --tag VisorC + // Output: 0 VisorA: go run ./cmd/skywire-visor VisorA.json --tag VisorA + // 1 VisorB: go run ./cmd/skywire-visor VisorB.json --tag VisorB + // 2 VisorC: go run ./cmd/skywire-visor VisorC.json --tag VisorC } func ExampleEnvConfig_Skywire() { localEnv := &EnvConfig{ Description: "Example of environment configuration with local skywire-services running from source", ExternalServices: ExternalServicesConfig{ - SyslogAddress: "localhost:514", - RedisAddress: "localhost:6379", + RedisAddress: "localhost:6379", }, Runners: RunnersConfig{ - DmsgDiscovery: "go run ./cmd/dmsg-discovery --address {{.Address}} --syslog {{.Syslog}} --tag {{.Name}}", - DmsgServer: "go run ./cmd/dmsg-server {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", - TransportDiscovery: "go run ./cmd/transport-discovery --address {{.Address}} --syslog {{.Syslog}} --tag {{.Name}}", - RouteFinder: "go run ./cmd/route-finder --address {{.Address}} --syslog {{.Syslog}} --tag {{.Name}}", - SetupNode: "go run ./cmd/setup-node {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", - AddressResolver: "go run ./cmd/address-resolver {{.Name}}.json --address {{.Address}} --syslog {{.Syslog}} --tag {{.Name}}", + DmsgDiscovery: "go run ./cmd/dmsg-discovery --address {{.Address}} --tag {{.Name}}", + DmsgServer: "go run ./cmd/dmsg-server {{.Name}}.json --tag {{.Name}}", + TransportDiscovery: "go run ./cmd/transport-discovery --address {{.Address}} --tag {{.Name}}", + RouteFinder: "go run ./cmd/route-finder --address {{.Address}} --tag {{.Name}}", + SetupNode: "go run ./cmd/setup-node {{.Name}}.json --tag {{.Name}}", + AddressResolver: "go run ./cmd/address-resolver {{.Name}}.json --address {{.Address}} --tag {{.Name}}", }, } @@ -147,12 +143,12 @@ func ExampleEnvConfig_Skywire() { fmt.Println(env.Skywire.AddressResolver.Cmd) // Output: Example of environment configuration with local skywire-services running from source - // go run ./cmd/dmsg-discovery --address localhost:12001 --syslog localhost:514 --tag MSGD - // go run ./cmd/dmsg-server MSG.json --syslog localhost:514 --tag MSG - // go run ./cmd/transport-discovery --address localhost:12003 --syslog localhost:514 --tag TRD - // go run ./cmd/route-finder --address localhost:12004 --syslog localhost:514 --tag RF - // go run ./cmd/setup-node SN.json --syslog localhost:514 --tag SN - // go run ./cmd/address-resolver AR.json --address localhost:12005 --syslog localhost:514 --tag AR + // go run ./cmd/dmsg-discovery --address localhost:12001 --tag MSGD + // go run ./cmd/dmsg-server MSG.json --tag MSG + // go run ./cmd/transport-discovery --address localhost:12003 --tag TRD + // go run ./cmd/route-finder --address localhost:12004 --tag RF + // go run ./cmd/setup-node SN.json --tag SN + // go run ./cmd/address-resolver AR.json --address localhost:12005 --tag AR } func ExampleDefaultDockerRunners() { @@ -160,8 +156,7 @@ func ExampleDefaultDockerRunners() { dockerEnv := &EnvConfig{ Description: "Example of environment configuration with dockerized skywire", ExternalServices: ExternalServicesConfig{ - SyslogAddress: "syslog:514", - RedisAddress: "redis:6379", + RedisAddress: "redis:6379", }, Runners: DefaultDockerRunners("SKYNET_001"), } diff --git a/internal/config/external_services.go b/internal/config/external_services.go index 989cb6fc..b98b563e 100644 --- a/internal/config/external_services.go +++ b/internal/config/external_services.go @@ -8,8 +8,7 @@ import ( // DefaultExternalServices returns default externalServices configuration for localhost environments func (env *EnvConfig) DefaultExternalServices() *EnvConfig { env.ExternalServices = ExternalServicesConfig{ - RedisAddress: "localhost:6379", - SyslogAddress: "localhost:514", + RedisAddress: "localhost:6379", } return env } diff --git a/internal/config/runners.go b/internal/config/runners.go index 5152904b..5c21ab0d 100644 --- a/internal/config/runners.go +++ b/internal/config/runners.go @@ -81,23 +81,23 @@ func DefaultDockerRunners(network string) RunnersConfig { // DefaultLocalRunners returns set of default runners on localhost func DefaultLocalRunners() RunnersConfig { return RunnersConfig{ - DmsgDiscovery: "dmsg-discovery --syslog {{.Syslog}} --tag {{.Name}}", - DmsgServer: "dmsg-server {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", - TransportDiscovery: "transport-discovery {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", - RouteFinder: "route-finder --syslog {{.Syslog}} --tag {{.Name}}", - SetupNode: "setup-node {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", - SkywireVisor: "skywire-visor {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", + DmsgDiscovery: "dmsg-discovery --tag {{.Name}}", + DmsgServer: "dmsg-server {{.Name}}.json --tag {{.Name}}", + TransportDiscovery: "transport-discovery {{.Name}}.json --tag {{.Name}}", + RouteFinder: "route-finder --tag {{.Name}}", + SetupNode: "setup-node {{.Name}}.json --tag {{.Name}}", + SkywireVisor: "skywire-visor {{.Name}}.json --tag {{.Name}}", } } // DefaultSourceRunners returns set of default runners on localhost from source func DefaultSourceRunners() RunnersConfig { return RunnersConfig{ - DmsgDiscovery: "go run ./cmd/dmsg-discovery --syslog {{.Syslog}} --tag {{.Name}}", - DmsgServer: "go run ./cmd/dmsg-server {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", - TransportDiscovery: "go run ./cmd/transport-discovery {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", - RouteFinder: "go run ./cmd/route-finder --syslog {{.Syslog}} --tag {{.Name}}", - SetupNode: "go run ./cmd/setup-node {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", - SkywireVisor: "go run ./cmd/skywire-visor {{.Name}}.json --syslog {{.Syslog}} --tag {{.Name}}", + DmsgDiscovery: "go run ./cmd/dmsg-discovery --tag {{.Name}}", + DmsgServer: "go run ./cmd/dmsg-server {{.Name}}.json --tag {{.Name}}", + TransportDiscovery: "go run ./cmd/transport-discovery {{.Name}}.json --tag {{.Name}}", + RouteFinder: "go run ./cmd/route-finder --tag {{.Name}}", + SetupNode: "go run ./cmd/setup-node {{.Name}}.json --tag {{.Name}}", + SkywireVisor: "go run ./cmd/skywire-visor {{.Name}}.json --tag {{.Name}}", } } diff --git a/internal/config/skywire.go b/internal/config/skywire.go index 10572c26..dc4c1728 100644 --- a/internal/config/skywire.go +++ b/internal/config/skywire.go @@ -103,8 +103,8 @@ func (env *EnvConfig) AddDmsgDiscovery(name string, address string) *EnvConfig { env.Skywire.DmsgDiscovery = DmsgDiscoveryConfig{ Name: name, Address: address, - Cmd: _cmd(env.Runners.DmsgDiscovery, struct{ Name, Address, Syslog string }{name, address, env.ExternalServices.SyslogAddress}), - // Cmd: fmt.Sprintf("%v --address %v %v --tag %v", env.Runners.DmsgDiscovery, address, syslogParam(env), name), + Cmd: _cmd(env.Runners.DmsgDiscovery, struct{ Name, Address string }{name, address}), + // Cmd: fmt.Sprintf("%v --address %v --tag %v", env.Runners.DmsgDiscovery, address, name), } return env } @@ -123,7 +123,7 @@ func (env *EnvConfig) AddDmsgServer(name string, publicAddress string, localAddr LocalAddress: localAddress, LogLevel: "info", }, - Cmd: _cmd(env.Runners.DmsgServer, struct{ Name, Syslog string }{name, env.ExternalServices.SyslogAddress}), + Cmd: _cmd(env.Runners.DmsgServer, struct{ Name string }{name}), } return env } @@ -145,7 +145,7 @@ func EmptyDmsgServerConfig() msg.Config { func (env *EnvConfig) AddTransportDiscovery(name string, address string) *EnvConfig { env.Skywire.TransportDiscovery = TransportDiscoveryConfig{ Name: name, - Cmd: _cmd(env.Runners.TransportDiscovery, struct{ Name, Address, Syslog string }{name, address, env.ExternalServices.SyslogAddress}), + Cmd: _cmd(env.Runners.TransportDiscovery, struct{ Name, Address string }{name, address}), } return env } @@ -154,7 +154,7 @@ func (env *EnvConfig) AddTransportDiscovery(name string, address string) *EnvCon func (env *EnvConfig) AddRouteFinder(name string, address string) *EnvConfig { env.Skywire.RouteFinder = RouteFinderConfig{ Name: name, - Cmd: _cmd(env.Runners.RouteFinder, struct{ Name, Address, Syslog string }{name, address, env.ExternalServices.SyslogAddress}), + Cmd: _cmd(env.Runners.RouteFinder, struct{ Name, Address string }{name, address}), } return env } @@ -174,7 +174,7 @@ func (env *EnvConfig) AddSetupNode(name string) *EnvConfig { TransportDiscovery: env.Skywire.TransportDiscovery.Address, LogLevel: "info", }, - Cmd: _cmd(env.Runners.SetupNode, struct{ Name, Syslog string }{name, env.ExternalServices.SyslogAddress}), + Cmd: _cmd(env.Runners.SetupNode, struct{ Name string }{name}), } return env } @@ -183,7 +183,7 @@ func (env *EnvConfig) AddSetupNode(name string) *EnvConfig { func (env *EnvConfig) AddAddressResolver(name string, address string) *EnvConfig { env.Skywire.AddressResolver = AddressResolverConfig{ Name: name, - Cmd: _cmd(env.Runners.AddressResolver, struct{ Name, Address, Syslog string }{name, address, env.ExternalServices.SyslogAddress}), + Cmd: _cmd(env.Runners.AddressResolver, struct{ Name, Address string }{name, address}), } return env } diff --git a/internal/config/visors.go b/internal/config/visors.go index 5ebecd3f..240de998 100644 --- a/internal/config/visors.go +++ b/internal/config/visors.go @@ -55,7 +55,7 @@ func (env *EnvConfig) AddVisor(visorName string, apps []appserver.AppConfig, rpc env.AddVisorExplicitly(VisorConfig{ Name: visorName, Config: visorCfg, - Cmd: _cmd(env.Runners.SkywireVisor, struct{ Name, Syslog string }{visorName, env.ExternalServices.SyslogAddress}), + Cmd: _cmd(env.Runners.SkywireVisor, struct{ Name string }{visorName}), }) return env diff --git a/vendor/modules.txt b/vendor/modules.txt index 0852f4ff..d5164a1d 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -454,7 +454,6 @@ github.com/rs/cors # github.com/sirupsen/logrus v1.9.3 ## explicit; go 1.13 github.com/sirupsen/logrus -github.com/sirupsen/logrus/hooks/syslog # github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4 => github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4 ## explicit; go 1.21 github.com/skycoin/dmsg/internal/servermetrics @@ -500,7 +499,6 @@ github.com/skycoin/skywire/pkg/router/setupmetrics github.com/skycoin/skywire/pkg/routing github.com/skycoin/skywire/pkg/servicedisc github.com/skycoin/skywire/pkg/skyenv -github.com/skycoin/skywire/pkg/syslog github.com/skycoin/skywire/pkg/transport github.com/skycoin/skywire/pkg/transport/network github.com/skycoin/skywire/pkg/transport/network/addrresolver From 662954c9edee3d4a396d96efd9e93b92c3a09b17 Mon Sep 17 00:00:00 2001 From: Mohammed Date: Sat, 16 Mar 2024 15:46:54 +0000 Subject: [PATCH 2/2] fix ar issue on help menu --- cmd/address-resolver/address-resolver.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/cmd/address-resolver/address-resolver.go b/cmd/address-resolver/address-resolver.go index 6136cdde..7c600fa0 100644 --- a/cmd/address-resolver/address-resolver.go +++ b/cmd/address-resolver/address-resolver.go @@ -9,9 +9,7 @@ import ( ) func init() { - var helpflag bool commands.RootCmd.SetUsageTemplate(help) - commands.RootCmd.PersistentFlags().BoolVarP(&helpflag, "help", "h", false, "help for dmsgpty-cli") commands.RootCmd.SetHelpCommand(&cobra.Command{Hidden: true}) commands.RootCmd.PersistentFlags().MarkHidden("help") //nolint }