class clickhouse(ConfigSection): rw_addresses = ServiceParameter(service="clickhouse", wait=True) db = StringParameter(default="noc") rw_user = StringParameter(default="default") rw_password = SecretParameter() ro_addresses = ServiceParameter(service="clickhouse", wait=True) ro_user = StringParameter(default="readonly") ro_password = SecretParameter() request_timeout = SecondsParameter(default="1h") connect_timeout = SecondsParameter(default="10s") default_merge_tree_granularity = IntParameter(default=8192) encoding = StringParameter(default="", choices=["", "deflate", "gzip"]) # Enable LowCardinality fileds enable_low_cardinality = BooleanParameter(default=False) # Cluster name for sharded/replicated configuration # Matches appropriative <remote_servers> part cluster = StringParameter() # Cluster topology # Expression in form # <topology> ::= <shard> | <shard>,<topology> # <shard> ::= [<weight>]<replicas> # <weight> := <DIGITS> # <replicas> := <DIGITS> # Examples: # 1 - non-replicated, non-sharded configuration # 1,1 - 2 shards, non-replicated # 2,2 - 2 shards, 2 replicas in each # 3:2,2 - first shard has 2 replicas an weight 3, # second shard has 2 replicas and weight 1 cluster_topology = StringParameter(default="1")
class geocoding(ConfigSection): order = StringParameter(default="yandex,google") yandex_key = SecretParameter(default="") yandex_apikey = SecretParameter(default="") google_key = SecretParameter(default="") google_language = StringParameter(default="en") negative_ttl = SecondsParameter(default="7d", help="Period then saving bad result")
class mailsender(ConfigSection): smtp_server = StringParameter() smtp_port = IntParameter(default=25) use_tls = BooleanParameter(default=False) helo_hostname = StringParameter(default="noc") from_address = StringParameter(default="*****@*****.**") smtp_user = StringParameter() smtp_password = SecretParameter()
class pg(ConfigSection): addresses = ServiceParameter(service="postgres", wait=True, near=True, full_result=False) db = StringParameter(default="noc") user = StringParameter() password = SecretParameter() connect_timeout = IntParameter(default=5)
class kafkasender(ConfigSection): bootstrap_servers = StringParameter() username = StringParameter() password = SecretParameter() sasl_mechanism = StringParameter( choices=["PLAIN", "GSSAPI", "SCRAM-SHA-256", "SCRAM-SHA-512"], default="PLAIN") security_protocol = StringParameter( choices=["PLAINTEXT", "SASL_PLAINTEXT", "SSL", "SASL_SSL"], default="PLAINTEXT")
class mongo(ConfigSection): addresses = ServiceParameter(service="mongo", wait=True) db = StringParameter(default="noc") user = StringParameter() password = SecretParameter() rs = StringParameter() retries = IntParameter(default=20) timeout = SecondsParameter(default="3s") retry_writes = BooleanParameter(default=False) app_name = StringParameter() max_idle_time = SecondsParameter(default="60s")
class login(ConfigSection): methods = StringParameter(default="local") session_ttl = SecondsParameter(default="7d") language = StringParameter(default="en") restrict_to_group = StringParameter(default="") single_session_group = StringParameter(default="") mutual_exclusive_group = StringParameter(default="") idle_timeout = SecondsParameter(default="1w") pam_service = StringParameter(default="noc") radius_secret = SecretParameter(default="noc") radius_server = StringParameter() user_cookie_ttl = IntParameter(default=1)
class login(ConfigSection): methods = StringParameter(default="local") session_ttl = SecondsParameter(default="7d") language = StringParameter(default="en") restrict_to_group = StringParameter(default="") single_session_group = StringParameter(default="") mutual_exclusive_group = StringParameter(default="") idle_timeout = SecondsParameter(default="1w") pam_service = StringParameter(default="noc") radius_secret = SecretParameter(default="noc") radius_server = StringParameter() register_last_login = BooleanParameter(default=True) jwt_cookie_name = StringParameter(default="noc_jwt") jwt_algorithm = StringParameter(default="HS256", choices=["HS256", "HS384", "HS512"])
class consul(ConfigSection): token = SecretParameter() connect_timeout = SecondsParameter(default="5s") request_timeout = SecondsParameter(default="1h") near_retry_timeout = IntParameter(default=1) host = StringParameter(default="consul") port = IntParameter(default=8500) check_interval = SecondsParameter(default="10s") check_timeout = SecondsParameter(default="1s") release = SecondsParameter(default="1M") session_ttl = SecondsParameter(default="10s") lock_delay = SecondsParameter(default="20s") retry_timeout = SecondsParameter(default="1s") keepalive_attempts = IntParameter(default=5) base = StringParameter(default="noc", help="kv lookup base")
class tgsender(ConfigSection): token = SecretParameter() retry_timeout = IntParameter(default=2) use_proxy = BooleanParameter(default=False)
class Config(BaseConfig): secret = SecretParameter()