Skip to content

Commit

Permalink
Merge pull request #442 from mysteriumnetwork/backport-agree-terms-an…
Browse files Browse the repository at this point in the history
…d-services

Cherry pick of "Added back agreed-terms-and-conditions flag"
  • Loading branch information
Waldz authored Oct 15, 2018
2 parents b9dd5d6 + 185a335 commit 04f6225
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
23 changes: 21 additions & 2 deletions cmd/commands/service/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,14 @@
package service

import (
"fmt"

"github.com/urfave/cli"

"github.com/mysteriumnetwork/node/cmd"
"github.com/mysteriumnetwork/node/core/service"
"github.com/mysteriumnetwork/node/metadata"
"github.com/mysteriumnetwork/node/utils"
"github.com/urfave/cli"
)

var (
Expand All @@ -46,6 +50,11 @@ var (
Usage: "Openvpn port to use. Default 1194",
Value: 1194,
}

agreedTermsConditionsFlag = cli.BoolFlag{
Name: "agreed-terms-and-conditions",
Usage: "Agree with terms & conditions",
}
)

// NewCommand function creates service command
Expand All @@ -69,10 +78,20 @@ func NewCommand() *cli.Command {
Flags: []cli.Flag{
identityFlag, identityPassphraseFlag,
openvpnProtocolFlag, openvpnPortFlag,
agreedTermsConditionsFlag,
},
Action: func(ctx *cli.Context) error {
if !ctx.Bool(agreedTermsConditionsFlag.Name) {
fmt.Println(metadata.VersionAsSummary(metadata.LicenseCopyright(
"run program with '--license.warranty' option",
"run program with '--license.conditions' option",
)))
fmt.Println()
return fmt.Errorf("If you agree with these Terms & Conditions, run program again with '--agreed-terms-and-conditions' flag")
}

nodeOptions := cmd.ParseFlagsNode(ctx)
if err := di.Bootstrap(cmd.ParseFlagsNode(ctx)); err != nil {
if err := di.Bootstrap(nodeOptions); err != nil {
return err
}
di.BootstrapServiceComponents(nodeOptions, service.Options{
Expand Down
1 change: 1 addition & 0 deletions e2e/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ services:
--discovery-address=http://discovery/v1
--ether.client.rpc=http://geth:8545
service
--agreed-terms-and-conditions
--identity=0xd1a23227bd5ad77f36ba62badcb78a410a1db6c5
--identity.passphrase=localprovider
--openvpn.port=3000
Expand Down

0 comments on commit 04f6225

Please sign in to comment.