From 2242dc76f9f51bdc679b62917fb01419ad3e3614 Mon Sep 17 00:00:00 2001 From: MohammadReza Palide Date: Wed, 24 May 2023 17:10:10 +0330 Subject: [PATCH 1/2] add condition for whitelistePKs in initDmsgHTTPLogServer --- pkg/visor/init.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkg/visor/init.go b/pkg/visor/init.go index 1b0b70190a..82afdc1a71 100644 --- a/pkg/visor/init.go +++ b/pkg/visor/init.go @@ -390,9 +390,17 @@ func initDmsgHTTPLogServer(ctx context.Context, v *Visor, log *logging.Logger) e //whitelist access to the surveys for the hypervisor, dmsggpty whitelist, and for the surveywhitelist of keys which is fetched from the conf service var whitelistedPKs []cipher.PubKey - whitelistedPKs = append(whitelistedPKs, v.conf.SurveyWhitelist...) - whitelistedPKs = append(whitelistedPKs, v.conf.Hypervisors...) - whitelistedPKs = append(whitelistedPKs, v.conf.Dmsgpty.Whitelist...) + if v.conf.SurveyWhitelist != nil { + whitelistedPKs = append(whitelistedPKs, v.conf.SurveyWhitelist...) + } + if v.conf.Hypervisors != nil { + whitelistedPKs = append(whitelistedPKs, v.conf.Hypervisors...) + } + if v.conf.Dmsgpty != nil { + if v.conf.Dmsgpty.Whitelist != nil { + whitelistedPKs = append(whitelistedPKs, v.conf.Dmsgpty.Whitelist...) + } + } lsAPI := logserver.New(logger, v.conf.Transport.LogStore.Location, v.conf.LocalPath, v.conf.DmsgHTTPServerPath, whitelistedPKs, printLog) From f3be1401c2753290374a1d58c185927a8975f1c4 Mon Sep 17 00:00:00 2001 From: MohammadReza Palide Date: Wed, 24 May 2023 17:11:11 +0330 Subject: [PATCH 2/2] fix proxy command panic --- cmd/skywire-cli/commands/proxy/proxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/skywire-cli/commands/proxy/proxy.go b/cmd/skywire-cli/commands/proxy/proxy.go index a2080c68f4..5b0231c8f0 100644 --- a/cmd/skywire-cli/commands/proxy/proxy.go +++ b/cmd/skywire-cli/commands/proxy/proxy.go @@ -54,7 +54,7 @@ var startCmd = &cobra.Command{ err := pubkey.Set(pk) if err != nil { if len(args) > 0 { - err := pubkey.Set(args[1]) + err := pubkey.Set(args[0]) if err != nil { internal.PrintFatalError(cmd.Flags(), err) }