forked from freqtrade/freqtrade
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request freqtrade#9986 from freqtrade/feat/show_config
add show-config command
- Loading branch information
Showing
14 changed files
with
197 additions
and
12 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from copy import deepcopy | ||
|
||
from freqtrade.constants import Config | ||
|
||
|
||
def sanitize_config(config: Config, *, show_sensitive: bool = False) -> Config: | ||
""" | ||
Remove sensitive information from the config. | ||
:param config: Configuration | ||
:param show_sensitive: Show sensitive information | ||
:return: Configuration | ||
""" | ||
if show_sensitive: | ||
return config | ||
keys_to_remove = [ | ||
"exchange.key", | ||
"exchange.secret", | ||
"exchange.password", | ||
"exchange.uid", | ||
"telegram.token", | ||
"telegram.chat_id", | ||
"discord.webhook_url", | ||
"api_server.password", | ||
] | ||
config = deepcopy(config) | ||
for key in keys_to_remove: | ||
if '.' in key: | ||
nested_keys = key.split('.') | ||
nested_config = config | ||
for nested_key in nested_keys[:-1]: | ||
nested_config = nested_config.get(nested_key, {}) | ||
nested_config[nested_keys[-1]] = 'REDACTED' | ||
else: | ||
config[key] = 'REDACTED' | ||
|
||
return config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"stake_currency": "", | ||
"dry_run": true, | ||
"dry_run": false, | ||
"exchange": { | ||
"name": "", | ||
"key": "", | ||
|