Skip to content

Commit

Permalink
avoid erroring out on --insecure with drand start (#1284)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnomalRoil authored and CluEleSsUK committed Jan 9, 2024
1 parent 8bb91a4 commit c8eb5c6
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion internal/drand-cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,22 @@ var memDBSizeFlag = &cli.IntFlag{
EnvVars: []string{"DRAND_MEMDB_SIZE"},
}

// TODO: remove at some point in the future after migrating to v2
var hiddenInsecureFlag = &cli.BoolFlag{
Name: "tls-disable",
Aliases: []string{"insecure"},
Usage: "This is a deprecated flag since now the daemon always assumes there is a reverse proxy doing TLS termination",
Value: false,
Hidden: true,
Action: func(c *cli.Context, _ bool) error {
l := log.New(nil, logLevel(c), logJSON(c))
l.Warnw("The '--insecure' or '--tls-disable' flags are now deprecated in v2, " +
"you can remove them from your 'drand start' command.")
return nil
},
EnvVars: []string{"DRAND_TLS_DISABLE", "DRAND_INSECURE"},
}

var appCommands = []*cli.Command{
dkgCommand,
{
Expand All @@ -304,7 +320,7 @@ var appCommands = []*cli.Command{
metricsFlag, tracesFlag, tracesProbabilityFlag,
pushFlag, verboseFlag, oldGroupFlag,
skipValidationFlag, jsonFlag, beaconIDFlag,
storageTypeFlag, pgDSNFlag, memDBSizeFlag),
storageTypeFlag, pgDSNFlag, memDBSizeFlag, hiddenInsecureFlag),
Action: func(c *cli.Context) error {
banner(c.App.Writer)
l := log.New(nil, logLevel(c), logJSON(c))
Expand Down

0 comments on commit c8eb5c6

Please sign in to comment.