- Add POST `/api/v1/config/hysteria/webpanel/decoy/setup` endpoint to configure the decoy site. - Add POST `/api/v1/config/hysteria/webpanel/decoy/stop` endpoint to remove the decoy site configuration. - Implement `BackgroundTasks` for both endpoints to prevent Caddy service restarts from interrupting the API response. - Add `SetupDecoyRequest` Pydantic schema for the setup endpoint payload.
21 lines
387 B
Python
21 lines
387 B
Python
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Configs(BaseSettings):
|
|
PORT: int
|
|
DOMAIN: str
|
|
DEBUG: bool
|
|
ADMIN_USERNAME: str
|
|
ADMIN_PASSWORD: str
|
|
API_TOKEN: str
|
|
EXPIRATION_MINUTES: int
|
|
ROOT_PATH: str
|
|
DECOY_PATH: str | None = None
|
|
|
|
class Config:
|
|
env_file = '.env'
|
|
env_file_encoding = 'utf-8'
|
|
|
|
|
|
CONFIGS = Configs() # type: ignore
|