2020-12-08 09:04:35 -05:00
|
|
|
from typing import Any, Iterable, List, Optional
|
2019-10-10 04:39:35 -04:00
|
|
|
|
|
|
|
from synapse.config import (
|
|
|
|
api,
|
|
|
|
appservice,
|
2020-12-18 07:33:57 -05:00
|
|
|
auth,
|
2019-10-10 04:39:35 -04:00
|
|
|
captcha,
|
|
|
|
cas,
|
|
|
|
consent_config,
|
|
|
|
database,
|
|
|
|
emailconfig,
|
2021-01-27 07:41:24 -05:00
|
|
|
experimental,
|
2019-10-10 04:39:35 -04:00
|
|
|
groups,
|
|
|
|
jwt_config,
|
|
|
|
key,
|
|
|
|
logger,
|
|
|
|
metrics,
|
2020-05-08 08:30:40 -04:00
|
|
|
oidc_config,
|
2019-10-10 04:39:35 -04:00
|
|
|
password_auth_providers,
|
|
|
|
push,
|
|
|
|
ratelimiting,
|
2021-01-26 08:57:31 -05:00
|
|
|
redis,
|
2019-10-10 04:39:35 -04:00
|
|
|
registration,
|
|
|
|
repository,
|
|
|
|
room_directory,
|
|
|
|
saml2_config,
|
|
|
|
server,
|
|
|
|
server_notices_config,
|
|
|
|
spam_checker,
|
2020-03-02 11:36:32 -05:00
|
|
|
sso,
|
2019-10-10 04:39:35 -04:00
|
|
|
stats,
|
|
|
|
third_party_event_rules,
|
|
|
|
tls,
|
|
|
|
tracer,
|
|
|
|
user_directory,
|
|
|
|
voip,
|
|
|
|
workers,
|
|
|
|
)
|
|
|
|
|
2020-12-08 09:04:35 -05:00
|
|
|
class ConfigError(Exception):
|
|
|
|
def __init__(self, msg: str, path: Optional[Iterable[str]] = None):
|
|
|
|
self.msg = msg
|
|
|
|
self.path = path
|
2019-10-10 04:39:35 -04:00
|
|
|
|
|
|
|
MISSING_REPORT_STATS_CONFIG_INSTRUCTIONS: str
|
|
|
|
MISSING_REPORT_STATS_SPIEL: str
|
|
|
|
MISSING_SERVER_NAME: str
|
|
|
|
|
|
|
|
def path_exists(file_path: str): ...
|
|
|
|
|
|
|
|
class RootConfig:
|
|
|
|
server: server.ServerConfig
|
2021-01-27 07:41:24 -05:00
|
|
|
experimental: experimental.ExperimentalConfig
|
2019-10-10 04:39:35 -04:00
|
|
|
tls: tls.TlsConfig
|
|
|
|
database: database.DatabaseConfig
|
|
|
|
logging: logger.LoggingConfig
|
2021-01-28 12:39:21 -05:00
|
|
|
ratelimiting: ratelimiting.RatelimitConfig
|
2019-10-10 04:39:35 -04:00
|
|
|
media: repository.ContentRepositoryConfig
|
|
|
|
captcha: captcha.CaptchaConfig
|
|
|
|
voip: voip.VoipConfig
|
|
|
|
registration: registration.RegistrationConfig
|
|
|
|
metrics: metrics.MetricsConfig
|
|
|
|
api: api.ApiConfig
|
|
|
|
appservice: appservice.AppServiceConfig
|
|
|
|
key: key.KeyConfig
|
|
|
|
saml2: saml2_config.SAML2Config
|
|
|
|
cas: cas.CasConfig
|
2020-03-02 11:36:32 -05:00
|
|
|
sso: sso.SSOConfig
|
2020-05-08 08:30:40 -04:00
|
|
|
oidc: oidc_config.OIDCConfig
|
2019-10-10 04:39:35 -04:00
|
|
|
jwt: jwt_config.JWTConfig
|
2020-12-18 07:33:57 -05:00
|
|
|
auth: auth.AuthConfig
|
2019-10-10 04:39:35 -04:00
|
|
|
email: emailconfig.EmailConfig
|
|
|
|
worker: workers.WorkerConfig
|
|
|
|
authproviders: password_auth_providers.PasswordAuthProviderConfig
|
|
|
|
push: push.PushConfig
|
|
|
|
spamchecker: spam_checker.SpamCheckerConfig
|
|
|
|
groups: groups.GroupsConfig
|
|
|
|
userdirectory: user_directory.UserDirectoryConfig
|
|
|
|
consent: consent_config.ConsentConfig
|
|
|
|
stats: stats.StatsConfig
|
|
|
|
servernotices: server_notices_config.ServerNoticesConfig
|
|
|
|
roomdirectory: room_directory.RoomDirectoryConfig
|
|
|
|
thirdpartyrules: third_party_event_rules.ThirdPartyRulesConfig
|
|
|
|
tracer: tracer.TracerConfig
|
2021-01-26 08:57:31 -05:00
|
|
|
redis: redis.RedisConfig
|
2019-10-10 04:39:35 -04:00
|
|
|
|
|
|
|
config_classes: List = ...
|
|
|
|
def __init__(self) -> None: ...
|
|
|
|
def invoke_all(self, func_name: str, *args: Any, **kwargs: Any): ...
|
|
|
|
@classmethod
|
|
|
|
def invoke_all_static(cls, func_name: str, *args: Any, **kwargs: Any) -> None: ...
|
|
|
|
def __getattr__(self, item: str): ...
|
|
|
|
def parse_config_dict(
|
|
|
|
self,
|
|
|
|
config_dict: Any,
|
|
|
|
config_dir_path: Optional[Any] = ...,
|
|
|
|
data_dir_path: Optional[Any] = ...,
|
|
|
|
) -> None: ...
|
|
|
|
read_config: Any = ...
|
|
|
|
def generate_config(
|
|
|
|
self,
|
|
|
|
config_dir_path: str,
|
|
|
|
data_dir_path: str,
|
|
|
|
server_name: str,
|
|
|
|
generate_secrets: bool = ...,
|
|
|
|
report_stats: Optional[str] = ...,
|
|
|
|
open_private_ports: bool = ...,
|
|
|
|
listeners: Optional[Any] = ...,
|
|
|
|
database_conf: Optional[Any] = ...,
|
|
|
|
tls_certificate_path: Optional[str] = ...,
|
|
|
|
tls_private_key_path: Optional[str] = ...,
|
|
|
|
acme_domain: Optional[str] = ...,
|
|
|
|
): ...
|
|
|
|
@classmethod
|
|
|
|
def load_or_generate_config(cls, description: Any, argv: Any): ...
|
|
|
|
@classmethod
|
|
|
|
def load_config(cls, description: Any, argv: Any): ...
|
|
|
|
@classmethod
|
|
|
|
def add_arguments_to_parser(cls, config_parser: Any) -> None: ...
|
|
|
|
@classmethod
|
|
|
|
def load_config_with_parser(cls, parser: Any, argv: Any): ...
|
|
|
|
def generate_missing_files(
|
|
|
|
self, config_dict: dict, config_dir_path: str
|
|
|
|
) -> None: ...
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
root: RootConfig
|
|
|
|
def __init__(self, root_config: Optional[RootConfig] = ...) -> None: ...
|
|
|
|
def __getattr__(self, item: str, from_root: bool = ...): ...
|
|
|
|
@staticmethod
|
|
|
|
def parse_size(value: Any): ...
|
|
|
|
@staticmethod
|
|
|
|
def parse_duration(value: Any): ...
|
|
|
|
@staticmethod
|
|
|
|
def abspath(file_path: Optional[str]): ...
|
|
|
|
@classmethod
|
|
|
|
def path_exists(cls, file_path: str): ...
|
|
|
|
@classmethod
|
|
|
|
def check_file(cls, file_path: str, config_name: str): ...
|
|
|
|
@classmethod
|
|
|
|
def ensure_directory(cls, dir_path: str): ...
|
|
|
|
@classmethod
|
|
|
|
def read_file(cls, file_path: str, config_name: str): ...
|
|
|
|
|
|
|
|
def read_config_files(config_files: List[str]): ...
|
|
|
|
def find_config_files(search_paths: List[str]): ...
|
2020-07-16 09:06:28 -04:00
|
|
|
|
|
|
|
class ShardedWorkerHandlingConfig:
|
|
|
|
instances: List[str]
|
|
|
|
def __init__(self, instances: List[str]) -> None: ...
|
|
|
|
def should_handle(self, instance_name: str, key: str) -> bool: ...
|
2021-02-24 08:23:18 -05:00
|
|
|
|
|
|
|
class RoutableShardedWorkerHandlingConfig(ShardedWorkerHandlingConfig):
|
2020-09-14 05:16:41 -04:00
|
|
|
def get_instance(self, key: str) -> str: ...
|
2021-03-09 10:03:37 -05:00
|
|
|
|
|
|
|
def read_file(file_path: Any, config_path: Iterable[str]) -> str: ...
|