# This is the configuration file for docspell. It contains two main
# namespaces: docspell.server and docspell.joex. Each provide the
# config for the respective component.
#
# They can be moved to different files, if necessary. For this example
# though, both components are configured in this single file.
#
# Below are only some settings that differ from the default. Please
# see https://docspell.org/docs/configure/#default-config for all
# options and their documentation. This page provides more
# information about the important config options.
#
# Note: this docker-compose setup is an example to get started. It
# sets up one rest-server, one joex, a postgres database and a solr –
# all on the same machine.

# Define settings that are used in multiple places:
db_url="jdbc:postgresql://db:5432/dbname"
db_user="dbuser"
db_pass="dbpass"
solr_url="http://docspell-solr:8983/solr/docspell"


# This configures the restserver
docspell.server {
  base-url = "http://localhost:7880"
  bind {
    address = "0.0.0.0"
  }
  integration-endpoint {
    enabled = true
    http-header {
      enabled = true
      header-value = ${?DOCSPELL_HEADER_VALUE}
    }
  }

  # This is a special endpoint that allows some basic administration.
  #
  # This is used for some endpoints, for example:
  # - re-create complete fulltext index:
  #   curl -XPOST -H'Docspell-Admin-Secret: xyz' http://localhost:7880/api/v1/admin/fts/reIndexAll
  admin-endpoint {
    # The secret. If empty, the endpoint is disabled.
    secret = ""
  }

  # Configuration of the full-text search engine.
  full-text-search {
    enabled = true
    solr = {
      url = ${solr_url}
    }
  }
  backend {
    jdbc {
      url = ${db_url}
      user = ${db_user}
      password = ${db_pass}
    }
  }
}


# This configures joex
#
# Note to joex: It is currently setup for one instance. Should you
# want to scale joex instance up (maybe to help processing a batch of
# files), there are two options:
#
# - look at https://github.com/eikek/docspell/pull/552 to elastically
#   start and stop joex instances via docker-compose
# - set pool-size to some higher number; this requires to restart joex
#
docspell.joex {
  base-url = "http://docspell-joex:7878"
  bind {
    address = "0.0.0.0"
  }
  jdbc {
    url = ${db_url}
    user = ${db_user}
    password = ${db_pass}
  }
  full-text-search {
    enabled = true
    solr = {
      url = ${solr_url}
    }
  }
  scheduler {
    pool-size = 1
  }
}