_base.pyi 4.0 KB

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