Skip to content

Commit

Permalink
Merge pull request #1147 from the-skycoin-project/x
Browse files Browse the repository at this point in the history
add makefile directives
  • Loading branch information
mrpalide committed Apr 8, 2022
2 parents 4ca662d + b47282d commit fb0bf3a
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 16 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- 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
- config version reflects current visor version (`0.6.0`)
- refine and restructure help commands user interface
- shorthand flags for commands
- group skywire-cli visor subcommands
Expand All @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- 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
- `run-source` makefile directive write config to stdout & read config from stdin

### 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
Expand All @@ -45,7 +46,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- 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`

- `run-vpnsrv` makefile directive
- `run-source-test` makefile directive
- `run-vpnsrv-test` makefile directive
- `run-source-dmsghttp` makefile directive
- `run-source-dmsghttp-test` makefile directive
- `run-vpnsrv-dmsghttp` makefile directive
- `run-vpnsrv -dmsghttp-test` makefile directive

## 0.6.0

Expand Down
62 changes: 59 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,71 @@ install-deps-ui: ## Install the UI dependencies
cd $(MANAGER_UI_DIR) && npm ci

run: ## Run skywire visor with skywire-config.json, and start a browser if running a hypervisor
./skywire-visor -c ./skywire-config.json
./skywire-visor -bc ./skywire-config.json

## Run skywire from source, without compiling binaries - requires skywire cloned
run-source:
test -d apps && rm -r apps || true
ln -s scripts/_apps apps
chmod +x apps/*
go run ./cmd/skywire-cli/skywire-cli.go config gen -ibro ./skywire-config.json
go run ./cmd/skywire-visor/skywire-visor.go -c ./skywire-config.json || true
sudo echo "sudo cache"
go run ./cmd/skywire-cli/skywire-cli.go config gen -in | go run ./cmd/skywire-visor/skywire-visor.go -nb || true

## Run skywire from source, without compiling binaries - requires skywire cloned
run-vpnsrv:
test -d apps && rm -r apps || true
ln -s scripts/_apps apps
chmod +x apps/*
sudo echo "sudo cache"
go run ./cmd/skywire-cli/skywire-cli.go config gen -in --servevpn | go run ./cmd/skywire-visor/skywire-visor.go -nb || true

## Run skywire from source with test endpoints
run-source-test:
test -d apps && rm -r apps || true
ln -s scripts/_apps apps
chmod +x apps/*
sudo echo "sudo cache"
go run ./cmd/skywire-cli/skywire-cli.go config gen -nit | go run ./cmd/skywire-visor/skywire-visor.go -nb || true

## Run skywire from source, with vpn server enabled
run-vpnsrv-test:
test -d apps && rm -r apps || true
ln -s scripts/_apps apps
chmod +x apps/*
sudo echo "sudo cache"
go run ./cmd/skywire-cli/skywire-cli.go config gen -nit --servevpn | go run ./cmd/skywire-visor/skywire-visor.go -nb || true

## Run skywire from source with dmsghttp config
run-source-dmsghttp:
test -d apps && rm -r apps || true
ln -s scripts/_apps apps
chmod +x apps/*
sudo echo "sudo cache"
go run ./cmd/skywire-cli/skywire-cli.go config gen -din | go run ./cmd/skywire-visor/skywire-visor.go -nb || true

## Run skywire from source with dmsghttp config and vpn server
run-vpnsrv-dmsghttp:
test -d apps && rm -r apps || true
ln -s scripts/_apps apps
chmod +x apps/*
sudo echo "sudo cache"
go run ./cmd/skywire-cli/skywire-cli.go config gen -din --servevpn | go run ./cmd/skywire-visor/skywire-visor.go -nb || true

## Run skywire from source with dmsghttp config and test endpoints
run-source-dmsghttp-test:
test -d apps && rm -r apps || true
ln -s scripts/_apps apps
chmod +x apps/*
sudo echo "sudo cache"
go run ./cmd/skywire-cli/skywire-cli.go config gen -dint | go run ./cmd/skywire-visor/skywire-visor.go -nb || true

## Run skywire from source with dmsghttp config, vpn server, and test endpoints
run-vpnsrv-dmsghttp-test:
test -d apps && rm -r apps || true
ln -s scripts/_apps apps
chmod +x apps/*
sudo echo "sudo cache"
go run ./cmd/skywire-cli/skywire-cli.go config gen -dint --servevpn | go run ./cmd/skywire-visor/skywire-visor.go -nb || true

lint-ui: ## Lint the UI code
cd $(MANAGER_UI_DIR) && npm run lint
Expand Down
1 change: 1 addition & 0 deletions apps
22 changes: 12 additions & 10 deletions cmd/skywire-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,10 @@ Flags:
-v, --servevpn enable vpn server
-w, --hide dont print the config to the terminal
-x, --retainhv retain existing hypervisors with regen
--version string custom version testing override
--print string parse test ; read config from file & print
-h, --help help for gen
```

##### Example defaults
Expand All @@ -163,10 +165,10 @@ cd $GOPATH/src/github.com/skycoin/skywire && skywire-cli config gen
```
$ cd $GOPATH/src/github.com/skycoin/skywire && skywire-cli config gen
[2022-04-02T18:19:57-05:00] INFO []: Fetched service endpoints from 'http://conf.skywire.skycoin.com'
[2022-04-02T18:19:57-05:00] INFO [visor:config]: Flushing config to file. config_version="0.6.1" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json"
[2022-04-02T18:19:57-05:00] INFO [visor:config]: Flushing config to file. config_version="0.6.0" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json"
[2022-04-02T18:19:57-05:00] INFO [skywire-cli]: Updated file '/home/user/go/src/github.com/skycoin/skywire/skywire-config.json' to:
{
"version": "0.6.1",
"version": "0.6.0",
"sk": "1d9bdf39d1f0bafb0eef0c3c8189cfceb49f3819e4ec45b9018d6993856341f7",
"pk": "032268ff324790954145d3bdaa9eb936fa400bd7d12de78251d85d042f09e6aca7",
"dmsg": {
Expand Down Expand Up @@ -273,10 +275,10 @@ skywire-cli config gen -i
```
$ skywire-cli config gen -i
[2022-04-02T18:21:40-05:00] INFO []: Fetched service endpoints from 'http://conf.skywire.skycoin.com'
[2022-04-02T18:21:40-05:00] INFO [visor:config]: Flushing config to file. config_version="0.6.1" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json"
[2022-04-02T18:21:40-05:00] INFO [visor:config]: Flushing config to file. config_version="0.6.0" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json"
[2022-04-02T18:21:40-05:00] INFO [skywire-cli]: Updated file '/home/user/go/src/github.com/skycoin/skywire/skywire-config.json' to:
{
"version": "0.6.1",
"version": "0.6.0",
"sk": "83df03537d74760487bfd12e11e6af1dbd2617b95b0b0f6637ee46a3f30822d7",
"pk": "03761d143ec62d12e46802c111cbb59af276c05380453415720048fffaf1841971",
"dmsg": {
Expand Down Expand Up @@ -414,10 +416,10 @@ skywire-cli config gen -d
```
[2022-04-02T18:32:32-05:00] INFO [skywire-cli]: Found Dmsghttp config: dmsghttp-config.json
[2022-04-02T18:32:32-05:00] INFO []: Fetched service endpoints from 'http://conf.skywire.skycoin.com'
[2022-04-02T18:32:32-05:00] INFO [visor:config]: Flushing config to file. config_version="0.6.1" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json"
[2022-04-02T18:32:32-05:00] INFO [visor:config]: Flushing config to file. config_version="0.6.0" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json"
[2022-04-02T18:32:32-05:00] INFO [skywire-cli]: Updated file '/home/user/go/src/github.com/skycoin/skywire/skywire-config.json' to:
{
"version": "0.6.1",
"version": "0.6.0",
"sk": "85577beed6b46b67704c52d3acd7ceb14a8d758356dff23028def4e38b72822f",
"pk": "02f0cd75987be4c014d59c6aeb43095d8f68bde525e03eff63fa13e59721e397eb",
"dmsg": {
Expand Down Expand Up @@ -585,10 +587,10 @@ sudo skywire-cli config gen -bipr
$ sudo skywire-cli config gen -bipr
[sudo] password for user:
[2022-04-02T18:39:43-05:00] INFO []: Fetched service endpoints from 'http://conf.skywire.skycoin.com'
[2022-04-02T18:39:43-05:00] INFO [visor:config]: Flushing config to file. config_version="0.6.1" filepath="/opt/skywire/skywire.json"
[2022-04-02T18:39:43-05:00] INFO [visor:config]: Flushing config to file. config_version="0.6.0" filepath="/opt/skywire/skywire.json"
[2022-04-02T18:39:43-05:00] INFO [skywire-cli]: Updated file '/opt/skywire/skywire.json' to:
{
"version": "0.6.1",
"version": "0.6.0",
"sk": "077017551b6a993b06d684426436794d661347191570c7ea4ed1fe25bfac5269",
"pk": "02afbeaa4f02251091eccd7d66e300ca8e3a406020d969ea20089a49d4e6fe2fa3",
"dmsg": {
Expand Down Expand Up @@ -781,9 +783,9 @@ skywire-cli config update

```
$ skywire-cli config update
[2022-04-02T18:47:15-05:00] INFO [visor:config]: Flushing config to file. config_version="0.6.1" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json"
[2022-04-02T18:47:15-05:00] INFO [visor:config]: Flushing config to file. config_version="0.6.0" filepath="/home/user/go/src/github.com/skycoin/skywire/skywire-config.json"
[2022-04-02T18:47:15-05:00] INFO [skywire-cli]: Updated file '/home/user/go/src/github.com/skycoin/skywire/skywire-config.json' to: {
"version": "0.6.1",
"version": "0.6.0",
"sk": "745badae7d125b90e3fd840b1d03d8a73565a3e0e976db6169b2d9368af86029",
"pk": "037b000c6262694c0d2b5d64480c1d82a5a1597a80deab881443742359601bc6e6",
"dmsg": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/_apps/vpn-client
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/bash
go run ../../cmd/apps/vpn-client/vpn-client.go
sudo go run ../../cmd/apps/vpn-client/vpn-client.go

0 comments on commit fb0bf3a

Please sign in to comment.