Moved !secret from config.json to only secrets.json
This commit is contained in:
parent
e8af85e0d5
commit
af81c42f4e
@ -2,7 +2,6 @@
|
||||
"PORT": 5000,
|
||||
"12HOURS-FORMAT": false,
|
||||
"LANGUAGE": "fr-fr",
|
||||
"SPOTIFY_CLIENT_ID": "!secret SPOTIFY_CLIENT_ID",
|
||||
"SPOTIFY_CLIENT_SECRET": "!secret SPOTIFY_CLIENT_SECRET",
|
||||
"TTS_VOICE": "marytts:upmc-pierre-hsmm"
|
||||
"TTS_VOICE": "marytts:upmc-pierre-hsmm",
|
||||
"PAUSE_MUSIC_AFTER_HOTWORD": true
|
||||
}
|
||||
|
@ -11,13 +11,14 @@ def get_in_config(name):
|
||||
if name in config_json:
|
||||
if isinstance(config_json.get(name), str):
|
||||
if "!secret" in config_json.get(name):
|
||||
# secret_name = config_json.get(name).removeprefix('!secret ')
|
||||
secret_name = config_json.get(name).replace('!secret ', '')
|
||||
return get_in_secret(secret_name)
|
||||
else:
|
||||
return config_json.get(name)
|
||||
else:
|
||||
return config_json.get(name)
|
||||
else:
|
||||
return get_in_secret(name)
|
||||
|
||||
|
||||
def get_in_secret(secret_name):
|
||||
@ -26,4 +27,4 @@ def get_in_secret(secret_name):
|
||||
if secret_name in secrets_json:
|
||||
return secrets_json.get(secret_name)
|
||||
else:
|
||||
return "Not found!"
|
||||
return None
|
||||
|
Reference in New Issue
Block a user