Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

mask more flags; print error loading config #64

Merged
merged 1 commit into from
Oct 13, 2021

Conversation

merlinran
Copy link
Contributor

Tiny changes but masking the tokens is important, so prob. worth a PR.

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)
Copy link
Contributor Author

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")
Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

nice, good catch.

@merlinran merlinran requested a review from jsign October 13, 2021 19:45
Copy link
Contributor

@jsign jsign left a 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")
Copy link
Contributor

Choose a reason for hiding this comment

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

nice, good catch.

@merlinran merlinran merged commit 16491f3 into main Oct 13, 2021
@merlinran merlinran deleted the merlin/mask-more-flags branch October 13, 2021 20:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants