masto-bridges/masto_bridges/config.py

25 lines
764 B
Python
Raw Normal View History

from pathlib import Path
from typing import Optional, Literal
from pydantic import BaseSettings, AnyHttpUrl
class Config(BaseSettings):
MASTO_URL:AnyHttpUrl
MASTO_TOKEN:str
LOGDIR:Path=Path().home() / '.mastobridge'
LOGLEVEL:Literal['DEBUG','INFO','WARNING','ERROR','EXCEPTION']='INFO'
STREAM_MODE:Literal['list', 'home'] = 'list'
ENABLE_GIT:bool=False
ENABLE_CALDAV:bool=False
GIT_REPO:Optional[Path]=None
GIT_REMOTE_URL:Optional[AnyHttpUrl]=None
CALDAV_URL:Optional[AnyHttpUrl] = None
CALDAV_USER:Optional[str]=None
CALDAV_PASSWORD:Optional[str]=None
CALDAV_CALENDAR_NAME:Optional[str]=None
class Config:
env_file = '.env'
env_file_encoding = 'utf-8'
env_prefix = "MASTOBRIDGE_"