_base.pyi 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. from typing import Any, Iterable, List, Optional
  2. from synapse.config import (
  3. api,
  4. appservice,
  5. auth,
  6. captcha,
  7. cas,
  8. consent_config,
  9. database,
  10. emailconfig,
  11. experimental,
  12. groups,
  13. jwt_config,
  14. key,
  15. logger,
  16. metrics,
  17. oidc_config,
  18. password_auth_providers,
  19. push,
  20. ratelimiting,
  21. redis,
  22. registration,
  23. repository,
  24. room_directory,
  25. saml2_config,
  26. server,
  27. server_notices_config,
  28. spam_checker,
  29. sso,
  30. stats,
  31. third_party_event_rules,
  32. tls,
  33. tracer,
  34. user_directory,
  35. voip,
  36. workers,
  37. )
  38. class ConfigError(Exception):
  39. def __init__(self, msg: str, path: Optional[Iterable[str]] = None):
  40. self.msg = msg
  41. self.path = path
  42. MISSING_REPORT_STATS_CONFIG_INSTRUCTIONS: str
  43. MISSING_REPORT_STATS_SPIEL: str
  44. MISSING_SERVER_NAME: str
  45. def path_exists(file_path: str): ...
  46. class RootConfig:
  47. server: server.ServerConfig
  48. experimental: experimental.ExperimentalConfig
  49. tls: tls.TlsConfig
  50. database: database.DatabaseConfig
  51. logging: logger.LoggingConfig
  52. ratelimiting: ratelimiting.RatelimitConfig
  53. media: repository.ContentRepositoryConfig
  54. captcha: captcha.CaptchaConfig
  55. voip: voip.VoipConfig
  56. registration: registration.RegistrationConfig
  57. metrics: metrics.MetricsConfig
  58. api: api.ApiConfig
  59. appservice: appservice.AppServiceConfig
  60. key: key.KeyConfig
  61. saml2: saml2_config.SAML2Config
  62. cas: cas.CasConfig
  63. sso: sso.SSOConfig
  64. oidc: oidc_config.OIDCConfig
  65. jwt: jwt_config.JWTConfig
  66. auth: auth.AuthConfig
  67. email: emailconfig.EmailConfig
  68. worker: workers.WorkerConfig
  69. authproviders: password_auth_providers.PasswordAuthProviderConfig
  70. push: push.PushConfig
  71. spamchecker: spam_checker.SpamCheckerConfig
  72. groups: groups.GroupsConfig
  73. userdirectory: user_directory.UserDirectoryConfig
  74. consent: consent_config.ConsentConfig
  75. stats: stats.StatsConfig
  76. servernotices: server_notices_config.ServerNoticesConfig
  77. roomdirectory: room_directory.RoomDirectoryConfig
  78. thirdpartyrules: third_party_event_rules.ThirdPartyRulesConfig
  79. tracer: tracer.TracerConfig
  80. redis: redis.RedisConfig
  81. config_classes: List = ...
  82. def __init__(self) -> None: ...
  83. def invoke_all(self, func_name: str, *args: Any, **kwargs: Any): ...
  84. @classmethod
  85. def invoke_all_static(cls, func_name: str, *args: Any, **kwargs: Any) -> None: ...
  86. def __getattr__(self, item: str): ...
  87. def parse_config_dict(
  88. self,
  89. config_dict: Any,
  90. config_dir_path: Optional[Any] = ...,
  91. data_dir_path: Optional[Any] = ...,
  92. ) -> None: ...
  93. read_config: Any = ...
  94. def generate_config(
  95. self,
  96. config_dir_path: str,
  97. data_dir_path: str,
  98. server_name: str,
  99. generate_secrets: bool = ...,
  100. report_stats: Optional[str] = ...,
  101. open_private_ports: bool = ...,
  102. listeners: Optional[Any] = ...,
  103. database_conf: Optional[Any] = ...,
  104. tls_certificate_path: Optional[str] = ...,
  105. tls_private_key_path: Optional[str] = ...,
  106. acme_domain: Optional[str] = ...,
  107. ): ...
  108. @classmethod
  109. def load_or_generate_config(cls, description: Any, argv: Any): ...
  110. @classmethod
  111. def load_config(cls, description: Any, argv: Any): ...
  112. @classmethod
  113. def add_arguments_to_parser(cls, config_parser: Any) -> None: ...
  114. @classmethod
  115. def load_config_with_parser(cls, parser: Any, argv: Any): ...
  116. def generate_missing_files(
  117. self, config_dict: dict, config_dir_path: str
  118. ) -> None: ...
  119. class Config:
  120. root: RootConfig
  121. def __init__(self, root_config: Optional[RootConfig] = ...) -> None: ...
  122. def __getattr__(self, item: str, from_root: bool = ...): ...
  123. @staticmethod
  124. def parse_size(value: Any): ...
  125. @staticmethod
  126. def parse_duration(value: Any): ...
  127. @staticmethod
  128. def abspath(file_path: Optional[str]): ...
  129. @classmethod
  130. def path_exists(cls, file_path: str): ...
  131. @classmethod
  132. def check_file(cls, file_path: str, config_name: str): ...
  133. @classmethod
  134. def ensure_directory(cls, dir_path: str): ...
  135. @classmethod
  136. def read_file(cls, file_path: str, config_name: str): ...
  137. def read_config_files(config_files: List[str]): ...
  138. def find_config_files(search_paths: List[str]): ...
  139. class ShardedWorkerHandlingConfig:
  140. instances: List[str]
  141. def __init__(self, instances: List[str]) -> None: ...
  142. def should_handle(self, instance_name: str, key: str) -> bool: ...
  143. class RoutableShardedWorkerHandlingConfig(ShardedWorkerHandlingConfig):
  144. def get_instance(self, key: str) -> str: ...