diff --git a/Dockerfile b/Dockerfile index 5c991b5..e086ed5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,13 @@ FROM ghcr.io/astral-sh/uv:debian-slim ARG VERSION LABEL version=${VERSION} LABEL description="Docker image for the backend of MediaManager" -ENV IMAGE_DIRECTORY=/data/images \ - TV_SHOW_DIRECTORY=/data/tv \ - MOVIE_DIRECTORY=/data/movies \ - TORRENT_DIRECTORY=/data/torrents \ - OPENID_ENABLED=FALSE \ +ENV MISC__IMAGE_DIRECTORY=/data/images \ + MISC__TV_SHOW_DIRECTORY=/data/tv \ + MISC__MOVIE_DIRECTORY=/data/movies \ + MISC__TORRENT_DIRECTORY=/data/torrents \ PUBLIC_VERSION=${VERSION} \ - API_BASE_PATH="/api/v1" + MISC__API_BASE_PATH="/api/v1" \ + CONFIG_FILE="/app/config.toml" WORKDIR /app diff --git a/Writerside/topics/Configuration.md b/Writerside/topics/Configuration.md index d345aed..83ff5f8 100644 --- a/Writerside/topics/Configuration.md +++ b/Writerside/topics/Configuration.md @@ -7,7 +7,7 @@ Frontend settings are configured through environment variables in your `docker-c ## Configuration File Location -Your `config.toml` file should be mounted to `/data/config.toml` inside the container: +Your `config.toml` file should be mounted to `/app/config.toml` inside the container: ```yaml volumes: @@ -43,7 +43,7 @@ token_secret = "your_super_secret_key_here" But you can also set it through an environment variable: ``` -AUTH_TOKEN_SECRET = "your_super_secret_key_here" +AUTH__TOKEN_SECRET = "your_super_secret_key_here" ``` or another example with the OIDC client secret: @@ -58,10 +58,10 @@ client_secret = "your_client_secret_from_provider" env variable: ``` -AUTH_OPENID_CONNECT_CLIENT_SECRET = "your_client_secret_from_provider" +AUTH__OPENID_CONNECT__CLIENT_SECRET = "your_client_secret_from_provider" ``` So for every config "level", you basically have to take the name of the value and prepend it with the section names in -uppercase with underscores as delimiters. +uppercase with 2 underscores as delimiters. diff --git a/docker-compose.yaml b/docker-compose.yaml index 8510aa9..0e0c4e5 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -7,7 +7,7 @@ services: - CONFIG_FILE=/data/config.toml volumes: - ./data/:/data/ - - ./config.toml:/data/config.toml + - ./config.toml:/app/config.toml frontend: image: ghcr.io/maxdorninger/mediamanager/frontend:latest ports: diff --git a/media_manager/config.py b/media_manager/config.py index 3edfa0a..b2d0015 100644 --- a/media_manager/config.py +++ b/media_manager/config.py @@ -39,7 +39,7 @@ class BasicConfig(BaseSettings): class AllEncompassingConfig(BaseSettings): model_config = SettingsConfigDict( - toml_file=config_path, case_sensitive=False, env_nested_delimiter="_" + toml_file=config_path, case_sensitive=False, env_nested_delimiter="__" ) """ This class is used to load all configurations from the environment variables.