Can Also read in API Keys from a file

This commit is contained in:
2024-08-05 10:41:51 +02:00
parent f209e0e452
commit 3270e3fe2c

View File

@ -26,6 +26,10 @@ BUFFER_SIZE = convert_to_bytes(CONFIG['buffer-size'])
MAX_SIZE = convert_to_bytes(CONFIG['max-size'])
MAX_DATA = convert_to_bytes(CONFIG['max-data'])
AUTHORIZED_KEYS = CONFIG['keys']
if isinstance(AUTHORIZED_KEYS, str):
with open(AUTHORIZED_KEYS) as file:
AUTHORIZED_KEYS = list(
filter(lambda x: x.strip() != '', file.read().splitlines()))
DATABASE = CONFIG['database']
if not exists(DATABASE):