Skip to content

Commit

Permalink
Merge pull request #1132 from the-skycoin-project/refine-skywire-cli
Browse files Browse the repository at this point in the history
Group skywire-cli visor subcommands
  • Loading branch information
jdknives authored Apr 6, 2022
2 parents 5505708 + dbe524d commit 4aa8295
Show file tree
Hide file tree
Showing 124 changed files with 6,754 additions and 3,062 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/skywire.json
/apps/
/skywire/
/local*
/local/*
/transport_logs
/dmsgpty

Expand Down
35 changes: 34 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,43 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed
- config updated to `v1.1.1`
- remove dsmghttp migration to skywire-visor starting
- only support current version of config
- config version reflects current visor version
- refine and restructure help commands user interface
- shorthand flags for commands
- group skywire-cli visor subcommands
- hide excess flags
- make help text fit within default 80x24 terminal
- rename `skywire-cli config gen -r --replace` flag to `-r --regen`
- remove config path from V1 struct
- remove all instance of the visor writing to the config file except via api
- remove path to dmsghttp-config.json from config
- revise versioning - move to skyenv
- remove transports cache from visor initialization and check them before make route

### Added
- added `add-rhv` and `disable-rhv` flags to `skywire-visor` for adding remote hypervisor PK and disable remote hypervisor PK(s) on config file
- shorthand flags for commands
- blue & white color scheme with coloredcobra
- ascii art text modal of program name to help menus
- `--all` flag to skywire-cli & visor to show extra flags
- `skywire-cli config gen -n --stdout` write config to stdout
- `skywire-cli config gen -w, --hide` dont print the config to the terminal
- `skywire-cli config gen --print` parse test ; read config from file & print
- `skywire-cli config gen -a, --url` services conf (default "conf.skywire.skycoin.com")
- fetch service from endpoint
- `skywire-cli visor app` app settings command
- `skywire-cli visor route` view and set rules command
- `skywire-cli visor tp` view and set transports command
- `skywire-cli visor vpn` vpn interface command
- create global varibles for config path, working dir, path to running binary
- root permissions detection
- error on different version config / visor
- display update command on config version error
- support for piping config generated by skywire-cli to skywire-visor via stdin
- BuildInfo global variable to skyenv
- support for detecting skywire version when `go run`


## 0.6.0

Expand Down Expand Up @@ -80,7 +113,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## 0.2.0 - 2020.04.02

### Added
### Added

- added `--retain-keys` flag to `skywire-cli visor gen-config` command
- added `--secret-key` flag to `skywire-cli visor gen-config` command
Expand Down
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,23 @@ BUILDINFO_COMMIT := -X $(BUILDINFO_PATH).commit=$(COMMIT)
BUILDTAGINFO := -X $(PROJECT_BASE)/pkg/visor.BuildTag=$(BUILDTAG)

BUILDINFO?=$(BUILDINFO_VERSION) $(BUILDINFO_DATE) $(BUILDINFO_COMMIT) $(BUILDTAGINFO)
INFO?=$(VERSION) $(DATE) $(COMMIT) $(BUILDTAG)

BUILD_OPTS?="-ldflags=$(BUILDINFO)" -mod=vendor $(RACE_FLAG)
BUILD_OPTS_DEPLOY?="-ldflags=$(BUILDINFO) -w -s"

buildinfo:
@echo $(INFO)

version:
@echo $(VERSION)

date:
@echo $(DATE)

commit:
@echo $(COMMIT)

check: lint test ## Run linters and tests

check-windows: lint-windows test-windows ## Run linters and tests on appveyor windows image
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/skychat/chat.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ import (
"github.com/skycoin/skywire-utilities/pkg/buildinfo"
"github.com/skycoin/skywire-utilities/pkg/cipher"
"github.com/skycoin/skywire-utilities/pkg/netutil"
"github.com/skycoin/skywire-utilities/pkg/skyenv"
"github.com/skycoin/skywire/pkg/app"
"github.com/skycoin/skywire/pkg/app/appnet"
"github.com/skycoin/skywire/pkg/routing"
"github.com/skycoin/skywire/pkg/skyenv"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/skysocks-client/skysocks-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import (
"github.com/skycoin/skywire-utilities/pkg/buildinfo"
"github.com/skycoin/skywire-utilities/pkg/cipher"
"github.com/skycoin/skywire-utilities/pkg/netutil"
"github.com/skycoin/skywire-utilities/pkg/skyenv"
"github.com/skycoin/skywire/internal/skysocks"
"github.com/skycoin/skywire/pkg/app"
"github.com/skycoin/skywire/pkg/app/appnet"
"github.com/skycoin/skywire/pkg/routing"
"github.com/skycoin/skywire/pkg/skyenv"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/skysocks/skysocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import (
"github.com/sirupsen/logrus"

"github.com/skycoin/skywire-utilities/pkg/buildinfo"
"github.com/skycoin/skywire-utilities/pkg/skyenv"
"github.com/skycoin/skywire/internal/skysocks"
"github.com/skycoin/skywire/pkg/app"
"github.com/skycoin/skywire/pkg/app/appnet"
"github.com/skycoin/skywire/pkg/routing"
"github.com/skycoin/skywire/pkg/skyenv"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/vpn-client/vpn-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
ipc "github.com/james-barrow/golang-ipc"

"github.com/skycoin/skywire-utilities/pkg/cipher"
"github.com/skycoin/skywire-utilities/pkg/skyenv"
"github.com/skycoin/skywire/internal/vpn"
"github.com/skycoin/skywire/pkg/app"
"github.com/skycoin/skywire/pkg/app/appevent"
"github.com/skycoin/skywire/pkg/skyenv"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion cmd/apps/vpn-server/vpn-server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import (
"github.com/sirupsen/logrus"

"github.com/skycoin/skywire-utilities/pkg/cipher"
"github.com/skycoin/skywire-utilities/pkg/skyenv"
"github.com/skycoin/skywire/internal/vpn"
"github.com/skycoin/skywire/pkg/app"
"github.com/skycoin/skywire/pkg/app/appnet"
"github.com/skycoin/skywire/pkg/routing"
"github.com/skycoin/skywire/pkg/skyenv"
)

const (
Expand Down
19 changes: 19 additions & 0 deletions cmd/setup-node/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io/ioutil"
"os"

cc "github.com/ivanpirog/coloredcobra"
"github.com/sirupsen/logrus"
"github.com/skycoin/skycoin/src/util/logging"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -37,6 +38,11 @@ func init() {
var rootCmd = &cobra.Command{
Use: "setup-node [config.json]",
Short: "Route Setup Node for skywire",
Long: `
┌─┐┌─┐┌┬┐┬ ┬┌─┐ ┌┐┌┌─┐┌┬┐┌─┐
└─┐├┤ │ │ │├─┘───││││ │ ││├┤
└─┘└─┘ ┴ └─┘┴ ┘└┘└─┘─┴┘└─┘`,

Run: func(_ *cobra.Command, args []string) {
mLog := logging.NewMasterLogger()
log := logging.MustGetLogger(tag)
Expand Down Expand Up @@ -117,6 +123,19 @@ func prepareMetrics(log logrus.FieldLogger) setupmetrics.Metrics {

// Execute executes root CLI command.
func Execute() {
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,
FlagsDataType: cc.HiBlue,
FlagsDescr: cc.HiBlue,
NoExtraNewlines: true,
NoBottomNewline: true,
})
if err := rootCmd.Execute(); err != nil {
panic(err)
}
Expand Down
Loading

0 comments on commit 4aa8295

Please sign in to comment.