mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
A lot of the dependency versions we have pinned don't have wheels for Python 3.12. Update almost all of them so we can upgrade Python. The few that weren't upgraded here are black and mypy, since those will be a bit invasive, and Pillow, which has an API change I don't want to deal with right now (I've got a commit on another machine that has already done the migration, so I'll do it later).
35 lines
1013 B
Python
35 lines
1013 B
Python
from __future__ import annotations
|
|
|
|
from functools import lru_cache
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class ServerSettings(BaseSettings):
|
|
"""Settings controlling server behavior.
|
|
|
|
The values listed here will be automatically modified based on the environment. e.g.
|
|
running with SERVER_BIND_ADDRESS=0.0.0.0 will cause the server to bind to all
|
|
interfaces.
|
|
|
|
https://fastapi.tiangolo.com/advanced/settings
|
|
"""
|
|
|
|
# WARNING: Be extremely cautious exposing the server to other machines. As there is
|
|
# no client/server workflow yet, security has not been a focus.
|
|
server_bind_address: str = "::1"
|
|
|
|
# This (and the address) will be passed the the front end as a query parameter.
|
|
server_port: int = 16880
|
|
|
|
# Enable to allow cross-origin requests from http://localhost:3000.
|
|
cors_allow_debug_server: bool = False
|
|
|
|
class Config:
|
|
env_file = "serverconfig.env"
|
|
|
|
@classmethod
|
|
@lru_cache
|
|
def get(cls) -> ServerSettings:
|
|
return cls()
|