_base.pyi 4.6 KB

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