Skip to content

Commit 3679cda

Browse files
Update config.py
1 parent 856fd90 commit 3679cda

File tree

1 file changed

+14
-19
lines changed

1 file changed

+14
-19
lines changed

app/config.py

+14-19
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
1-
from pydantic import BaseSettings, Field
1+
from pydantic_settings import BaseSettings
2+
from pydantic import Field
23
from pathlib import Path
34
from typing import Optional
45

56
class Settings(BaseSettings):
6-
HOST: str
7-
PORT: int
8-
WORKERS: int
9-
10-
FFMPEG_PATH: Path
11-
FFPROBE_PATH: Path
12-
VMAF_PATH: Path
13-
MODE: str
7+
HOST: str = Field("0.0.0.0")
8+
PORT: int = Field(8000)
9+
WORKERS: int = Field(4)
10+
11+
FFMPEG_PATH: Path = Field(Path("/usr/bin/ffmpeg"))
12+
FFPROBE_PATH: Path = Field(Path("/usr/bin/ffprobe"))
13+
VMAF_PATH: Path = Field(Path("/usr/local/bin/ffmpeg-quality-metrics"))
14+
MODE: str = Field("local")
1415
SSH_HOST: Optional[str]
1516
SSH_USER: Optional[str]
1617
SSH_KEY_PATH: Optional[Path]
1718

1819
AWS_ACCESS_KEY_ID: Optional[str]
1920
AWS_SECRET_ACCESS_KEY: Optional[str]
20-
AWS_REGION: str
21+
AWS_REGION: str = Field("us-east-1")
2122

22-
SECRET_KEY: str
23-
ALGORITHM: str
24-
ACCESS_TOKEN_EXPIRE_MINUTES: int
23+
SECRET_KEY: str = Field(...)
24+
ALGORITHM: str = Field("HS256")
25+
ACCESS_TOKEN_EXPIRE_MINUTES: int = Field(60)
2526

2627
class Config:
2728
env_file = ".env"
2829

2930
settings = Settings()
30-
31-
32-
33-
34-
35-

0 commit comments

Comments
 (0)