Moved !secret from config.json to only secrets.json

This commit is contained in:
Mathieu 2021-09-13 22:09:43 +02:00
parent e8af85e0d5
commit af81c42f4e
2 changed files with 5 additions and 5 deletions

View File

@ -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
}

View File

@ -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