This commit is contained in:
Redsandy
2026-08-12 11:26:05 +03:00
commit c9f66f330e
17 changed files with 1569 additions and 0 deletions

27
app/core/config.py Normal file
View File

@@ -0,0 +1,27 @@
from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
database_url: str = "sqlite:///./vyryi.db"
jwt_secret: str = "dev-secret-change-me"
jwt_algorithm: str = "HS256"
jwt_expire_minutes: int = 60 * 24 * 7
cors_origins: str = (
"http://localhost:5173,http://127.0.0.1:5173,"
"http://localhost:5174,http://127.0.0.1:5174"
)
cors_origin_regex: str = r"http://(localhost|127\.0\.0\.1):\d+"
bot_token: str = ""
@property
def cors_origins_list(self) -> list[str]:
return [origin.strip() for origin in self.cors_origins.split(",") if origin.strip()]
@lru_cache
def get_settings() -> Settings:
return Settings()