diff --git a/cmd/commands/service/command.go b/cmd/commands/service/command.go index e6175d9696..1e9e347447 100644 --- a/cmd/commands/service/command.go +++ b/cmd/commands/service/command.go @@ -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 ( @@ -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 @@ -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{ diff --git a/e2e/docker-compose.yml b/e2e/docker-compose.yml index a200fa6443..b6a0e072cd 100644 --- a/e2e/docker-compose.yml +++ b/e2e/docker-compose.yml @@ -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