s365b.core.config ================= .. py:module:: s365b.core.config .. autoapi-nested-parse:: Process configuration read from environment variables. Only settings needed to *start* the process live here (database, paths, keys, module allow-list). Everything an admin changes at runtime (schedules, notification recipients, module on/off) is stored in the database. All variables use the ``S365B_`` prefix, e.g. ``S365B_DATABASE_URL``. Values ending in ``_FILE`` point to files, which is how Docker secrets are passed in. Classes ------- .. autoapisummary:: s365b.core.config.Settings Functions --------- .. autoapisummary:: s365b.core.config.get_settings Module Contents --------------- .. py:class:: Settings Bases: :py:obj:`pydantic_settings.BaseSettings` Settings for every Mail Safehouse process. :ivar database_url: PostgreSQL URL in SQLAlchemy form, e.g. ``postgresql+psycopg://s365b:pw@postgres:5432/s365b``. :ivar master_key_file: File holding the master key that encrypts secrets stored in the database (certificate private keys, SMTP passwords). Generate with ``s365b generate-master-key``. :ivar repository_path: Default location of the filesystem backup repository. :ivar modules: Allow-list of module IDs this instance may load. Empty means every installed module is allowed. Modules outside the list are never imported, whatever the UI says. :ivar base_url: Public URL of the web UI (``https://host[:port]``), used for links in emails, the Entra sign-in callback and secure cookies. :ivar timezone: IANA time zone that backup schedules are written in. :ivar web_dir: Built web UI (``frontend/dist``) to serve at ``/``. Unset or missing means API only. :ivar log_level: Minimum log level. :ivar log_format: ``json`` for containers, ``console`` for development. .. py:attribute:: model_config .. py:attribute:: database_url :type: pydantic.SecretStr .. py:attribute:: master_key_file :type: pathlib.Path .. py:attribute:: repository_path :type: pathlib.Path .. py:attribute:: modules :type: Annotated[list[str], pydantic_settings.NoDecode] .. py:attribute:: base_url :type: str :value: 'https://localhost' .. py:attribute:: timezone :type: str :value: 'UTC' .. py:attribute:: web_dir :type: pathlib.Path | None :value: None .. py:attribute:: log_level :type: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR'] :value: 'INFO' .. py:attribute:: log_format :type: Literal['json', 'console'] :value: 'json' .. py:method:: libpq_url() -> str Return the database URL in plain libpq form (for psycopg/procrastinate). :returns: The URL without SQLAlchemy's ``+driver`` suffix. .. py:function:: get_settings() -> Settings Return the process-wide settings, read once from the environment. :returns: The cached :class:`Settings` instance.