diff --git a/cmd/skywire-deployment/skywire.go b/cmd/skywire-deployment/skywire.go index 9c900cc1fd..6f67fcd121 100644 --- a/cmd/skywire-deployment/skywire.go +++ b/cmd/skywire-deployment/skywire.go @@ -95,7 +95,6 @@ func init() { RootCmd.AddCommand( visor.RootCmd, scli.RootCmd, - sn.RootCmd, //help menu doesn't appear correctly for setup-node unless this is included here svcCmd, dmsgCmd, appsCmd, @@ -108,11 +107,39 @@ func init() { └─┘┴ ┴ ┴ └┴┘┴┴└─└─┘ └┘ ┴└─┘└─┘┴└─` dmsgcurl.RootCmd.Use = "curl" dmsgweb.RootCmd.Use = "web" - sn.RootCmd.Use = "sn" - ssmon.RootCmd.Use = "ssm" + dmsgptycli.RootCmd.Use = "cli" + dmsgptyhost.RootCmd.Use = "host" + dmsgptyui.RootCmd.Use = "ui" + dmsgdisc.RootCmd.Use = "disc" + dmsgserver.RootCmd.Use = "server" + dmsghttp.RootCmd.Use = "http" + dmsgcurl.RootCmd.Use = "curl" + dmsgweb.RootCmd.Use = "web" + dmsgsocks.RootCmd.Use = "socks" + dmsgmon.RootCmd.Use = "mon" + tpd.RootCmd.Use = "tpd" + tps.RootCmd.Use = "tps" + ar.RootCmd.Use = "ar" + rf.RootCmd.Use = "rf" + confbs.RootCmd.Use = "cb" + kg.RootCmd.Use = "kg" + lc.RootCmd.Use = "lc" + nv.RootCmd.Use = "nv" vpnmon.RootCmd.Use = "vpnm" + pvmon.RootCmd.Use = "pvm" + ssmon.RootCmd.Use = "ssm" + nwmon.RootCmd.Use = "nwmon" + se.RootCmd.Use = "se" + sd.RootCmd.Use = "sd" + sn.RootCmd.Use = "sn" scli.RootCmd.Use = "cli" visor.RootCmd.Use = "visor" + vpns.RootCmd.Use = "vpns" + vpnc.RootCmd.Use = "vpnc" + ssc.RootCmd.Use = "ssc" + ss.RootCmd.Use = "ss" + sc.RootCmd.Use = "sc" + var helpflag bool RootCmd.SetUsageTemplate(help) RootCmd.PersistentFlags().BoolVarP(&helpflag, "help", "h", false, "help for "+RootCmd.Use) @@ -352,56 +379,19 @@ var docCmd = &cobra.Command{ }, } -var commands = []*cobra.Command{ - dmsgptycli.RootCmd, - dmsgptyhost.RootCmd, - dmsgptyui.RootCmd, - dmsgptyCmd, - dmsgdisc.RootCmd, - dmsgserver.RootCmd, - dmsghttp.RootCmd, - dmsgcurl.RootCmd, - dmsgweb.RootCmd, - dmsgCmd, - tpd.RootCmd, - tps.RootCmd, - ar.RootCmd, - rf.RootCmd, - confbs.RootCmd, - kg.RootCmd, - lc.RootCmd, - nv.RootCmd, - pvmon.RootCmd, - se.RootCmd, - sd.RootCmd, - svcCmd, - sn.RootCmd, - visor.RootCmd, - scli.RootCmd, - vpns.RootCmd, - vpnc.RootCmd, - ssc.RootCmd, - ss.RootCmd, - sc.RootCmd, - appsCmd, - RootCmd, -} - func main() { - for _, cmd := range commands { - cc.Init(&cc.Config{ - RootCmd: cmd, - Headings: cc.HiBlue + cc.Bold, - Commands: cc.HiBlue + cc.Bold, - CmdShortDescr: cc.HiBlue, - Example: cc.HiBlue + cc.Italic, - ExecName: cc.HiBlue + cc.Bold, - Flags: cc.HiBlue + cc.Bold, - FlagsDescr: cc.HiBlue, - NoExtraNewlines: true, - NoBottomNewline: true, - }) - } + cc.Init(&cc.Config{ + RootCmd: RootCmd, + Headings: cc.HiBlue + cc.Bold, + Commands: cc.HiBlue + cc.Bold, + CmdShortDescr: cc.HiBlue, + Example: cc.HiBlue + cc.Italic, + ExecName: cc.HiBlue + cc.Bold, + Flags: cc.HiBlue + cc.Bold, + FlagsDescr: cc.HiBlue, + NoExtraNewlines: true, + NoBottomNewline: true, + }) if err := RootCmd.Execute(); err != nil { fmt.Println(err) } diff --git a/cmd/skywire/skywire.go b/cmd/skywire/skywire.go index 3a8e87b01c..49826e2d8f 100644 --- a/cmd/skywire/skywire.go +++ b/cmd/skywire/skywire.go @@ -11,47 +11,55 @@ import ( "github.com/spf13/cobra" "github.com/skycoin/skywire-utilities/pkg/buildinfo" - skychat "github.com/skycoin/skywire/cmd/apps/skychat/commands" - skysocksclient "github.com/skycoin/skywire/cmd/apps/skysocks-client/commands" - skysocks "github.com/skycoin/skywire/cmd/apps/skysocks/commands" - vpnclient "github.com/skycoin/skywire/cmd/apps/vpn-client/commands" - vpnserver "github.com/skycoin/skywire/cmd/apps/vpn-server/commands" - setupnode "github.com/skycoin/skywire/cmd/setup-node/commands" - skywirecli "github.com/skycoin/skywire/cmd/skywire-cli/commands" + sc "github.com/skycoin/skywire/cmd/apps/skychat/commands" + ssc "github.com/skycoin/skywire/cmd/apps/skysocks-client/commands" + ss "github.com/skycoin/skywire/cmd/apps/skysocks/commands" + vpnc "github.com/skycoin/skywire/cmd/apps/vpn-client/commands" + vpns "github.com/skycoin/skywire/cmd/apps/vpn-server/commands" + sn "github.com/skycoin/skywire/cmd/setup-node/commands" + cli "github.com/skycoin/skywire/cmd/skywire-cli/commands" "github.com/skycoin/skywire/pkg/visor" ) func init() { appsCmd.AddCommand( - vpnserver.RootCmd, - vpnclient.RootCmd, - skysocksclient.RootCmd, - skysocks.RootCmd, - skychat.RootCmd, + vpns.RootCmd, + vpnc.RootCmd, + ssc.RootCmd, + ss.RootCmd, + sc.RootCmd, ) - rootCmd.AddCommand( + RootCmd.AddCommand( visor.RootCmd, - skywirecli.RootCmd, - setupnode.RootCmd, + cli.RootCmd, + sn.RootCmd, appsCmd, ) visor.RootCmd.Long = ` ┌─┐┬┌─┬ ┬┬ ┬┬┬─┐┌─┐ ┬ ┬┬┌─┐┌─┐┬─┐ └─┐├┴┐└┬┘││││├┬┘├┤───└┐┌┘│└─┐│ │├┬┘ └─┘┴ ┴ ┴ └┴┘┴┴└─└─┘ └┘ ┴└─┘└─┘┴└─` - setupnode.RootCmd.Use = "sn" + visor.RootCmd.Use = "visor" + cli.RootCmd.Use = "cli" + sn.RootCmd.Use = "sn" + vpns.RootCmd.Use = "vpns" + vpnc.RootCmd.Use = "vpnc" + ssc.RootCmd.Use = "ssc" + ss.RootCmd.Use = "ss" + sc.RootCmd.Use = "sc" var helpflag bool - rootCmd.SetUsageTemplate(help) - rootCmd.PersistentFlags().BoolVarP(&helpflag, "help", "h", false, "help for "+rootCmd.Use) - rootCmd.SetHelpCommand(&cobra.Command{Hidden: true}) - rootCmd.PersistentFlags().MarkHidden("help") //nolint - rootCmd.CompletionOptions.DisableDefaultCmd = true - rootCmd.SetUsageTemplate(help) + RootCmd.SetUsageTemplate(help) + RootCmd.PersistentFlags().BoolVarP(&helpflag, "help", "h", false, "help for "+RootCmd.Use) + RootCmd.SetHelpCommand(&cobra.Command{Hidden: true}) + RootCmd.PersistentFlags().MarkHidden("help") //nolint + RootCmd.CompletionOptions.DisableDefaultCmd = true + RootCmd.SetUsageTemplate(help) } -var rootCmd = &cobra.Command{ +// RootCmd contains skywire-visor, skywire-cli, setup-node, and the visor native apps +var RootCmd = &cobra.Command{ Use: "skywire", Long: ` ┌─┐┬┌─┬ ┬┬ ┬┬┬─┐┌─┐ @@ -64,6 +72,7 @@ var rootCmd = &cobra.Command{ Version: buildinfo.Version(), } +// appsCmd contains the visor native apps var appsCmd = &cobra.Command{ Use: "app", Short: "skywire native applications", @@ -78,34 +87,20 @@ var appsCmd = &cobra.Command{ } func main() { - commands := []*cobra.Command{ - setupnode.RootCmd, - visor.RootCmd, - skywirecli.RootCmd, - vpnserver.RootCmd, - vpnclient.RootCmd, - skysocksclient.RootCmd, - skysocks.RootCmd, - skychat.RootCmd, - appsCmd, - rootCmd, - } - for _, cmd := range commands { - cc.Init(&cc.Config{ - RootCmd: cmd, - Headings: cc.HiBlue + cc.Bold, - Commands: cc.HiBlue + cc.Bold, - CmdShortDescr: cc.HiBlue, - Example: cc.HiBlue + cc.Italic, - ExecName: cc.HiBlue + cc.Bold, - Flags: cc.HiBlue + cc.Bold, - FlagsDescr: cc.HiBlue, - NoExtraNewlines: true, - NoBottomNewline: true, - }) - } - if err := rootCmd.Execute(); err != nil { + cc.Init(&cc.Config{ + RootCmd: RootCmd, + Headings: cc.HiBlue + cc.Bold, + Commands: cc.HiBlue + cc.Bold, + CmdShortDescr: cc.HiBlue, + Example: cc.HiBlue + cc.Italic, + ExecName: cc.HiBlue + cc.Bold, + Flags: cc.HiBlue + cc.Bold, + FlagsDescr: cc.HiBlue, + NoExtraNewlines: true, + NoBottomNewline: true, + }) + if err := RootCmd.Execute(); err != nil { fmt.Println(err) } } diff --git a/go.mod b/go.mod index f6c43caba9..9076bad2e8 100644 --- a/go.mod +++ b/go.mod @@ -165,11 +165,11 @@ require ( // Uncomment for tests with alternate branches of 'dmsg' // replace github.com/skycoin/dmsg => ../dmsg -replace github.com/skycoin/dmsg => github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4 +replace github.com/skycoin/dmsg => github.com/skycoin/dmsg v1.3.18-0.20240306171838-3351bcc4e0ae -replace github.com/skycoin/skywire-services => github.com/skycoin/skywire-services v0.0.0-20240227141813-e2b85b1b4733 +replace github.com/skycoin/skywire-services => github.com/skycoin/skywire-services v0.0.0-20240306165304-177c854f4aec -replace github.com/skycoin/skycoin-service-discovery => github.com/skycoin/skycoin-service-discovery v0.0.0-20240227140413-5cf9b81be037 +replace github.com/skycoin/skycoin-service-discovery => github.com/skycoin/skycoin-service-discovery v0.0.0-20240306165129-2af10aca698e // Uncomment for tests with alternate branches of 'skywire-utilities' // replace github.com/skycoin/skywire-utilities => ../skywire-utilities diff --git a/go.sum b/go.sum index 374a132ca6..b19d289731 100644 --- a/go.sum +++ b/go.sum @@ -434,16 +434,16 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= -github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4 h1:sWspjJ1xySLaEOV2I1IZz3vyx3Fxs5fnxegR3u0mH3k= -github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4/go.mod h1:INEDx+ECwCGQWw/Kd0QcLmSWMhbeRRcfkxj+xATQGFg= +github.com/skycoin/dmsg v1.3.18-0.20240306171838-3351bcc4e0ae h1:DhIVLN77m/XtWdT2dkdiRi3J7rEYUqYMNacZ+26GnpM= +github.com/skycoin/dmsg v1.3.18-0.20240306171838-3351bcc4e0ae/go.mod h1:INEDx+ECwCGQWw/Kd0QcLmSWMhbeRRcfkxj+xATQGFg= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 h1:1Nc5EBY6pjfw1kwW0duwyG+7WliWz5u9kgk1h5MnLuA= github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:UXghlricA7J3aRD/k7p/zBObQfmBawwCxIVPVjz2Q3o= github.com/skycoin/skycoin v0.27.1 h1:HatxsRwVSPaV4qxH6290xPBmkH/HgiuAoY2qC+e8C9I= github.com/skycoin/skycoin v0.27.1/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw= -github.com/skycoin/skycoin-service-discovery v0.0.0-20240227140413-5cf9b81be037 h1:MHJITQuF7a9vUb/CdIVCouIvkEVtIk9pu0d3xZVuRGQ= -github.com/skycoin/skycoin-service-discovery v0.0.0-20240227140413-5cf9b81be037/go.mod h1:h2Yq97wrppNdVgtAhEhY/9w568wS3T6CkK2pWhfUQm0= -github.com/skycoin/skywire-services v0.0.0-20240227141813-e2b85b1b4733 h1:RCIRj0cU1sFcUeqyE/4YlukZu+ayZYroqqgseFqDbn4= -github.com/skycoin/skywire-services v0.0.0-20240227141813-e2b85b1b4733/go.mod h1:XHhlamCQngfgZoEBbDD1KEtfjTjPmBBmxB/tesJYk4E= +github.com/skycoin/skycoin-service-discovery v0.0.0-20240306165129-2af10aca698e h1:y9C5pGHQp/iJFj0QJqr5SboE+Q2RmeYav/AncHOAmWg= +github.com/skycoin/skycoin-service-discovery v0.0.0-20240306165129-2af10aca698e/go.mod h1:h2Yq97wrppNdVgtAhEhY/9w568wS3T6CkK2pWhfUQm0= +github.com/skycoin/skywire-services v0.0.0-20240306165304-177c854f4aec h1:yhD4TOt+5w65we9KPo9N766aWmvxnGQtnD+Dp5k2dsE= +github.com/skycoin/skywire-services v0.0.0-20240306165304-177c854f4aec/go.mod h1:wtdETGZ3hm1DBYEQ/3t5b1apF4mw3heWTZiOisSgIsE= github.com/skycoin/skywire-utilities v1.3.18-0.20240208220612-9f31eda72f33 h1:BzhyKolEWT8cnXZJMxC0TYGCvu3wMYdI6NOpvToN+uQ= github.com/skycoin/skywire-utilities v1.3.18-0.20240208220612-9f31eda72f33/go.mod h1:yFKWpL1bDRPKU3uK+cTF4PnYUMe+eyIj5N2bk4sF5Cw= github.com/skycoin/systray v1.10.0 h1:fQZJHMylpVvfmOOTLvUssfyHVDoC8Idx6Ba2BlLEuGg= diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsg-discovery/commands/dmsg-discovery.go b/vendor/github.com/skycoin/dmsg/cmd/dmsg-discovery/commands/dmsg-discovery.go index c0cb7e0df3..10d5395a82 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsg-discovery/commands/dmsg-discovery.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsg-discovery/commands/dmsg-discovery.go @@ -9,6 +9,7 @@ import ( "net" "net/http" "os" + "path/filepath" "strings" "time" @@ -62,19 +63,24 @@ func init() { RootCmd.Flags().BoolVar(&enableLoadTesting, "enable-load-testing", false, "enable load testing") RootCmd.Flags().BoolVar(&testEnvironment, "test-environment", false, "distinguished between prod and test environment") RootCmd.Flags().Var(&sk, "sk", "dmsg secret key\n") - RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value\r") + RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value") } // RootCmd contains commands for dmsg-discovery var RootCmd = &cobra.Command{ - Use: "disc", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "DMSG Discovery Server", Long: ` ┌┬┐┌┬┐┌─┐┌─┐ ┌┬┐┬┌─┐┌─┐┌─┐┬ ┬┌─┐┬─┐┬ ┬ │││││└─┐│ ┬───│││└─┐│ │ │└┐┌┘├┤ ├┬┘└┬┘ ─┴┘┴ ┴└─┘└─┘ ─┴┘┴└─┘└─┘└─┘ └┘ └─┘┴└─ ┴ - ` + "DMSG Discovery Server", +DMSG Discovery Server +----- depends: redis ----- +skywire cli config gen-keys > dmsgd-config.json +skywire dmsg disc --sk $(tail -n1 dmsgd-config.json)`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/root.go b/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/root.go index 6a1557acac..2c64cc0c60 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/root.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/root.go @@ -2,7 +2,11 @@ package commands import ( + "fmt" "log" + "os" + "path/filepath" + "strings" "github.com/skycoin/skywire-utilities/pkg/buildinfo" "github.com/spf13/cobra" @@ -21,13 +25,17 @@ func init() { // RootCmd contains the root dmsg-server command var RootCmd = &cobra.Command{ - Use: "server", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "DMSG Server", Long: ` ┌┬┐┌┬┐┌─┐┌─┐ ┌─┐┌─┐┬─┐┬ ┬┌─┐┬─┐ ││││││└─┐│ ┬ ─ └─┐├┤ ├┬┘└┐┌┘├┤ ├┬┘ ─┴┘┴ ┴└─┘└─┘ └─┘└─┘┴└─ └┘ └─┘┴└─ - ` + "DMSG Server", +DMSG Server +skywire dmsg server config gen -o dmsg-config.json +skywire dmsg server start dmsg-config.json`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsg-socks5/commands/dmsg-socks5.go b/vendor/github.com/skycoin/dmsg/cmd/dmsg-socks5/commands/dmsg-socks5.go index 0a7e10142c..781531a58a 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsg-socks5/commands/dmsg-socks5.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsg-socks5/commands/dmsg-socks5.go @@ -8,10 +8,12 @@ import ( "net/http" "os" "os/signal" + "path/filepath" "strings" "time" socks5 "github.com/confiant-inc/go-socks5" + "github.com/skycoin/skywire-utilities/pkg/buildinfo" "github.com/skycoin/skywire-utilities/pkg/cipher" "github.com/skycoin/skywire-utilities/pkg/logging" "github.com/skycoin/skywire-utilities/pkg/skyenv" @@ -61,15 +63,28 @@ func init() { } -// RootCmd contains the root dmsghttp command +// RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "proxy", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), + Short: "DMSG socks5 proxy server & client", + Long: ` + ┌┬┐┌┬┐┌─┐┌─┐ ┌─┐┌─┐┌─┐┬┌─┌─┐ + │││││└─┐│ ┬───└─┐│ ││ ├┴┐└─┐ + ─┴┘┴ ┴└─┘└─┘ └─┘└─┘└─┘┴ ┴└─┘ +DMSG socks5 proxy server & client`, + SilenceErrors: true, + SilenceUsage: true, + DisableSuggestions: true, + DisableFlagsInUseLine: true, + Version: buildinfo.Version(), } // serveCmd serves socks5 over dmsg var serveCmd = &cobra.Command{ Use: "server", - Short: "dmsg proxy server", + Short: "dmsg socks5 proxy server", SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, @@ -154,7 +169,7 @@ var serveCmd = &cobra.Command{ // proxyCmd serves the local socks5 proxy var proxyCmd = &cobra.Command{ Use: "client", - Short: "socks5 proxy to connect to socks5 server over dmsg", + Short: "socks5 proxy client for dmsg socks5 proxy server", Run: func(cmd *cobra.Command, args []string) { log := logging.MustGetLogger("ssh-proxy-client") var pubKey cipher.PubKey diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgcurl/commands/dmsgcurl.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgcurl/commands/dmsgcurl.go index df454c5f87..69b6a7c07a 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgcurl/commands/dmsgcurl.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgcurl/commands/dmsgcurl.go @@ -63,13 +63,15 @@ func init() { // RootCmd containsa the root dmsgcurl command var RootCmd = &cobra.Command{ + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "DMSG curl utility", - Use: "dmsgcurl [OPTIONS] ... [URL]", Long: ` ┌┬┐┌┬┐┌─┐┌─┐┌─┐┬ ┬┬─┐┬ │││││└─┐│ ┬│ │ │├┬┘│ ─┴┘┴ ┴└─┘└─┘└─┘└─┘┴└─┴─┘ - ` + "DMSG curl utility", +DMSG curl utility`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsghttp/commands/dmsghttp.go b/vendor/github.com/skycoin/dmsg/cmd/dmsghttp/commands/dmsghttp.go index d5ddbb1882..d478b04edd 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsghttp/commands/dmsghttp.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsghttp/commands/dmsghttp.go @@ -48,13 +48,15 @@ func init() { // RootCmd contains the root dmsghttp command var RootCmd = &cobra.Command{ - Use: "http", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "DMSG http file server", Long: ` ┌┬┐┌┬┐┌─┐┌─┐┬ ┬┌┬┐┌┬┐┌─┐ │││││└─┐│ ┬├─┤ │ │ ├─┘ ─┴┘┴ ┴└─┘└─┘┴ ┴ ┴ ┴ ┴ - ` + "DMSG http file server", +DMSG http file server`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/root.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/root.go index 785ceb3619..ad57f3867a 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/root.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-cli/commands/root.go @@ -4,8 +4,11 @@ package commands import ( "context" "encoding/json" + "fmt" "log" "os" + "path/filepath" + "strings" "github.com/skycoin/skywire-utilities/pkg/buildinfo" "github.com/skycoin/skywire-utilities/pkg/cmdutil" @@ -39,13 +42,15 @@ func init() { // RootCmd contains commands for dmsgpty-cli; which interacts with the dmsgpty-host instance (i.e. skywire-visor) var RootCmd = &cobra.Command{ - Use: "cli", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "DMSG pseudoterminal command line interface", Long: ` ┌┬┐┌┬┐┌─┐┌─┐┌─┐┌┬┐┬ ┬ ┌─┐┬ ┬ │││││└─┐│ ┬├─┘ │ └┬┘───│ │ │ ─┴┘┴ ┴└─┘└─┘┴ ┴ ┴ └─┘┴─┘┴ - ` + "DMSG pseudoterminal command line interface", +DMSG pseudoterminal command line interface`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-host/commands/root.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-host/commands/root.go index 043c791944..13f7ac8a9a 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-host/commands/root.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-host/commands/root.go @@ -8,6 +8,7 @@ import ( "net" "net/http" "os" + "path/filepath" "strconv" "strings" "sync" @@ -70,13 +71,15 @@ func init() { // RootCmd contains commands for dmsgpty-host var RootCmd = &cobra.Command{ - Use: "host", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "DMSG host for pseudoterminal command line interface", Long: ` ┌┬┐┌┬┐┌─┐┌─┐┌─┐┌┬┐┬ ┬ ┬ ┬┌─┐┌─┐┌┬┐ │││││└─┐│ ┬├─┘ │ └┬┘───├─┤│ │└─┐ │ ─┴┘┴ ┴└─┘└─┘┴ ┴ ┴ ┴ ┴└─┘└─┘ ┴ - ` + "DMSG host for pseudoterminal command line interface", +DMSG host for pseudoterminal command line interface`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-ui/commands/dmsgpty-ui.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-ui/commands/dmsgpty-ui.go index 49b828e5a7..69ddad9297 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-ui/commands/dmsgpty-ui.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgpty-ui/commands/dmsgpty-ui.go @@ -2,9 +2,12 @@ package commands import ( + "fmt" "log" "net/http" "os" + "path/filepath" + "strings" "time" "github.com/sirupsen/logrus" @@ -31,7 +34,9 @@ func init() { // RootCmd contains commands to start a dmsgpty-ui server for a dmsgpty-host var RootCmd = &cobra.Command{ - Use: "ui", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "DMSG pseudoterminal GUI", Long: ` ┌┬┐┌┬┐┌─┐┌─┐┌─┐┌┬┐┬ ┬ ┬ ┬┬ diff --git a/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgweb.go b/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgweb.go index 469c1ac250..69809bdd1b 100644 --- a/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgweb.go +++ b/vendor/github.com/skycoin/dmsg/cmd/dmsgweb/commands/dmsgweb.go @@ -10,6 +10,7 @@ import ( "net/http" "os" "os/signal" + "path/filepath" "regexp" "strings" "sync" @@ -94,13 +95,15 @@ func init() { // RootCmd contains the root command for dmsgweb var RootCmd = &cobra.Command{ - Use: "web", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "DMSG resolving proxy & browser client", Long: ` ┌┬┐┌┬┐┌─┐┌─┐┬ ┬┌─┐┌┐ │││││└─┐│ ┬│││├┤ ├┴┐ ─┴┘┴ ┴└─┘└─┘└┴┘└─┘└─┘ - ` + "DMSG resolving proxy & browser client - access websites over dmsg", +DMSG resolving proxy & browser client - access websites over dmsg`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, diff --git a/vendor/github.com/skycoin/skycoin-service-discovery/cmd/service-discovery/commands/root.go b/vendor/github.com/skycoin/skycoin-service-discovery/cmd/service-discovery/commands/root.go index 0c8f40ba28..253c83d902 100644 --- a/vendor/github.com/skycoin/skycoin-service-discovery/cmd/service-discovery/commands/root.go +++ b/vendor/github.com/skycoin/skycoin-service-discovery/cmd/service-discovery/commands/root.go @@ -5,6 +5,7 @@ import ( "context" "fmt" "os" + "path/filepath" "strings" "time" @@ -57,20 +58,26 @@ func init() { RootCmd.Flags().StringVarP(&whitelistKeys, "whitelist-keys", "w", "", "list of whitelisted keys of network monitor used for deregistration") RootCmd.Flags().BoolVarP(&testMode, "test", "t", false, "run in test mode and disable auth") RootCmd.Flags().StringVarP(&apiKey, "api-key", "g", "", "geo API key") - RootCmd.Flags().StringVarP(&dmsgDisc, "dmsg-disc", "d", "", "url of dmsg-discovery default:\n"+skyenv.DmsgDiscAddr) + RootCmd.Flags().StringVarP(&dmsgDisc, "dmsg-disc", "d", skyenv.DmsgDiscAddr, "url of dmsg-discovery") RootCmd.Flags().BoolVarP(&testEnvironment, "test-environment", "n", false, "distinguished between prod and test environment") RootCmd.Flags().VarP(&sk, "sk", "s", "dmsg secret key\n") - RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value\r") + RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value") } // RootCmd contains the root service-discovery command var RootCmd = &cobra.Command{ - Use: "sd", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Service discovery server", Long: ` ┌─┐┌─┐┬─┐┬ ┬┬┌─┐┌─┐ ┌┬┐┬┌─┐┌─┐┌─┐┬ ┬┌─┐┬─┐┬ ┬ └─┐├┤ ├┬┘└┐┌┘││ ├┤───│││└─┐│ │ │└┐┌┘├┤ ├┬┘└┬┘ - └─┘└─┘┴└─ └┘ ┴└─┘└─┘ ─┴┘┴└─┘└─┘└─┘ └┘ └─┘┴└─ ┴ `, + └─┘└─┘┴└─ └┘ ┴└─┘└─┘ ─┴┘┴└─┘└─┘└─┘ └┘ └─┘┴└─ ┴ +----- depends: redis, postgresql and initial DB setup ----- +sudo -iu postgres createdb sd +keys-gen | tee sd-config.json +PG_USER="postgres" PG_DATABASE="sd" PG_PASSWORD="" service-discovery --sk $(tail -n1 sd-config.json)`, Run: func(_ *cobra.Command, _ []string) { if dmsgDisc == "" { dmsgDisc = skyenv.DmsgDiscAddr diff --git a/vendor/github.com/skycoin/skywire-services/cmd/address-resolver/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/address-resolver/commands/root.go index 37f0056cd6..7ffc13eca5 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/address-resolver/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/address-resolver/commands/root.go @@ -7,9 +7,11 @@ import ( "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" @@ -66,16 +68,30 @@ func init() { RootCmd.Flags().BoolVar(&testEnvironment, "test-environment", false, "distinguished between prod and test environment\033[0m") RootCmd.Flags().Var(&sk, "sk", "dmsg secret key\r") RootCmd.Flags().Uint16Var(&dmsgPort, "dmsgPort", dmsg.DefaultDmsgHTTPPort, "dmsg port value\r") + var helpflag bool + RootCmd.SetUsageTemplate(help) + RootCmd.PersistentFlags().BoolVarP(&helpflag, "help", "h", false, "help for address-resolver") + RootCmd.SetHelpCommand(&cobra.Command{Hidden: true}) + RootCmd.PersistentFlags().MarkHidden("help") //nolint } // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "ar", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Address Resolver Server for skywire", Long: ` ┌─┐┌┬┐┌┬┐┬─┐┌─┐┌─┐┌─┐ ┬─┐┌─┐┌─┐┌─┐┬ ┬ ┬┌─┐┬─┐ ├─┤ ││ ││├┬┘├┤ └─┐└─┐───├┬┘├┤ └─┐│ ││ └┐┌┘├┤ ├┬┘ - ┴ ┴─┴┘─┴┘┴└─└─┘└─┘└─┘ ┴└─└─┘└─┘└─┘┴─┘└┘ └─┘┴└─`, + ┴ ┴─┴┘─┴┘┴└─└─┘└─┘└─┘ ┴└─└─┘└─┘└─┘┴─┘└┘ └─┘┴└─ + +depends: redis + +Note: the specified port must be accessible from the internet ip address or port forwarded for udp +skywire cli config gen-keys > ar-config.json +skywire svc ar --addr ":9093" --redis "redis://localhost:6379" --sk $(tail -n1 ar-config.json) +`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, @@ -227,8 +243,31 @@ var RootCmd = &cobra.Command{ // Execute executes root CLI command. func Execute() { + cc.Init(&cc.Config{ + RootCmd: RootCmd, + Headings: cc.HiBlue + cc.Bold, //+ cc.Underline, + Commands: cc.HiBlue + cc.Bold, + CmdShortDescr: cc.HiBlue, + Example: cc.HiBlue + cc.Italic, + ExecName: cc.HiBlue + cc.Bold, + Flags: cc.HiBlue + cc.Bold, + //FlagsDataType: cc.HiBlue, + FlagsDescr: cc.HiBlue, + NoExtraNewlines: true, + NoBottomNewline: true, + }) if err := RootCmd.Execute(); err != nil { log.Fatal("Failed to execute command: ", err) } } + +const help = "Usage:\r\n" + + " {{.UseLine}}{{if .HasAvailableSubCommands}}{{end}} {{if gt (len .Aliases) 0}}\r\n\r\n" + + "{{.NameAndAliases}}{{end}}{{if .HasAvailableSubCommands}}\r\n\r\n" + + "Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand)}}\r\n " + + "{{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}\r\n\r\n" + + "Flags:\r\n" + + "{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}\r\n\r\n" + + "Global Flags:\r\n" + + "{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}\r\n\r\n" diff --git a/vendor/github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands/root.go index 3f78c22081..658d07b18d 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands/root.go @@ -8,6 +8,8 @@ import ( "io" "log" "os" + "path/filepath" + "strings" "github.com/skycoin/dmsg/pkg/direct" "github.com/skycoin/dmsg/pkg/dmsg" @@ -44,7 +46,9 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "cb", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Config Bootstrap Server for skywire", Long: ` ┌─┐┌─┐┌┐┌┌─┐┬┌─┐ ┌┐ ┌─┐┌─┐┌┬┐┌─┐┌┬┐┬─┐┌─┐┌─┐┌─┐┌─┐┬─┐ diff --git a/vendor/github.com/skycoin/skywire-services/cmd/dmsg-monitor/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/dmsg-monitor/commands/root.go index ae00e5e127..876e3bd5fa 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/dmsg-monitor/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/dmsg-monitor/commands/root.go @@ -3,9 +3,12 @@ package commands import ( "context" + "fmt" "log" "log/syslog" "os" + "path/filepath" + "strings" "time" logrussyslog "github.com/sirupsen/logrus/hooks/syslog" @@ -33,7 +36,7 @@ var ( func init() { RootCmd.Flags().StringVarP(&addr, "addr", "a", ":9080", "address to bind to.\033[0m") - RootCmd.Flags().DurationVarP(&sleepDeregistration, "sleep-deregistration", "s", 10, "Sleep time for derigstration process in minutes\033[0m") + RootCmd.Flags().DurationVarP(&sleepDeregistration, "sleep-deregistration", "s", 60, "Sleep time for derigstration process in minutes\033[0m") RootCmd.Flags().IntVarP(&batchSize, "batchsize", "b", 20, "Batch size of deregistration\033[0m") RootCmd.Flags().StringVarP(&confPath, "config", "c", "dmsg-monitor.json", "config file location.\033[0m") RootCmd.Flags().StringVarP(&dmsgURL, "dmsg-url", "d", "", "url to dmsg data.\033[0m") @@ -45,12 +48,15 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "mon", - Short: "DMSG monitor of DMSG discoery.", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), + Short: "DMSG monitor of DMSG discovery entries.", Long: ` ┌┬┐┌┬┐┌─┐┌─┐ ┌┬┐┌─┐┌┐┌┬┌┬┐┌─┐┬─┐ │││││└─┐│ ┬───││││ │││││ │ │ │├┬┘ - ─┴┘┴ ┴└─┘└─┘ ┴ ┴└─┘┘└┘┴ ┴ └─┘┴└─`, + ─┴┘┴ ┴└─┘└─┘ ┴ ┴└─┘┘└┘┴ ┴ └─┘┴└─ +`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, diff --git a/vendor/github.com/skycoin/skywire-services/cmd/keys-gen/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/keys-gen/commands/root.go index abe107b357..c03e124949 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/keys-gen/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/keys-gen/commands/root.go @@ -4,6 +4,9 @@ package commands import ( "fmt" "log" + "os" + "path/filepath" + "strings" "github.com/skycoin/skywire-utilities/pkg/buildinfo" "github.com/skycoin/skywire-utilities/pkg/cipher" @@ -12,7 +15,9 @@ import ( // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "kg", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "skywire keys generator, prints pub-key and sec-key", Long: ` ┬┌─┌─┐┬ ┬┌─┐ ┌─┐┌─┐┌┐┌ diff --git a/vendor/github.com/skycoin/skywire-services/cmd/liveness-checker/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/liveness-checker/commands/root.go index 12ef4f3395..d55f759739 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/liveness-checker/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/liveness-checker/commands/root.go @@ -3,9 +3,11 @@ package commands import ( "context" + "fmt" "log" "log/syslog" "os" + "path/filepath" "strings" logrussyslog "github.com/sirupsen/logrus/hooks/syslog" @@ -46,7 +48,9 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "lc", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Liveness checker of the deployment.", Long: ` ┬ ┬┬ ┬┌─┐┌┐┌┌─┐┌─┐┌─┐ ┌─┐┬ ┬┌─┐┌─┐┬┌─┌─┐┬─┐ diff --git a/vendor/github.com/skycoin/skywire-services/cmd/network-monitor/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/network-monitor/commands/root.go index 24ae39d0e3..acf8776bb3 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/network-monitor/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/network-monitor/commands/root.go @@ -3,9 +3,11 @@ package commands import ( "context" + "fmt" "log" "log/syslog" "os" + "path/filepath" "strings" "time" @@ -64,7 +66,9 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "mn", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Network monitor for skywire VPN and Visor.", Long: ` ┌┐┌┌─┐┌┬┐┬ ┬┌─┐┬─┐┬┌─ ┌┬┐┌─┐┌┐┌┬┌┬┐┌─┐┬─┐ diff --git a/vendor/github.com/skycoin/skywire-services/cmd/node-visualizer/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/node-visualizer/commands/root.go index 7ea196e433..b3a45311b3 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/node-visualizer/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/node-visualizer/commands/root.go @@ -3,10 +3,13 @@ package commands import ( "context" + "fmt" "log" "log/syslog" "net/http" "os" + "path/filepath" + "strings" "time" logrussyslog "github.com/sirupsen/logrus/hooks/syslog" @@ -40,7 +43,9 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "nv", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Node Visualizer Server for skywire", Long: ` ┌┐┌┌─┐┌┬┐┌─┐ ┬ ┬┬┌─┐┬ ┬┌─┐┬ ┬┌─┐┌─┐┬─┐ diff --git a/vendor/github.com/skycoin/skywire-services/cmd/public-visor-monitor/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/public-visor-monitor/commands/root.go index 0c04d028b2..dcf1e9daec 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/public-visor-monitor/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/public-visor-monitor/commands/root.go @@ -3,8 +3,11 @@ package commands import ( "context" + "fmt" "log" "os" + "path/filepath" + "strings" "time" "github.com/skycoin/skywire-utilities/pkg/buildinfo" @@ -35,7 +38,9 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "pvm", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Public Visor monitor.", Long: ` ┌─┐┬ ┬┌┐ ┬ ┬┌─┐ ┬ ┬┬┌─┐┌─┐┬─┐ ┌┬┐┌─┐┌┐┌┬┌┬┐┌─┐┬─┐ diff --git a/vendor/github.com/skycoin/skywire-services/cmd/route-finder/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/route-finder/commands/root.go index de8731ebe9..df929fbd08 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/route-finder/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/route-finder/commands/root.go @@ -7,6 +7,8 @@ import ( "log" "log/syslog" "os" + "path/filepath" + "strings" "time" logrussyslog "github.com/sirupsen/logrus/hooks/syslog" @@ -58,12 +60,18 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "rf", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Route Finder Server for skywire", Long: ` ┬─┐┌─┐┬ ┬┌┬┐┌─┐ ┌─┐┬┌┐┌┌┬┐┌─┐┬─┐ ├┬┘│ ││ │ │ ├┤───├┤ ││││ ││├┤ ├┬┘ - ┴└─└─┘└─┘ ┴ └─┘ └ ┴┘└┘─┴┘└─┘┴└─`, + ┴└─└─┘└─┘ ┴ └─┘ └ ┴┘└┘─┴┘└─┘┴└─ +----- depends: postgres and initial db setup ----- +sudo -iu postgres createdb rf +skywire cli config gen-keys | tee rf-config.json +PG_USER="postgres" PG_DATABASE="rf" PG_PASSWORD="" route-finder --addr ":9092" --sk $(tail -n1 rf-config.json)`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, diff --git a/vendor/github.com/skycoin/skywire-services/cmd/skysocks-monitor/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/skysocks-monitor/commands/root.go index 17a110009e..9ad2551905 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/skysocks-monitor/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/skysocks-monitor/commands/root.go @@ -3,8 +3,11 @@ package commands import ( "context" + "fmt" "log" "os" + "path/filepath" + "strings" "time" "github.com/skycoin/skywire-utilities/pkg/buildinfo" @@ -33,7 +36,9 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "skysocksmon", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Skysocks monitor.", Long: ` ┌─┐┬┌─┬ ┬┌─┐┌─┐┌─┐┬┌─┌─┐ ┌┬┐┌─┐┌┐┌┬┌┬┐┌─┐┬─┐ diff --git a/vendor/github.com/skycoin/skywire-services/cmd/sw-env/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/sw-env/commands/root.go index f5688e9a9c..f9283b368b 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/sw-env/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/sw-env/commands/root.go @@ -4,6 +4,9 @@ package commands import ( "fmt" "log" + "os" + "path/filepath" + "strings" "github.com/skycoin/skywire-utilities/pkg/buildinfo" "github.com/spf13/cobra" @@ -13,7 +16,9 @@ import ( // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "swe", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "skywire environment generator", Long: ` ┌─┐┬ ┬ ┌─┐┌┐┌┬ ┬ diff --git a/vendor/github.com/skycoin/skywire-services/cmd/transport-discovery/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/transport-discovery/commands/root.go index 488063ecae..af90bfa297 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/transport-discovery/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/transport-discovery/commands/root.go @@ -7,6 +7,7 @@ import ( "log" "log/syslog" "os" + "path/filepath" "strings" "time" @@ -75,12 +76,18 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "tpd", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Transport Discovery Server for skywire", Long: ` ┌┬┐┬─┐┌─┐┌┐┌┌─┐┌─┐┌─┐┬─┐┌┬┐ ┌┬┐┬┌─┐┌─┐┌─┐┬ ┬┌─┐┬─┐┬ ┬ │ ├┬┘├─┤│││└─┐├─┘│ │├┬┘ │───│││└─┐│ │ │└┐┌┘├┤ ├┬┘└┬┘ - ┴ ┴└─┴ ┴┘└┘└─┘┴ └─┘┴└─ ┴ ─┴┘┴└─┘└─┘└─┘ └┘ └─┘┴└─ ┴ `, + ┴ ┴└─┴ ┴┘└┘└─┘┴ └─┘┴└─ ┴ ─┴┘┴└─┘└─┘└─┘ └┘ └─┘┴└─ ┴ +----- depends: redis, postgresql and initial DB setup ----- +sudo -iu postgres createdb tpd +keys-gen | tee tpd-config.json +PG_USER="postgres" PG_DATABASE="tpd" PG_PASSWORD="" transport-discovery --sk $(tail -n1 tpd-config.json)`, SilenceErrors: true, SilenceUsage: true, DisableSuggestions: true, diff --git a/vendor/github.com/skycoin/skywire-services/cmd/transport-setup/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/transport-setup/commands/root.go index 5988116b10..1f71356f99 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/transport-setup/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/transport-setup/commands/root.go @@ -5,6 +5,9 @@ import ( "fmt" "log" "net/http" + "os" + "path/filepath" + "strings" "time" "github.com/skycoin/skywire-utilities/pkg/buildinfo" @@ -27,7 +30,9 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "tps [config.json]", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "Transport setup server for skywire", Long: ` ┌┬┐┬─┐┌─┐┌┐┌┌─┐┌─┐┌─┐┬─┐┌┬┐ ┌─┐┌─┐┌┬┐┬ ┬┌─┐ diff --git a/vendor/github.com/skycoin/skywire-services/cmd/vpn-monitor/commands/root.go b/vendor/github.com/skycoin/skywire-services/cmd/vpn-monitor/commands/root.go index 4af2d45a57..42ebcb8618 100644 --- a/vendor/github.com/skycoin/skywire-services/cmd/vpn-monitor/commands/root.go +++ b/vendor/github.com/skycoin/skywire-services/cmd/vpn-monitor/commands/root.go @@ -3,8 +3,11 @@ package commands import ( "context" + "fmt" "log" "os" + "path/filepath" + "strings" "time" "github.com/skycoin/skywire-utilities/pkg/buildinfo" @@ -33,7 +36,9 @@ func init() { // RootCmd contains the root command var RootCmd = &cobra.Command{ - Use: "vpnmon", + Use: func() string { + return strings.Split(filepath.Base(strings.ReplaceAll(strings.ReplaceAll(fmt.Sprintf("%v", os.Args), "[", ""), "]", "")), " ")[0] + }(), Short: "VPN monitor.", Long: ` ┬ ┬┌─┐┌┐┌ ┌┬┐┌─┐┌┐┌┬┌┬┐┌─┐┬─┐ diff --git a/vendor/github.com/skycoin/skywire-services/pkg/dmsg-monitor/api/api.go b/vendor/github.com/skycoin/skywire-services/pkg/dmsg-monitor/api/api.go index 766ad35bdc..d377aafb88 100644 --- a/vendor/github.com/skycoin/skywire-services/pkg/dmsg-monitor/api/api.go +++ b/vendor/github.com/skycoin/skywire-services/pkg/dmsg-monitor/api/api.go @@ -302,7 +302,7 @@ func (api *API) deregisterRequest(keys []string, rawReqURL, service string) erro type clientList []string func getClients(dmsgURL string) (data clientList, err error) { - res, err := http.Get(dmsgURL + "/dmsg-discovery/entries") //nolint + res, err := http.Get(dmsgURL + "/dmsg-discovery/visorEntries") //nolint if err != nil { return nil, err diff --git a/vendor/modules.txt b/vendor/modules.txt index cc1cb0e41c..293c4fe7d3 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -451,7 +451,7 @@ github.com/rs/cors ## 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 +# github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4 => github.com/skycoin/dmsg v1.3.18-0.20240306171838-3351bcc4e0ae ## explicit; go 1.21 github.com/skycoin/dmsg/cmd/dmsg-discovery/commands github.com/skycoin/dmsg/cmd/dmsg-server/commands @@ -492,14 +492,14 @@ github.com/skycoin/skycoin/src/cipher/ripemd160 github.com/skycoin/skycoin/src/cipher/secp256k1-go github.com/skycoin/skycoin/src/cipher/secp256k1-go/secp256k1-go2 github.com/skycoin/skycoin/src/util/logging -# github.com/skycoin/skycoin-service-discovery v0.0.0-20231221001759-d1af6ec27db1 => github.com/skycoin/skycoin-service-discovery v0.0.0-20240227140413-5cf9b81be037 +# github.com/skycoin/skycoin-service-discovery v0.0.0-20231221001759-d1af6ec27db1 => github.com/skycoin/skycoin-service-discovery v0.0.0-20240306165129-2af10aca698e ## explicit; go 1.21 github.com/skycoin/skycoin-service-discovery/cmd/service-discovery/commands github.com/skycoin/skycoin-service-discovery/internal/pg github.com/skycoin/skycoin-service-discovery/internal/sdmetrics github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/api github.com/skycoin/skycoin-service-discovery/pkg/service-discovery/store -# github.com/skycoin/skywire-services v0.0.0-20240207001624-ebee7346e526 => github.com/skycoin/skywire-services v0.0.0-20240227141813-e2b85b1b4733 +# github.com/skycoin/skywire-services v0.0.0-20240207001624-ebee7346e526 => github.com/skycoin/skywire-services v0.0.0-20240306165304-177c854f4aec ## explicit; go 1.21 github.com/skycoin/skywire-services/cmd/address-resolver/commands github.com/skycoin/skywire-services/cmd/config-bootstrapper/commands @@ -829,6 +829,6 @@ nhooyr.io/websocket/internal/bpool nhooyr.io/websocket/internal/errd nhooyr.io/websocket/internal/wsjs nhooyr.io/websocket/internal/xsync -# github.com/skycoin/dmsg => github.com/skycoin/dmsg v1.3.18-0.20240226072009-86c43e8d4ca4 -# github.com/skycoin/skywire-services => github.com/skycoin/skywire-services v0.0.0-20240227141813-e2b85b1b4733 -# github.com/skycoin/skycoin-service-discovery => github.com/skycoin/skycoin-service-discovery v0.0.0-20240227140413-5cf9b81be037 +# github.com/skycoin/dmsg => github.com/skycoin/dmsg v1.3.18-0.20240306171838-3351bcc4e0ae +# github.com/skycoin/skywire-services => github.com/skycoin/skywire-services v0.0.0-20240306165304-177c854f4aec +# github.com/skycoin/skycoin-service-discovery => github.com/skycoin/skycoin-service-discovery v0.0.0-20240306165129-2af10aca698e