From 6848b0418a857ba56b428c9231faf68c9a83d405 Mon Sep 17 00:00:00 2001 From: Dmitry Shihovtsev Date: Thu, 20 Sep 2018 16:42:17 +0600 Subject: [PATCH 1/2] Added back agreed-terms-and-conditions flag --- cmd/commands/service/command.go | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) 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{ From 185a3351a33f8271630048541ad364b19d2fb70d Mon Sep 17 00:00:00 2001 From: Dmitry Shihovtsev Date: Thu, 20 Sep 2018 17:50:21 +0600 Subject: [PATCH 2/2] Added --agreed-terms-and-conditions for e2e tests --- e2e/docker-compose.yml | 1 + 1 file changed, 1 insertion(+) 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