strip whitespaces when loading secrets (#12393)

* strip whitespaces when loading secrets

* formatting
This commit is contained in:
Josh Thorpe
2024-07-12 21:36:15 +08:00
committed by GitHub
parent e416e44998
commit 8f51f7b4c4
4 changed files with 12 additions and 8 deletions

View File

@@ -42,7 +42,9 @@ class PlusApi:
and os.access("/run/secrets", os.R_OK)
and PLUS_ENV_VAR in os.listdir("/run/secrets")
):
self.key = Path(os.path.join("/run/secrets", PLUS_ENV_VAR)).read_text()
self.key = (
Path(os.path.join("/run/secrets", PLUS_ENV_VAR)).read_text().strip()
)
# check for the addon options file
elif os.path.isfile("/data/options.json"):
with open("/data/options.json") as f: