-
Notifications
You must be signed in to change notification settings - Fork 7
mask more flags; print error loading config #64
Conversation
Signed-off-by: Merlin Ran <merlinran@gmail.com>
@@ -203,7 +203,8 @@ Zero means no limits`, | |||
v.SetConfigName("config") | |||
v.AddConfigPath(os.Getenv("BIDBOT_PATH")) | |||
v.AddConfigPath(defaultConfigPath) | |||
_ = v.ReadInConfig() | |||
err := v.ReadInConfig() | |||
cli.CheckErrf(fmt.Sprintf("loading config from %s: %%v", v.ConfigFileUsed()), err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this bidbot prints a confusing message like this, if the config file format is invalid.
2021/10/13 21:14:39 --storage-provider-id is required. See ‘bidbot help init’ for instructions
@@ -323,7 +324,7 @@ var daemonCmd = &cobra.Command{ | |||
cli.CheckErrf("getting peer config: %v", err) | |||
|
|||
settings, err := cli.MarshalConfig(v, !v.GetBool("log-json"), | |||
"private-key", "wallet-addr-sig", "lotus-miner-api-token") | |||
"cid-gravity-key", "private-key", "wallet-addr-sig", "lotus-miner-api-token", "lotus-market-api-token") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot to mask them. spotted by Julien.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, good catch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
@@ -323,7 +324,7 @@ var daemonCmd = &cobra.Command{ | |||
cli.CheckErrf("getting peer config: %v", err) | |||
|
|||
settings, err := cli.MarshalConfig(v, !v.GetBool("log-json"), | |||
"private-key", "wallet-addr-sig", "lotus-miner-api-token") | |||
"cid-gravity-key", "private-key", "wallet-addr-sig", "lotus-miner-api-token", "lotus-market-api-token") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, good catch.
Tiny changes but masking the tokens is important, so prob. worth a PR.