✨ Update pydantic properly
This commit is contained in:
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
|
||||
//
|
||||
// SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
{
|
||||
"sqltools.connections": [
|
||||
{
|
||||
"previewLimit": 50,
|
||||
"server": "localhost",
|
||||
"driver": "PostgreSQL",
|
||||
"connectString": "postgresql://postgres:mysecretpassword@localhost:5432/classquiz",
|
||||
"name": "ClassQuiz"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -17,7 +17,7 @@ python-jose = "*"
|
||||
alembic = "*"
|
||||
email-validator = "*"
|
||||
python-multipart = "*"
|
||||
pydantic = "1.10.8"
|
||||
pydantic = "*"
|
||||
redis = "*"
|
||||
aiohttp = "*"
|
||||
gunicorn = "*"
|
||||
@@ -46,6 +46,7 @@ starlette = "*"
|
||||
pyopenssl = "*"
|
||||
python-dotenv = "*"
|
||||
webauthn = "==1.*"
|
||||
pydantic-settings = "==2.2.1"
|
||||
|
||||
[dev-packages]
|
||||
coverage = "*"
|
||||
|
||||
Generated
+1062
-500
File diff suppressed because it is too large
Load Diff
+22
-27
@@ -7,10 +7,9 @@ from functools import lru_cache
|
||||
|
||||
from redis import asyncio as redis_lib
|
||||
import redis as redis_base_lib
|
||||
from pydantic_settings import BaseSettings
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
from pydantic import RedisDsn, PostgresDsn, BaseModel
|
||||
import meilisearch as MeiliSearch
|
||||
from typing import Optional
|
||||
from arq import create_pool
|
||||
from arq.connections import RedisSettings, ArqRedis
|
||||
|
||||
@@ -29,29 +28,30 @@ class Settings(BaseSettings):
|
||||
Settings class for the shop app.
|
||||
"""
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env", extra="ignore", env_nested_delimiter="__", env_file_encoding="utf-8"
|
||||
)
|
||||
root_address: str = "http://127.0.0.1:8000"
|
||||
redis: RedisDsn = "redis://localhost:6379/0?decode_responses=True"
|
||||
skip_email_verification: bool = False
|
||||
db_url: str | PostgresDsn = "postgresql://postgres:mysecretpassword@localhost:5432/classquiz"
|
||||
hcaptcha_key: str = "3852831a-48b4-4236-b0de-9769a1998468"
|
||||
db_url: PostgresDsn | str = "postgresql://postgres:mysecretpassword@localhost:5432/classquiz"
|
||||
hcaptcha_key: str | None = None
|
||||
recaptcha_key: str | None = None
|
||||
# mail_address: str
|
||||
mail_address: str = "778@madeupaddress.com"
|
||||
# mail_password: str
|
||||
mail_password: str = "mail_passwordstring"
|
||||
mail_username: str = "mail_userstring"
|
||||
mail_server: str = "mail_serverstring"
|
||||
mail_address: str
|
||||
mail_password: str
|
||||
mail_username: str
|
||||
mail_server: str
|
||||
mail_port: int = 0
|
||||
secret_key: str = "secret_keystring"
|
||||
secret_key: str
|
||||
access_token_expire_minutes: int = 30
|
||||
cache_expiry: int = 86400
|
||||
sentry_dsn: str = ""
|
||||
sentry_dsn: str | None
|
||||
meilisearch_url: str = "http://127.0.0.1:7700"
|
||||
meilisearch_index: str = "classquiz"
|
||||
google_client_id: str = "google_client_idstring"
|
||||
google_client_secret: str = "google_client_secretstring"
|
||||
github_client_id: str = "github_client_idstring"
|
||||
github_client_secret: str = "github_client_secretstring"
|
||||
google_client_id: str | None = None
|
||||
google_client_secret: str | None = None
|
||||
github_client_id: str | None = None
|
||||
github_client_secret: str | None = None
|
||||
custom_openid_provider: CustomOpenIDProvider | None = None
|
||||
telemetry_enabled: bool = True
|
||||
free_storage_limit: int = 1074000000
|
||||
@@ -60,21 +60,16 @@ class Settings(BaseSettings):
|
||||
registration_disabled: bool = False
|
||||
|
||||
# storage_backend
|
||||
storage_backend: str = "local"
|
||||
storage_backend: str # either "local" or "s3"
|
||||
|
||||
# if storage_backend == "local":
|
||||
storage_path: str = "/tmp/storage"
|
||||
storage_path: str | None = None
|
||||
|
||||
# if storage_backend == "s3":
|
||||
s3_access_key: str = "s3_access_keystring"
|
||||
s3_secret_key: str = "s3_secret_keystring"
|
||||
s3_bucket_name: str = "classquiz"
|
||||
s3_base_url: str = "s3_base_urlstring"
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
env_file_encoding = "utf-8"
|
||||
env_nested_delimiter = "__"
|
||||
s3_access_key: str | None = None
|
||||
s3_secret_key: str | None = None
|
||||
s3_bucket_name: str | None = None
|
||||
s3_base_url: str | None = None
|
||||
|
||||
|
||||
async def initialize_arq():
|
||||
|
||||
@@ -44,6 +44,10 @@ services:
|
||||
- 9000:9000
|
||||
- 9001:9001
|
||||
restart: unless-stopped
|
||||
redis:
|
||||
image: redis
|
||||
ports:
|
||||
- 6379:6379
|
||||
volumes:
|
||||
db:
|
||||
search:
|
||||
|
||||
@@ -247,7 +247,7 @@ This should be okay, right?
|
||||
</p>
|
||||
<input
|
||||
type="text"
|
||||
comment="svelte recommends against autofocus for accessibility reasons. Therefore removed autofocus command for this input"
|
||||
autofocus
|
||||
class="col-start-1 row-start-1 bg-transparent w-full p-4 outline-none bg-gray-700 rounded"
|
||||
bind:value={input}
|
||||
/>
|
||||
|
||||
+3
-1
@@ -1,4 +1,6 @@
|
||||
echo "Hello world"
|
||||
# SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
|
||||
#
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
if [ ! -d /tmp/storage ]; then
|
||||
echo "making storage"
|
||||
|
||||
Reference in New Issue
Block a user