Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry pick of "Added back agreed-terms-and-conditions flag" #442

Merged
merged 2 commits into from Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 21 additions & 2 deletions cmd/commands/service/command.go
Expand Up @@ -18,10 +18,14 @@
package service

import (
"fmt"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line

"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
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