2020-12-08 07:04:35 -07:00
|
|
|
from typing import Any, Iterable, List, Optional
|
2019-10-10 02:39:35 -06:00
|
|
|
|
|
|
|
from synapse.config import (
|
2021-04-19 12:16:34 -06:00
|
|
|
account_validity,
|
2019-10-10 02:39:35 -06:00
|
|
|
api,
|
|
|
|
appservice,
|
2020-12-18 05:33:57 -07:00
|
|
|
auth,
|
2021-07-05 09:32:12 -06:00
|
|
|
cache,
|
2019-10-10 02:39:35 -06:00
|
|
|
captcha,
|
|
|
|
cas,
|
2021-04-20 12:55:20 -06:00
|
|
|
consent,
|
2019-10-10 02:39:35 -06:00
|
|
|
database,
|
|
|
|
emailconfig,
|
2021-01-27 05:41:24 -07:00
|
|
|
experimental,
|
2021-06-21 07:38:59 -06:00
|
|
|
federation,
|
2019-10-10 02:39:35 -06:00
|
|
|
groups,
|
2021-04-20 12:55:20 -06:00
|
|
|
jwt,
|
2019-10-10 02:39:35 -06:00
|
|
|
key,
|
|
|
|
logger,
|
|
|
|
metrics,
|
2021-06-18 05:15:52 -06:00
|
|
|
modules,
|
2021-04-20 12:55:20 -06:00
|
|
|
oidc,
|
2019-10-10 02:39:35 -06:00
|
|
|
password_auth_providers,
|
|
|
|
push,
|
|
|
|
ratelimiting,
|
2021-01-26 06:57:31 -07:00
|
|
|
redis,
|
2019-10-10 02:39:35 -06:00
|
|
|
registration,
|
|
|
|
repository,
|
|
|
|
room_directory,
|
2021-04-20 12:55:20 -06:00
|
|
|
saml2,
|
2019-10-10 02:39:35 -06:00
|
|
|
server,
|
2021-04-20 12:55:20 -06:00
|
|
|
server_notices,
|
2019-10-10 02:39:35 -06:00
|
|
|
spam_checker,
|
2020-03-02 09:36:32 -07:00
|
|
|
sso,
|
2019-10-10 02:39:35 -06:00
|
|
|
stats,
|
|
|
|
third_party_event_rules,
|
|
|
|
tls,
|
|
|
|
tracer,
|
|
|
|
user_directory,
|
|
|
|
voip,
|
|
|
|
workers,
|
|
|
|
)
|
|
|
|
|
2020-12-08 07:04:35 -07:00
|
|
|
class ConfigError(Exception):
|
|
|
|
def __init__(self, msg: str, path: Optional[Iterable[str]] = None):
|
|
|
|
self.msg = msg
|
|
|
|
self.path = path
|
2019-10-10 02:39:35 -06: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 05:41:24 -07:00
|
|
|
experimental: experimental.ExperimentalConfig
|
2019-10-10 02:39:35 -06:00
|
|
|
tls: tls.TlsConfig
|
|
|
|
database: database.DatabaseConfig
|
|
|
|
logging: logger.LoggingConfig
|
2021-01-28 10:39:21 -07:00
|
|
|
ratelimiting: ratelimiting.RatelimitConfig
|
2019-10-10 02:39:35 -06:00
|
|
|
media: repository.ContentRepositoryConfig
|
|
|
|
captcha: captcha.CaptchaConfig
|
|
|
|
voip: voip.VoipConfig
|
|
|
|
registration: registration.RegistrationConfig
|
2021-04-19 12:16:34 -06:00
|
|
|
account_validity: account_validity.AccountValidityConfig
|
2019-10-10 02:39:35 -06:00
|
|
|
metrics: metrics.MetricsConfig
|
|
|
|
api: api.ApiConfig
|
|
|
|
appservice: appservice.AppServiceConfig
|
|
|
|
key: key.KeyConfig
|
2021-04-20 12:55:20 -06:00
|
|
|
saml2: saml2.SAML2Config
|
2019-10-10 02:39:35 -06:00
|
|
|
cas: cas.CasConfig
|
2020-03-02 09:36:32 -07:00
|
|
|
sso: sso.SSOConfig
|
2021-04-20 12:55:20 -06:00
|
|
|
oidc: oidc.OIDCConfig
|
|
|
|
jwt: jwt.JWTConfig
|
2020-12-18 05:33:57 -07:00
|
|
|
auth: auth.AuthConfig
|
2019-10-10 02:39:35 -06: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
|
2021-04-20 12:55:20 -06:00
|
|
|
consent: consent.ConsentConfig
|
2019-10-10 02:39:35 -06:00
|
|
|
stats: stats.StatsConfig
|
2021-04-20 12:55:20 -06:00
|
|
|
servernotices: server_notices.ServerNoticesConfig
|
2019-10-10 02:39:35 -06:00
|
|
|
roomdirectory: room_directory.RoomDirectoryConfig
|
|
|
|
thirdpartyrules: third_party_event_rules.ThirdPartyRulesConfig
|
|
|
|
tracer: tracer.TracerConfig
|
2021-01-26 06:57:31 -07:00
|
|
|
redis: redis.RedisConfig
|
2021-06-18 05:15:52 -06:00
|
|
|
modules: modules.ModulesConfig
|
2021-07-05 09:32:12 -06:00
|
|
|
caches: cache.CacheConfig
|
2021-06-21 07:38:59 -06:00
|
|
|
federation: federation.FederationConfig
|
2019-10-10 02:39:35 -06: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] = ...,
|
|
|
|
): ...
|
|
|
|
@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 07:06:28 -06: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 06:23:18 -07:00
|
|
|
|
|
|
|
class RoutableShardedWorkerHandlingConfig(ShardedWorkerHandlingConfig):
|
2020-09-14 03:16:41 -06:00
|
|
|
def get_instance(self, key: str) -> str: ...
|
2021-03-09 08:03:37 -07:00
|
|
|
|
|
|
|
def read_file(file_path: Any, config_path: Iterable[str]) -> str: ...
|