cata_log_hub.settings module

class cata_log_hub.settings.Settings(_case_sensitive=None, _nested_model_default_partial_update=None, _env_prefix=None, _env_prefix_target=None, _env_file=PosixPath('.'), _env_file_encoding=None, _env_ignore_empty=None, _env_nested_delimiter=None, _env_nested_max_split=None, _env_parse_none_str=None, _env_parse_enums=None, _cli_prog_name=None, _cli_parse_args=None, _cli_settings_source=None, _cli_parse_none_str=None, _cli_hide_none_type=None, _cli_avoid_json=None, _cli_enforce_required=None, _cli_use_class_docs_for_groups=None, _cli_exit_on_error=None, _cli_prefix=None, _cli_flag_prefix_char=None, _cli_implicit_flags=None, _cli_ignore_unknown_args=None, _cli_kebab_case=None, _cli_shortcuts=None, _secrets_dir=None, _build_sources=None, **values)[source]

Bases: BaseSettings

Configuration for the Cata-Log server. You can configure the settings with these command-line arguments or environment variables starting with CATA_LOG_.

Parameters:
  • _case_sensitive (bool | None)

  • _nested_model_default_partial_update (bool | None)

  • _env_prefix (str | None)

  • _env_prefix_target (EnvPrefixTarget | None)

  • _env_file (DotenvType | None)

  • _env_file_encoding (str | None)

  • _env_ignore_empty (bool | None)

  • _env_nested_delimiter (str | None)

  • _env_nested_max_split (int | None)

  • _env_parse_none_str (str | None)

  • _env_parse_enums (bool | None)

  • _cli_prog_name (str | None)

  • _cli_parse_args (bool | list[str] | tuple[str, ...] | None)

  • _cli_settings_source (CliSettingsSource[Any] | None)

  • _cli_parse_none_str (str | None)

  • _cli_hide_none_type (bool | None)

  • _cli_avoid_json (bool | None)

  • _cli_enforce_required (bool | None)

  • _cli_use_class_docs_for_groups (bool | None)

  • _cli_exit_on_error (bool | None)

  • _cli_prefix (str | None)

  • _cli_flag_prefix_char (str | None)

  • _cli_implicit_flags (bool | Literal['dual', 'toggle'] | None)

  • _cli_ignore_unknown_args (bool | None)

  • _cli_kebab_case (bool | Literal['all', 'no_enums'] | None)

  • _cli_shortcuts (Mapping[str, str | list[str]] | None)

  • _secrets_dir (PathType | None)

  • _build_sources (tuple[tuple[PydanticBaseSettingsSource, ...], dict[str, Any]] | None)

  • username (str)

  • password (str)

  • data_path (Path)

  • storage_path (Path)

  • database_path (Path)

  • plugin_path (Path)

  • logs_path (Path)

  • external_database_url (str)

  • dev_mode (bool)

  • public_get (bool)

  • request_timeout (Annotated[int, Gt(gt=0)])

  • retry_delay (Annotated[int, Gt(gt=0)])

  • expiration_days (Annotated[int, Ge(ge=0)])

  • log_level (str)

  • log_file_backup_count (Annotated[int, Ge(ge=0)])

  • log_file_maxsize (Annotated[int, Ge(ge=0)])

  • api_default_pagination_page_size (Annotated[int, Gt(gt=0)])

  • api_max_pagination_page_size (Annotated[int, Gt(gt=0)])

  • host (IPvAnyAddress)

  • port (int)

  • forwarded_allow_ips (str)

  • workers (Annotated[int, Gt(gt=0)])

model_config = {'arbitrary_types_allowed': True, 'case_sensitive': False, 'cli_avoid_json': False, 'cli_enforce_required': False, 'cli_exit_on_error': True, 'cli_flag_prefix_char': '-', 'cli_hide_none_type': False, 'cli_ignore_unknown_args': True, 'cli_implicit_flags': False, 'cli_kebab_case': True, 'cli_parse_args': True, 'cli_parse_none_str': None, 'cli_prefix': '', 'cli_prog_name': None, 'cli_shortcuts': None, 'cli_use_class_docs_for_groups': False, 'enable_decoding': True, 'env_file': None, 'env_file_encoding': None, 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': 'CATA_LOG_', 'env_prefix_target': 'variable', 'extra': 'forbid', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_customise_sources'), 'secrets_dir': None, 'toml_file': None, 'validate_default': True, 'yaml_config_section': None, 'yaml_file': None, 'yaml_file_encoding': None}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

username: str
password: str
data_path: Path
storage_path: Path
database_path: Path
plugin_path: Path
logs_path: Path
external_database_url: str
dev_mode: bool
public_get: bool
request_timeout: Annotated[int, Gt(gt=0)]
retry_delay: Annotated[int, Gt(gt=0)]
expiration_days: Annotated[int, Ge(ge=0)]
log_level: str
log_file_backup_count: Annotated[int, Ge(ge=0)]
log_file_maxsize: Annotated[int, Ge(ge=0)]
api_default_pagination_page_size: Annotated[int, Gt(gt=0)]
api_max_pagination_page_size: Annotated[int, Gt(gt=0)]
host: IPvAnyAddress
port: int
forwarded_allow_ips: str
workers: Annotated[int, Gt(gt=0)]
classmethod ensure_dirs(value)[source]

Create non-existent paths.

Return type:

Any

Returns:

The path.

Parameters:

value (Any)

cata_log_hub.settings.get_settings()[source]

Get the current settings.

Return type:

Settings