Добавил возможность указывать токен через переменную среды

This commit is contained in:
2024-12-16 12:59:11 +03:00
parent e655e876d8
commit 89ce537d17

View File

@@ -32,7 +32,8 @@ def get_db():
security = HTTPBearer() security = HTTPBearer()
TOKEN: str = None TOKEN: str = os.environ.get("BUILD_INC_TOKEN", None)
if TOKEN is None:
THIS_SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__)) THIS_SCRIPT_PATH = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(THIS_SCRIPT_PATH, "token.json"), 'r') as f: with open(os.path.join(THIS_SCRIPT_PATH, "token.json"), 'r') as f:
t = json.load(f) t = json.load(f)