_base.pyi 4.8 KB

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