Skip to content

Commit

Permalink
merge develop & fix merge conflicts. remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
0pcom committed Jul 9, 2023
2 parents 4af35ae + c36d0b3 commit 8343527
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 80 deletions.
137 changes: 69 additions & 68 deletions cmd/skywire-cli/commands/config/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

"github.com/skycoin/dmsg/pkg/disc"
"github.com/spf13/cobra"

"github.com/skycoin/skywire-utilities/pkg/cipher"
"github.com/skycoin/skywire-utilities/pkg/logging"
utilenv "github.com/skycoin/skywire-utilities/pkg/skyenv"
Expand All @@ -20,74 +21,74 @@ var (
Test: visorconfig.DmsgHTTPServersData{DMSGServers: []*disc.Entry{}},
Prod: visorconfig.DmsgHTTPServersData{DMSGServers: []*disc.Entry{}},
}
noFetch bool
noDefaults bool
stcprPort int
sudphPort int
sk cipher.SecKey
output string
confPath string
configName string //nolint Note: configName used, but golangci-lint marked it unused in wrong
isStdout bool
isRegen bool
isRetainHypervisors bool
isTestEnv bool
pText string
isPkgEnv bool
isUsrEnv bool
isHypervisor bool
hypervisorPKs string
dmsgptyWlPKs string
surveyWhitelistPKs string
routeSetupNodes string
transportSetupPKs string
isDmsgHTTP bool
isVpnServerEnable bool
isDisableAuth bool
isEnableAuth bool
selectedOS string
disableApps string
isBestProtocol bool
serviceConfURL string
services *visorconfig.Services
isForce bool
isHide bool
isAll bool
isOutUnset bool
ver string
isRoot = visorconfig.IsRoot()
svcConf = strings.ReplaceAll(utilenv.ServiceConfAddr, "http://", "") //visorconfig.DefaultServiceConfAddr
testConf = strings.ReplaceAll(utilenv.TestServiceConfAddr, "http://", "") //visorconfig.DefaultServiceConfAddr
gHiddenFlags []string
uHiddenFlags []string
binPath string
logLevel string
isPkg bool
input string
isUpdateEndpoints bool
addHypervisorPKs string
isResetHypervisor bool
setVPNClientKillswitch string
addVPNClientSrv string
addVPNClientPasscode string
isResetVPNclient bool
addVPNServerPasscode string
setVPNServerSecure string
setVPNServerAutostart string
setVPNServerNetIfc string
isResetVPNServer bool
addSkysocksClientSrv string
isResetSkysocksClient bool
skysocksPasscode string
isResetSkysocks bool
setPublicAutoconnect string
minHops int
isUsr bool
isPublic bool
disablePublicAutoConn bool
isDisplayNodeIP bool
addExampleApps bool
enableProxyClientAutostart bool
noFetch bool
noDefaults bool
stcprPort int
sudphPort int
sk cipher.SecKey
output string
confPath string
configName string //nolint Note: configName used, but golangci-lint marked it unused in wrong
isStdout bool
isRegen bool
isRetainHypervisors bool
isTestEnv bool
pText string
isPkgEnv bool
isUsrEnv bool
isHypervisor bool
hypervisorPKs string
dmsgptyWlPKs string
surveyWhitelistPKs string
routeSetupNodes string
transportSetupPKs string
isDmsgHTTP bool
isVpnServerEnable bool
isDisableAuth bool
isEnableAuth bool
selectedOS string
disableApps string
isBestProtocol bool
serviceConfURL string
services *visorconfig.Services
isForce bool
isHide bool
isAll bool
isOutUnset bool
ver string
isRoot = visorconfig.IsRoot()
svcConf = strings.ReplaceAll(utilenv.ServiceConfAddr, "http://", "") //visorconfig.DefaultServiceConfAddr
testConf = strings.ReplaceAll(utilenv.TestServiceConfAddr, "http://", "") //visorconfig.DefaultServiceConfAddr
gHiddenFlags []string
uHiddenFlags []string
binPath string
logLevel string
isPkg bool
input string
isUpdateEndpoints bool
addHypervisorPKs string
isResetHypervisor bool
setVPNClientKillswitch string
addVPNClientSrv string
addVPNClientPasscode string
isResetVPNclient bool
addVPNServerPasscode string
setVPNServerSecure string
setVPNServerAutostart string
setVPNServerNetIfc string
isResetVPNServer bool
addSkysocksClientSrv string
isResetSkysocksClient bool
skysocksPasscode string
isResetSkysocks bool
setPublicAutoconnect string
minHops int
isUsr bool
isPublic bool
disablePublicAutoConn bool
isDisplayNodeIP bool
addExampleApps bool
enableProxyClientAutostart bool
disableProxyServerAutostart bool
proxyServerPass string
proxyClientPass string
Expand Down
19 changes: 7 additions & 12 deletions cmd/skywire-cli/commands/log/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ var (

func init() {
logCmd.Flags().SortFlags = false
logCmd.Flags().StringVarP(&env, "env", "e", "prod", "selecting env to fetch uptimes, default is prod")
logCmd.Flags().StringVarP(&env, "env", "e", "prod", "deployment to get uptimes from")
logCmd.Flags().BoolVarP(&logOnly, "log", "l", false, "fetch only transport logs")
logCmd.Flags().BoolVarP(&surveyOnly, "survey", "v", false, "fetch only surveys")
logCmd.Flags().BoolVarP(&deleteOnErrors, "clean", "c", false, "delete files and folders on errors")
logCmd.Flags().StringVar(&minv, "minv", "v1.3.4", "minimum version for get logs, default is 1.3.4")
logCmd.Flags().IntVarP(&duration, "duration", "n", 1, "numberof days before today to fetch transport logs for")
logCmd.Flags().StringVar(&minv, "minv", "v1.3.4", "minimum visor version to fetch from")
logCmd.Flags().IntVarP(&duration, "duration", "n", 0, "numberof days before today to fetch transport logs for")
logCmd.Flags().BoolVar(&allVisors, "all", false, "consider all visors ; no version filtering")
logCmd.Flags().IntVar(&batchSize, "batchSize", 50, "number of visor in each batch, default is 50")
logCmd.Flags().IntVar(&batchSize, "batchSize", 50, "number of visor in each batch")
logCmd.Flags().Int64Var(&maxFileSize, "maxfilesize", 30, "maximum file size allowed to download during collecting logs, in KB")
logCmd.Flags().StringVarP(&dmsgDisc, "dmsg-disc", "D", skyenv.DmsgDiscAddr, "dmsg discovery url\n")
logCmd.Flags().StringVarP(&utAddr, "ut", "u", "", "custom uptime tracker url")
Expand Down Expand Up @@ -175,14 +175,9 @@ var logCmd = &cobra.Command{
download(ctx, log, httpC, "node-info.json", "node-info.json", key, maxFileSize) //nolint
}
if !surveyOnly {
if duration == 1 {
yesterday := time.Now().AddDate(0, 0, -1).UTC().Format("2006-01-02")
download(ctx, log, httpC, "transport_logs/"+yesterday+".csv", yesterday+".csv", key, maxFileSize) //nolint
} else {
for i := 1; i <= duration; i++ {
date := time.Now().AddDate(0, 0, -i).UTC().Format("2006-01-02")
download(ctx, log, httpC, "transport_logs/"+date+".csv", date+".csv", key, maxFileSize) //nolint
}
for i := 0; i <= duration; i++ {
date := time.Now().AddDate(0, 0, -i).UTC().Format("2006-01-02")
download(ctx, log, httpC, "transport_logs/"+date+".csv", date+".csv", key, maxFileSize) //nolint
}
}
}(v.PubKey, &wg)
Expand Down

0 comments on commit 8343527

Please sign in to comment.