cremalink.local_server_app.config module
This module defines the configuration settings for the local server application using Pydantic’s settings management.
- class cremalink.local_server_app.config.ServerSettings(_case_sensitive: bool | None = None, _nested_model_default_partial_update: bool | None = None, _env_prefix: str | None = None, _env_file: DotenvType | None = PosixPath('.'), _env_file_encoding: str | None = None, _env_ignore_empty: bool | None = None, _env_nested_delimiter: str | None = None, _env_nested_max_split: int | None = None, _env_parse_none_str: str | None = None, _env_parse_enums: bool | None = None, _cli_prog_name: str | None = None, _cli_parse_args: bool | list[str] | tuple[str, ...] | None = None, _cli_settings_source: CliSettingsSource[Any] | None = None, _cli_parse_none_str: str | None = None, _cli_hide_none_type: bool | None = None, _cli_avoid_json: bool | None = None, _cli_enforce_required: bool | None = None, _cli_use_class_docs_for_groups: bool | None = None, _cli_exit_on_error: bool | None = None, _cli_prefix: str | None = None, _cli_flag_prefix_char: str | None = None, _cli_implicit_flags: bool | None = None, _cli_ignore_unknown_args: bool | None = None, _cli_kebab_case: bool | Literal['all', 'no_enums'] | None = None, _cli_shortcuts: Mapping[str, str | list[str]] | None = None, _secrets_dir: PathType | None = None, *, SERVER_SETTINGS_PATH: str = '', SERVER_IP: str = '127.0.0.1', SERVER_PORT: int = 10280, ADVERTISED_IP: str | None = None, NUDGER_POLL_INTERVAL: float = 1.0, MONITOR_POLL_INTERVAL: float = 5.0, REKEY_INTERVAL_SECONDS: float = 60.0, QUEUE_MAX_SIZE: int = 200, LOG_RING_SIZE: int = 200, DEVICE_REGISTER_VERIFY: bool = False, DEVICE_REGISTER_CA_PATH: str | None = None, DEVICE_REGISTER_TIMEOUT: float = 10.0, ENABLE_DEVICE_REGISTER: bool = True, ENABLE_NUDGER_JOB: bool = True, ENABLE_MONITOR_JOB: bool = True, ENABLE_REKEY_JOB: bool = True, FIXED_RANDOM_2: str | None = None, FIXED_TIME_2: str | None = None)[source]
Bases:
BaseSettingsDefines the application’s settings, which can be loaded from environment variables or a .env file. This provides a centralized and type-safe way to configure the server’s behavior.
- 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': False, 'cli_implicit_flags': False, 'cli_kebab_case': False, 'cli_parse_args': None, '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': '.env', 'env_file_encoding': 'utf-8', 'env_ignore_empty': False, 'env_nested_delimiter': None, 'env_nested_max_split': None, 'env_parse_enums': None, 'env_parse_none_str': None, 'env_prefix': '', 'extra': 'ignore', 'json_file': None, 'json_file_encoding': None, 'nested_model_default_partial_update': False, 'populate_by_name': True, 'protected_namespaces': ('model_validate', 'model_dump', 'settings_customise_sources'), 'secrets_dir': None, 'toml_file': None, 'validate_by_alias': True, 'validate_by_name': True, '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].
- cremalink.local_server_app.config.get_settings() ServerSettings[source]
Provides a cached, global instance of the ServerSettings. Using lru_cache ensures that the settings are loaded from the environment only once.