# IQChannels configuration.
# All keys are set to default values when absent.

# --- Database ---

# PostgreSQL, driver pgx
db:
  type: pgx
  connect: host=localhost port=5432 user=iqchannels password=secret database=iqchannels sslmode=disable
#  max_idle: 15                     # Max idle connections in a connection pool. 15+ recommended for stable work
#  max_open: 30                    # Max open connections in a connection pool. 30+ recommended for stable work
#  retry_max: 5                    # Max number of retries on serialization errors, use at least 3.
#  retry_millis: 50                # Max delay is millis between retries on serialization errors.
#  reconnect_max: 2                # Max number of reconnection attempts.
#  max_idle_time: 1m               # If set to <= 0, connections are not closed due to a connection's idle time.
#  max_life_time: 2m               # If set to <= 0, connections are not closed due to a connection's age.

# PostgreSQL, driver lib/pq (deprecated, use pgx above)
# db:
#  type: postgres
#  connect: port=5432 dbname=iqchannels user=iqchannels password=secret sslmode=disable
#  max_idle: 15                     # Max idle connections in a connection pool. 15+ recommended for stable work
#  max_open: 30                    # Max open connections in a connection pool. 30+ recommended for stable work
#  retry_max: 5                    # Max number of retries on serialization errors, use at least 3.
#  retry_millis: 50                # Max delay is millis between retries on serialization errors.
#  max_idle_time: 1m               # If set to <= 0, connections are not closed due to a connection's idle time.
#  max_life_time: 2m               # If set to <= 0, connections are not closed due to a connection's age.

# SQL Server
#db:
#  type: mssql
#  connect: port=1433;database=iqchannels;user id=sa;password=Secret22;encrypt=disable
#  max_idle: 15                     # Max idle connections in a connection pool. 15+ recommended for stable work
#  max_open: 30                    # Max open connections in a connection pool. 30+ recommended for stable work
#  retry_max: 5                    # Max number of retries on serialization errors, use at least 3.
#  retry_millis: 50                # Max delay is millis between retries on serialization errors.
#  mssql_disable_isolation_init: false # Disables setting database snapshot isolation on init.
#  max_idle_time: 1m               # If set to <= 0, connections are not closed due to a connection's idle time.
#  max_life_time: 2m               # If set to <= 0, connections are not closed due to a connection's age.

# Oracle
# Use DNS to specify a connection string (user/password@host:port/sid).
# db:
#  type: oracle
#  connect: iqchannels/secret@localhost:1521/xe
#  max_idle: 15                     # Max idle connections in a connection pool. 15+ recommended for stable work
#  max_open: 30                    # Max open connections in a connection pool. 30+ recommended for stable work
#  retry_max: 5                    # Max number of retries on serialization errors, use at least 3.
#  retry_millis: 50                # Max delay is millis between retries on serialization errors.


## ---- Clusterization ---

#cluster_mode:                      # cluster mode is disabled by default
#  enabled: true                    # to enable clusterization you also need to provide redis settings bellow
#
#redis:
#  mode: single # single, sentinel or cluster
#  network: tcp # The network type, either tcp or unix. Default is tcp.
#  addr: localhost:49153 # host:port address. Addr string for single or sentinel instance
#  db: 1 # Database to be selected after connecting to the server.
#  user: default # user from redis instance
#  password: redispw # pass
#  enable_tls: false # for TLS connections. false by default
#  tls_public_key: public.pem # path to tls public key
#  tls_private_key: private.pem # path to tls private key
#  max_retries: 3 # // Maximum number of retries before giving up. Default is 3 retries; -1 (not 0) disables retries.
#  dial_timeout: 5 # default 5 seconds
#  min_idle_conns: 1 # default 0
#  max_idle_conns: 10 # default 0
#  min_retry_backoff: 8 #Minimum backoff between each retry in milliseconds. Default is 8 milliseconds; -1 disables backoff.
#  max_retry_backoff: 512 #Maximum backoff between each retry. Default is 512 milliseconds; -1 disables backoff.
#  pool_fifo: true # Type of connection pool. true for FIFO pool, false for LIFO pool. Note that FIFO has slightly higher
#                    #overhead compared to LIFO,but it helps closing idle connections faster reducing the pool size.
#  pool_size: 10 # Maximum number of socket connections. Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.

#redis:
#  mode: cluster
#  network: tcp # The network type, either tcp or unix. Default is tcp.
#  addr: localhost:49153 # host:port address
#  db: 1 # Database to be selected after connecting to the server.
#  user: default # user from redis instance
#  password: redispw # pass
#  cluster_addrs: # list of cluster nodes in format host:port, only for cluster mode
#  enable_tls: false # for TLS connections. false by default
#  tls_public_key: public.pem # path to tls public key
#  tls_private_key: private.pem # path to tls private key
#  max_retries: 3 # // Maximum number of retries before giving up. Default is 3 retries; -1 (not 0) disables retries.
#  dial_timeout: 5 # default 5 seconds
#  min_idle_conns: 1 # default 0
#  max_idle_conns: 10 # default 0
#  min_retry_backoff: 8 #Minimum backoff between each retry in milliseconds. Default is 8 milliseconds; -1 disables backoff.
#  max_retry_backoff: 512 #Maximum backoff between each retry. Default is 512 milliseconds; -1 disables backoff.
#  pool_fifo: true # Type of connection pool. true for FIFO pool, false for LIFO pool. Note that FIFO has slightly higher
#  #                    #overhead compared to LIFO,but it helps closing idle connections faster reducing the pool size.
#  pool_size: 10 # Maximum number of socket connections. Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.

#redis:
#  mode: sentinel
#  master_name: master # The master name.
#  sentinel_addrs: # A seed list of host:port addresses of sentinel nodes.
#    -
#    -
#  client_name: client # ClientName will execute the `CLIENT SETNAME ClientName` command for each conn.
#  sentinel_username: sentinel # // If specified with SentinelPassword, enables ACL-based authentication (via AUTH <user> <pass>)
#  sentinel_password: pass # // Sentinel password from "requirepass <password>" (if enabled) in Sentinel configuration, or, if SentinelUsername is also supplied, used for ACL-based authentication.
#  route_randomly: false # Allows routing read-only commands to the random master or replica node.
#  route_by_latency: true # Allows routing read-only commands to the closest master or replica node.
#  replica_only: false #Route all commands to replica read-only nodes.
#  min_retry_backoff: 8 #Minimum backoff between each retry in milliseconds. Default is 8 milliseconds; -1 disables backoff.
#  max_retry_backoff: 512 #Maximum backoff between each retry. Default is 512 milliseconds; -1 disables backoff.
#  db: 1 # Database to be selected after connecting to the server.
#  user: default # user from redis instance
#  password: redispw # pass
#  enable_tls: false # for TLS connections. false by default
#  tls_public_key: public.pem # path to tls public key
#  tls_private_key: private.pem # path to tls private key
#  max_retries: 3 # // Maximum number of retries before giving up. Default is 3 retries; -1 (not 0) disables retries.
#  dial_timeout: 5 # default 5 seconds
#  min_idle_conns: 1 # default 0
#  max_idle_conns: 10 # default 0
#  pool_fifo: true # Type of connection pool. true for FIFO pool, false for LIFO pool. Note that FIFO has slightly higher
#  #                    #overhead compared to LIFO,but it helps closing idle connections faster reducing the pool size.
#  pool_size: 10 # Maximum number of socket connections. Default is 10 connections per every available CPU as reported by runtime.GOMAXPROCS.


# --- Logs ---

#logs:
#  console:                        # Console logger config.
#    enabled: true                 # Enables the logger.
#    level: warn                   # trace|debug|info|warn|error
#
#  file:                           # Rolling file logger config.
#    enabled: true                 # Enables the logger.
#    level: debug                  # trace|debug|info|warn|error
#    path: var/log/iqchanneld.log  # Path to a log file.
#    max_size: 256                 # Max file size in megabytes.
#    max_age: 7                    # Max file age in days.
#    max_backups: 14               # Max files to keep.

# --- Application ---

#clients:
#  secret: "ssyd1mbxsj6vvducjs17"  # Secret key used to sign client sessions, change it to invalidate all sessions.
#  online_timeout: "30s"           # Timeout after which a client is considered offline.
#  url_token_ttl: "60s"            # URL x-client-token query param TTL.

#files:
#  upload_path: "var/upload"       # Path to an upload folder.
#  max_file_size_mb: 32            # Max allowed file size in mb.
#  max_image_height: 5000          # Max allowed image height in pixels.
#  max_image_width: 5000           # Max allowed image width in pixels.
#  convert_path:                   # Path to an ImageMagick convert executable, auto calculated when absent.
#
#  check_auth: false               # Check client auth on file access.
#  link_key: ""                    # File link signature secret key, comment out to use the default random key.
#  link_ttl_sec: 180               # File link TTL in seconds.
#
#  allowed_extensions:             # When present, ONLY files with these extensions are allowed.
#    - jpeg                        # IQChanneld tries to analyze file contents to get its extension.
#    - jpg
#    - png
#    - pdf
#  forbidden_extensions:           # When present, files with these extensions are forbidden.
#    - exe                         # IQChanneld tries to analyze file contents to get its extension.
#    - html
#    - xhtml

#httpd1:
#  listen: ":3001"                 # Public API host:port.
#  listen_tls: ":4001"             # Public TLS API.
#  enable_tls: false               # Enables TLS API, requires certificate and key.
#  certificate: "config/cert.pem"  # Path to a certificate in PEM format with CA certs (as in Nginx).
#  key: "config/key.pem"           # Path to a private key in PEM format (as in Nginx).
#
#  allowed_origins:                # Allowed HTTP origins, an empty list means all are allowed.
#    - www.example.com             # You can define an origin with a schema.
#    - https://example.com
#
#  allowed_referers:               # Allowed HTTP referers, an empty list means all are allowed.
#    - www.example.com             # You can define an origin with a schema.
#    - https://example.com
#
#  cors_origin: ""                 # Deprecated, use allowed_origins instead
#

#httpd2:
#  listen: ":3002"                 # Private API host:port.
#  listen_tls: ":4002"             # Public TLS API.
#  enable_tls: false               # Enables TLS API, requires certificate and key.
#  certificate: "config/cert.pem"  # Path to a certificate in PEM format with CA certs (as in Nginx).
#  key: "config/key.pem"           # Path to a private key in PEM format (as in Nginx).
#
#  allowed_origins:
#    - www.example.com
#    - example.com
#
#  allowed_referers:
#    - www.example.com
#    - example.com
#

#mailings:
#  poll_timeout: "5s"              # Poll timeout for new mailing messages.


#migrations:
#  path: "./migrations"            # Path to a directory with database migrations.

#mq_queues:
#  message_poll_timeout: "1s"      # Timeout to poll messages from a queue.
#  message_schedule_timeout: "1s"  # Timeout to schedule pending messages in a queue.
#  consumer_ttl: "10s"             # Timeout to mark a consumer as dead.

#pusher:
#  max_retry_time: "1h"            # Max time to retry a push-notification.

#user_pusher:
#  max_retry_time: "1h"            # Max time to retry a push-notification.

#sender:
#  security:
#    enable_tls: true
#    allow_self_signed: true         # Can use self-signed certificates from smtp server
#    with_keys: false                # Use private and public keys
#    tls_public_key: public.pem      # path to tls public key
#    keys_server_name: string        # server name for tls config
#    tls_private_key: private.pem    # path to tls private key
#    use_smtp_ssl: false             # Use ssl in smtp client instead of tls
#  max_retry_time: "1h"            # Max time to retry an outgoing bot (Facebook, VK, etc) message.
#  max_concurrent_requests:        # Max number of concurrent bot requests, equals to NumCPU * 4 when absent.


#users:
#  secret: "74yvg6hpvbvl832pbjhw"  # A secret to sign user session tokens, change it to invalidate all user sessions.
#  session_duration_days: 14       # User session duration in days.
#  offline_timeout: "30s"          # Timeout after which a user is considered offline.

#webhooks:
#  max_retries: 10                 # Maximum number of retries.
#  timeout_between_retries_sec: 10 # Retry timeout in seconds.

#imap:
#  check_emails_timeout: 10 #  Seconds between IMAP client checks for new emails in inbox. Таймаут, через который IMAP-клиент проверяет письма в ящике.


#postponed_tickets:
#  check_postponed_tickets_timeout: 15 #  Seconds between separate daemon checks for postponed tickets. Таймаут, через который отдельной демон проверяет отложенные обращения.

#blocked_tickets:
#  check_blocked_tickets_timeout: 15 #  Seconds between separate daemon checks for blocked tickets. Таймаут, через который отдельной демон проверяет заблокированные обращения.

#closing_tickets:
#  check_closing_tickets_timeout: 5 #  Seconds between separate daemon checks for closing tickets. Таймаут, через который отдельной демон проверяет обращения на закрытии.

#blocked_clients:
#  check_blocked_clients_timeout: 15 #  Seconds between separate daemon checks for blocked clients. Таймаут, через который отдельной демон проверяет заблокированных клиентов.

#autocloser:
# check_autoclose_timeout: 30  #  Seconds between separate daemon checks for autocloser. Таймаут, через который отдельной демон проверяет обращения на автозакрытии.

#users_mobile:              #  Seconds between separate daemon checks for users mobile session.
#  user_mobile_timeout: 15  #  Таймаут, через который отдельный демон проверяет сессии пользователей в мобильном приложении.

#email_templates:
#  path: "./templates"            # Path to a directory with email templates.

#inactivator_config:              # Проверяет пользователей. Если они неактивны, то переводит в соответствующий статус
#  inactivate_timeout: 10         # В секундах

#router_config:                   # Самый главный шедулер. Отвечает за назначение обращений. 1(секунда) по умолчанию. Можно увеличить, чтобы снизить нагрузка на систему
#  router_timeout: 5              # В секундах

#logouter_config:
  #logout_timeout: 10           # Проверяет пользователей для их логаута. В секундах

#mailer_config:
  #mailer_timeout: 30             # Занимается рассылками. В секундах

#search_server:
#  url: http://localhost:8080

#antivirus_config:                                         # Настройка сервиса антивируса для файлов
#  enabled: false                                          # enabled - true\false, включен ли сервис
#  timeout: 15s                                            # timeout - шедулер для проверки статусов файлов в сервисе
#  kata_options:                                           # kata_options - Настройки для работы с сервисом KATA
#    enabled: false                                        # enabled - true\false, включен ли сервис KATA
#    scope: clients                                        # scope - область, в которой работает антивирус, может быть operators, clients, all
#    host: 0.0.0.0                                         # host - URL-адрес сервера с компонентом Central Node
#    port: 443                                             # port - порт, по умолчанию 443
#    tls_cert_path: ./client.crt                           # tls_cert_path - путь к файлу TLS-сертификата
#    private_key_path: ./client.key                        # private_key_path - путь к файлу закрытого ключа
#    sensor_guid: 97531605-4fc4-4e4e-b9e6-9576a44fab56     # sensor_guid - идентификатор sensorId
#  kse_options:                                            # kse_options - Настройки для работы с сервисом KSE
#    enabled: true                                         # enabled - true\false, включен ли сервис
#    scope: clients                                        # scope - область, в которой работает антивирус, может быть operators, clients, all
#    icap_server:                                          # icap_server - настройка icap сервера
#      host: 0.0.0.0                                       # host - host icap сервера
#      port: 443                                           # port - port icap сервера
#      enable_tls: false                                   # enable_tls - включение tls icap сервера

#dlp_config:              # dlp_config - Настройки для работы с сервисом DLP
#  enabled: true          # enabled - true\false, включен ли сервис
#  timeout: 5s            # timeout - шедулер для проверки статусов сообщений в сервисе
#  icap_server:           # icap_server - настройка icap сервера
#    host: 0.0.0.0        # host - host icap сервера
#    port: 443            # port - port icap сервера
#    enable_tls: false    # enable_tls - включение tls icap сервера

#secrets_crypto_config:                             # Занимается шифрованием ключей\паролей\токенов в сервисах
#  enabled: false                                   # (!!!) enabled - Будьте осторожны, если у вас включена эта настройка, при отключении придется
#  method: aes                                      # заново вводить все данные в следующих сервисах:
#  private_key: 74yvg6hpvbvl832pbjhws192j90s8129    # Внутренний чат (FCM, APNs), Active Directory, Настройки синхронизации персональных менеджеров,
#                                                   # внешние каналы (телерам, вк, вайбер, почта, фейсбук, infobip, edna), Системы учета обращений,
#                                                   # Настройка почты для отправки логина и пароля, Чат-бот платформы
#                                                   # method - Определяет метод шифрования. Доступные: AES
#                                                   # private_key - Приватный ключ для шифрования, (!!!) Может иметь длину 16, 24,
#                                                   # или 32 для AES-128, AES-192, или AES-256 соответственно.

#keycloak_config:                         # Настройка авторизации пользователей через Keycloak. Взаимоисключающая с обычной авторизацией.
#  enabled: false                         # enabled - false\true
#  url: https://<keycloak_domain>         # url - адрес сервиса Keycloak
#  realm: pavel-test                      # realm - Realm в сервисе
#  client_id: test-spa                    # client_id - Идентификатор клиента в сервисе
#  admin_username: admin                  # admin_username, admin_password - Логин и пароль для авторизации сервисного пользователя
#  admin_password: admin                  # Пользователь должен обладать следующими полномочиями: Получение сертификатов для проверки JWT токена.

# sse:                   # Настройка sse-соединения со стороны клиента
  # ping_interval: 5m    # Интервал пересоздания sse-соединения

# knowledge_base: #Настройки подключения к сервису базы знаний
  # base_url: http://localhost:3004 #базовый url базы знаний
  
# routes:
  # route_to_groups_ticket_limit: 100
  # route_to_users_ticket_limit: 100
