Bootstrap Configuration

      +

      Reference data on the contents of Sync Gateway’s bootstrap configuration, which determines its run time behavior.

      Pre-3.0 Legacy Configuration Equivalents

      This content describes configuration for Sync Gateway 3.0 and higher — for legacy configuration, see: Legacy Pre-3.0 Configuration

      Introduction

      The Sync Gateway bootstrap configuration is provisioned in a JSON format file. The configuration properties define sync gateway’s runtime behavior. See the schema below for more details on these properties.

      Sync gateway will look for the following configuration file unless you direct it otherwise:
      /home/sync_gateway/sync_gateway.json

      Use the following command to run Sync Gateway with a configuration file:

      sync_gateway sync-gateway-bootstrap.json

      Bootstrap Configuration Schema

      This schema identifies all the configurable properties.

      {
         api: {
            admin_interface: "127.0.0.1:4985",
            admin_interface_authentication: true,
            compress_responses: true,
            cors: {
               headers: [],
               login_origin: [],
               max_age: 0,
               origin: []
            },
            enable_advanced_auth_dp: true,
            hide_product_version: true,
            https: {
               tls_cert_path: "string",
               tls_key_path: "string",
               tls_minimum_version: "tlsv1.2"
            },
            idle_timeout: "90s",
            max_connections: 0,
            metric_interface: "127.0.0.1:4986",
            metrics_interface_authentication: true,
            pretty: true,
            profile_interface: "string",
            public_interface: ":4984",
            read_header_timeout: "5s",
            server_read_timeout: "string",
            server_write_timeout: "string"
         },
         auth: {
            bcrypt_cost: 10
         },
         bootstrap: {
            ca_cert_path: "string",
            config_update_frequency: "10s",
            group_id: "default",
            password: "string",
            server: "string",
            server_tls_skip_verify: false,
            use_tls_server: true,
            username: "string",
            x509_cert_path: "string",
            x509_key_path: "string"
         },
         bucket_credentials: {
            {bucketname...}: {
               password: "string",
               username: "string",
               x509_cert_path: "string",
               x509_key_path: "string"
            }
         },
         couchbase_keepalive_interval: 0,
         database_credentials: {
            {databasename...}: {
               password: "string",
               username: "string",
               x509_cert_path: "string",
               x509_key_path: "string"
            }
         },
         logging: {
            console: {
               collation_buffer_size: 0,
               color_enabled: true,
               enabled: true,
               file_output: "string",
               log_keys: [],
               log_level: "none",
               rotation: {
                  localtime: true,
                  max_age: 0,
                  max_size: 0,
                  rotated_logs_size: 0
               }
            },
            debug: {
               collation_buffer_size: 0,
               enabled: true,
               rotation: {
                  localtime: true,
                  max_age: 0,
                  max_size: 0,
                  rotated_logs_size: 0
               }
            },
            error: {
               collation_buffer_size: 0,
               enabled: true,
               rotation: {
                  localtime: true,
                  max_age: 0,
                  max_size: 0,
                  rotated_logs_size: 0
               }
            },
            info: {
               collation_buffer_size: 0,
               enabled: true,
               rotation: {
                  localtime: true,
                  max_age: 0,
                  max_size: 0,
                  rotated_logs_size: 0
               }
            },
            log_file_path: "string",
            redaction_level: "partial",
            stats: {
               collation_buffer_size: 0,
               enabled: true,
               rotation: {
                  localtime: true,
                  max_age: 0,
                  max_size: 0,
                  rotated_logs_size: 0
               }
            },
            trace: {
               collation_buffer_size: 0,
               enabled: true,
               rotation: {
                  localtime: true,
                  max_age: 0,
                  max_size: 0,
                  rotated_logs_size: 0
               }
            },
            warn: {
               collation_buffer_size: 0,
               enabled: true,
               rotation: {
                  localtime: true,
                  max_age: 0,
                  max_size: 0,
                  rotated_logs_size: 0
               }
            }
         },
         max_file_descriptors: 5000,
         replicator: {
            blip_compression: 0,
            max_heartbeat: "string"
         },
         unsupported: {
            http2: {
               enabled: true
            },
            serverless: {
               enabled: true,
               min_config_fetch_interval: "1s"
            },
            stats_log_frequency: "1m",
            use_stdlib_json: true,
            use_xattr_config: true
         }
      }
      

      api

      Type

      object

      Description

      Configuration settings for modifying how the REST API is interacted with.

      api.admin_interface

      Type

      string

      Description

      Network interface to bind admin API to.

      By default, this will only be accessible to the localhost.

      api.admin_interface_authentication

      Type

      boolean

      Description

      Whether the admin API requires authentication

      api.compress_responses

      Type

      boolean

      Description

      If false, disables compression of HTTP responses

      api.cors.headers

      Type

      array

      Description

      List of allowed headers

      api.cors.login_origin

      Type

      array

      Description

      List of allowed login origins

      api.cors.max_age

      Type

      integer

      Description

      Maximum age of the CORS Options request

      api.cors.origin

      Type

      array

      Description

      List of allowed origins, use ['*'] to allow access from everywhere

      api.enable_advanced_auth_dp

      Type

      boolean

      Description

      Whether to enable the DP permissions check feature of admin auth.

      Defaults to true if using enterprise-edition or false if using community-edition.

      api.hide_product_version

      Type

      boolean

      Description

      Whether product versions removed from Server headers and REST API responses

      api.https.tls_cert_path

      Type

      string

      Description

      The TLS cert file to use for the REST APIs

      api.https.tls_key_path

      Type

      string

      Description

      The TLS key file to use for the REST APIs

      api.https.tls_minimum_version

      Type

      string

      Description

      The minimum allowable TLS version for the REST APIs

      api.idle_timeout

      Type

      string

      Description

      The maximum amount of time to wait for the next request when keep-alives are enabled.

      This is a duration and therefore can be provided with units "h", "m", "s", "ms", "us", and "ns". For example, 5 hours, 20 minutes, and 30 seconds would be 5h20m30s.

      api.max_connections

      Type

      number

      Description

      Max of incoming HTTP connections to accept

      api.metric_interface

      Type

      string

      Description

      Network interface to bind metrics API to.

      By default, this will only be accessible to the localhost.

      api.metrics_interface_authentication

      Type

      boolean

      Description

      Whether the metrics API requires authentication

      api.pretty

      Type

      boolean

      Description

      Pretty-print JSON responses

      api.profile_interface

      Type

      string

      Description

      Network interface to bind profiling API to

      api.public_interface

      Type

      string

      Description

      Network interface to bind public API to

      api.read_header_timeout

      Type

      string

      Description

      The amount of time allowed to read request headers.

      This is a duration and therefore can be provided with units "h", "m", "s", "ms", "us", and "ns". For example, 5 hours, 20 minutes, and 30 seconds would be 5h20m30s.

      api.server_read_timeout

      Type

      string

      Description

      Maximum duration.Second before timing out read of the HTTP(S) request.

      This is a duration and therefore can be provided with units "h", "m", "s", "ms", "us", and "ns". For example, 5 hours, 20 minutes, and 30 seconds would be 5h20m30s.

      api.server_write_timeout

      Type

      string

      Description

      Maximum duration.Second before timing out write of the HTTP(S) response.

      This is a duration and therefore can be provided with units "h", "m", "s", "ms", "us", and "ns". For example, 5 hours, 20 minutes, and 30 seconds would be 5h20m30s.

      auth.bcrypt_cost

      Type

      integer

      Description

      Cost to use for bcrypt password hashes

      bootstrap

      Type

      object

      Description

      Configuration settings for interacting with Couchbase Server.

      bootstrap.ca_cert_path

      Type

      string

      Description

      Root CA cert path for TLS connection

      bootstrap.config_update_frequency

      Type

      string

      Description

      How often to poll Couchbase Server for new config changes.

      This is a duration and therefore can be provided with units "h", "m", "s", "ms", "us", and "ns". For example, 5 hours, 20 minutes, and 30 seconds would be 5h20m30s.

      bootstrap.group_id

      Type

      string

      Description

      The config group ID to use when discovering databases. Allows for non-homogenous configuration.

      bootstrap.password

      Type

      string

      Description

      Password for authenticating to server

      bootstrap.server

      Type

      string

      Description

      Couchbase Server connection string/URL.

      bootstrap.server_tls_skip_verify

      Type

      boolean

      Description

      Allow empty server CA Cert Path without attempting to use system root pool

      bootstrap.use_tls_server

      Type

      boolean

      Description

      Enforces a secure or non-secure server scheme

      bootstrap.username

      Type

      string

      Description

      Username for authenticating to server.

      bootstrap.x509_cert_path

      Type

      string

      Description

      Cert path (public key) for X.509 bucket auth

      bootstrap.x509_key_path

      Type

      string

      Description

      Key path (private key) for X.509 bucket auth

      bucket_credentials

      Type

      object

      Description

      A map of bucket names to credentials, that can be used instead of the bootstrap ones.

      bucket_credentials.{bucketname…​}

      Type

      object

      Description

      The configuration for the credentials set.

      bucket_credentials.{bucketname…​}.password

      Type

      string

      Description

      Password for authenticating to the bucket. This value is always redacted.

      bucket_credentials.{bucketname…​}.username

      Type

      string

      Description

      Username for authenticating to the bucket

      bucket_credentials.{bucketname…​}.x509_cert_path

      Type

      string

      Description

      Cert path (public key) for X.509 bucket auth

      bucket_credentials.{bucketname…​}.x509_key_path

      Type

      string

      Description

      Key path (private key) for X.509 bucket auth

      couchbase_keepalive_interval

      Type

      integer

      Description

      TCP keep-alive interval between SG and Couchbase server

      database_credentials

      Type

      object

      Description

      A map of database name to credentials, that can be used instead of the bootstrap ones.

      database_credentials.{databasename…​}

      Type

      object

      Description

      The configuration for the credentials set.

      database_credentials.{databasename…​}.password

      Type

      string

      Description

      Password for authenticating to the bucket. This value is always redacted.

      database_credentials.{databasename…​}.username

      Type

      string

      Description

      Username for authenticating to the bucket

      database_credentials.{databasename…​}.x509_cert_path

      Type

      string

      Description

      Cert path (public key) for X.509 bucket auth

      database_credentials.{databasename…​}.x509_key_path

      Type

      string

      Description

      Key path (private key) for X.509 bucket auth

      logging

      Type

      object

      Description

      The configuration settings for modifying Sync Gateway logging.

      logging.console.collation_buffer_size

      Type

      integer

      Description

      The size of the log collation buffer.

      logging.console.color_enabled

      Type

      boolean

      Description

      Log with color for the console output

      logging.console.enabled

      Type

      boolean

      Description

      Toggle for this log output

      logging.console.file_output

      Type

      string

      Description

      Override the default stderr output, and write to the file specified instead

      logging.console.log_keys

      Type

      array

      Description

      Log Keys for the console output

      logging.console.log_level

      Type

      string

      Description

      Log Level for the console output

      logging.console.rotation.localtime

      Type

      boolean

      Description

      If true, it uses the computer's local time to format the backup timestamp.

      logging.console.rotation.max_age

      Type

      integer

      Description

      The maximum number of days to retain old log files.

      logging.console.rotation.max_size

      Type

      integer

      Description

      The maximum size in MB of the log file before it gets rotated.

      logging.console.rotation.rotated_logs_size

      Type

      integer

      Description

      Max Size (in mb) of log files before deletion

      logging.debug.collation_buffer_size

      Type

      integer

      Description

      The size of the log collation buffer

      logging.debug.enabled

      Type

      boolean

      Description

      Toggle for this log output

      logging.debug.rotation.localtime

      Type

      boolean

      Description

      If true, it uses the computer's local time to format the backup timestamp.

      logging.debug.rotation.max_age

      Type

      integer

      Description

      The maximum number of days to retain old log files.

      logging.debug.rotation.max_size

      Type

      integer

      Description

      The maximum size in MB of the log file before it gets rotated.

      logging.debug.rotation.rotated_logs_size

      Type

      integer

      Description

      Max Size (in mb) of log files before deletion

      logging.error.collation_buffer_size

      Type

      integer

      Description

      The size of the log collation buffer

      logging.error.enabled

      Type

      boolean

      Description

      Toggle for this log output

      logging.error.rotation.localtime

      Type

      boolean

      Description

      If true, it uses the computer's local time to format the backup timestamp.

      logging.error.rotation.max_age

      Type

      integer

      Description

      The maximum number of days to retain old log files.

      logging.error.rotation.max_size

      Type

      integer

      Description

      The maximum size in MB of the log file before it gets rotated.

      logging.error.rotation.rotated_logs_size

      Type

      integer

      Description

      Max Size (in mb) of log files before deletion

      logging.info.collation_buffer_size

      Type

      integer

      Description

      The size of the log collation buffer

      logging.info.enabled

      Type

      boolean

      Description

      Toggle for this log output

      logging.info.rotation.localtime

      Type

      boolean

      Description

      If true, it uses the computer's local time to format the backup timestamp.

      logging.info.rotation.max_age

      Type

      integer

      Description

      The maximum number of days to retain old log files.

      logging.info.rotation.max_size

      Type

      integer

      Description

      The maximum size in MB of the log file before it gets rotated.

      logging.info.rotation.rotated_logs_size

      Type

      integer

      Description

      Max Size (in mb) of log files before deletion

      logging.log_file_path

      Type

      string

      Description

      Absolute or relative path on the filesystem to the log file directory. A relative path is from the directory that contains the Sync Gateway executable file.

      logging.redaction_level

      Type

      string

      Description

      Redaction level to apply to log output.

      logging.stats.collation_buffer_size

      Type

      integer

      Description

      The size of the log collation buffer

      logging.stats.enabled

      Type

      boolean

      Description

      Toggle for this log output

      logging.stats.rotation.localtime

      Type

      boolean

      Description

      If true, it uses the computer's local time to format the backup timestamp.

      logging.stats.rotation.max_age

      Type

      integer

      Description

      The maximum number of days to retain old log files.

      logging.stats.rotation.max_size

      Type

      integer

      Description

      The maximum size in MB of the log file before it gets rotated.

      logging.stats.rotation.rotated_logs_size

      Type

      integer

      Description

      Max Size (in mb) of log files before deletion

      logging.trace.collation_buffer_size

      Type

      integer

      Description

      The size of the log collation buffer

      logging.trace.enabled

      Type

      boolean

      Description

      Toggle for this log output

      logging.trace.rotation.localtime

      Type

      boolean

      Description

      If true, it uses the computer's local time to format the backup timestamp.

      logging.trace.rotation.max_age

      Type

      integer

      Description

      The maximum number of days to retain old log files.

      logging.trace.rotation.max_size

      Type

      integer

      Description

      The maximum size in MB of the log file before it gets rotated.

      logging.trace.rotation.rotated_logs_size

      Type

      integer

      Description

      Max Size (in mb) of log files before deletion

      logging.warn.collation_buffer_size

      Type

      integer

      Description

      The size of the log collation buffer

      logging.warn.enabled

      Type

      boolean

      Description

      Toggle for this log output

      logging.warn.rotation.localtime

      Type

      boolean

      Description

      If true, it uses the computer's local time to format the backup timestamp.

      logging.warn.rotation.max_age

      Type

      integer

      Description

      The maximum number of days to retain old log files.

      logging.warn.rotation.max_size

      Type

      integer

      Description

      The maximum size in MB of the log file before it gets rotated.

      logging.warn.rotation.rotated_logs_size

      Type

      integer

      Description

      Max Size (in mb) of log files before deletion

      max_file_descriptors

      Type

      number

      Description

      Max of open file descriptors (RLIMIT_NOFILE)

      replicator.blip_compression

      Type

      integer

      Description

      BLIP data compression level (0-9)

      replicator.max_heartbeat

      Type

      string

      Description

      Max heartbeat value for _changes request.

      This is a duration and therefore can be provided with units "h", "m", "s", "ms", "us", and "ns". For example, 5 hours, 20 minutes, and 30 seconds would be 5h20m30s.

      unsupported

      Type

      object

      Description

      Settings that are not officially supported. It is highly recommended these are not used.

      unsupported.http2.enabled

      Type

      boolean

      Description

      Whether HTTP2 support is enabled

      unsupported.serverless

      Type

      object

      Description

      Configuration for when SG is running in serverless mode

      unsupported.serverless.enabled

      Type

      boolean

      Description

      Run SG in to serverless mode

      unsupported.serverless.min_config_fetch_interval

      Type

      string

      Description

      How long database configs should be kept for in Sync Gateway before refreshing. Set to 0 to fetch configs everytime. This is used for requested databases that SG does not know about.

      This is a duration and therefore can be provided with units "h", "m", "s", "ms", "us", and "ns". For example, 5 hours, 20 minutes, and 30 seconds would be 5h20m30s.

      unsupported.stats_log_frequency

      Type

      string

      Description

      How often should stats be written to stats logs.

      This is a duration and therefore can be provided with units "h", "m", "s", "ms", "us", and "ns". For example, 5 hours, 20 minutes, and 30 seconds would be 5h20m30s.

      unsupported.use_stdlib_json

      Type

      boolean

      Description

      Bypass the jsoniter package and use Go's stdlib instead

      unsupported.use_xattr_config

      Type

      boolean

      Description

      Store database configurations in system xattrs