LDAP {
  # For OpenLDAP, this would be a full DN to the admin for LDAP / user that can see all users
  user = "cn=admin,dc=planetexpress,dc=com"

  # Password for the admin account
  password = "GoodNewsEveryone"

  # Keep this as an empty string for OpenLDAP
  domain = ""

  # This will be the name of the LDAP field that carries the user's login id (what they enter in the username in login form)
  userNameAttribute = "uid"

  # For organization, leave empty for this demo, the domainName is what matters, and that is the LDAP structure
  # to search for users that require login
  searchBase = [
    {organization = "", domainName = "ou=people,dc=planetexpress,dc=com"},
  ]
  context {
    initialContextFactory = "com.sun.jndi.ldap.LdapCtxFactory"
    initialContextFactory = ${?LDAP_INITIAL_CONTEXT_CLASS}
    securityAuthentication = "simple"
    securityAuthentication = ${?LDAP_SECURITY_AUTH}

    # Note: The following assumes a purely docker setup, using container_name = vinyldns-ldap
    providerUrl = "ldap://localhost:19004"
    providerUrl = ${?LDAP_PROVIDER_URL}
  }

  # This is only needed if keeping vinyldns user store in sync with ldap (to auto lock out users who left your
  # company for example)
  user-sync {
    enabled = false
    enabled = ${?USER_SYNC_ENABLED}
    hours-polling-interval = 1
     hours-polling-interval = ${?USER_SYNC_POLL_INTERVAL}
  }
}

mysql {
  class-name = "vinyldns.mysql.repository.MySqlDataStoreProvider"
  endpoint = "localhost:19002"
  endpoint = ${?MYSQL_ENDPOINT}

  settings {
    # JDBC Settings, these are all values in scalikejdbc-config, not our own
    # these must be overridden to use MYSQL for production use
    # assumes a docker or mysql instance running locally
    name = "vinyldns"
    name = ${?DATABASE_NAME}
    driver = "org.mariadb.jdbc.Driver"
    driver = ${?JDBC_DRIVER}
    migration-url = "jdbc:mariadb://"${mysql.endpoint}"/?user=root&password=pass&socketTimeout=20000"
    migration-url = ${?JDBC_MIGRATION_URL}
    url = "jdbc:mariadb://"${mysql.endpoint}"/vinyldns?user=root&password=pass&socketTimeout=20000"
    url = ${?JDBC_URL}
    user = "root"
    user = ${?JDBC_USER}
    password = "pass"
    password = ${?JDBC_PASSWORD}
    flyway-out-of-order = false
    flyway-out-of-order = ${?FLYWAY_OUT_OF_ORDER}

    max-lifetime = 300000
    connection-timeout-millis = 30000
    idle-timeout = 150000
    maximum-pool-size = 20
    minimum-idle = 5
  }
}

# Note: This MUST match the API or strange errors will ensue, NoOpCrypto should not be used for production
crypto {
  type = "vinyldns.core.crypto.NoOpCrypto"
  type = ${?CRYPTO_TYPE}
  secret = ${?CRYPTO_SECRET}
}

api {
  limits {
    batchchange-routing-max-items-limit = 100
    membership-routing-default-max-items = 100
    membership-routing-max-items-limit = 1000
    membership-routing-max-groups-list-limit = 3000
    recordset-routing-default-max-items= 100
    zone-routing-default-max-items = 100
    zone-routing-max-items-limit = 100
  }
}

# Batch change limit
batch-change-limit = 1000

http.port = 9001
http.port = ${?PORTAL_PORT}

portal.vinyldns.url = "http://localhost:9001"
portal.vinyldns.url = ${?VINYLDNS_PORTAL_URL}

data-stores = ["mysql"]

# Must be true to manage shared zones through the portal
shared-display-enabled = true
shared-display-enabled = ${?SHARED_ZONES_ENABLED}

# You generate this yourself following https://www.playframework.com/documentation/2.7.x/ApplicationSecret
play.http.secret.key = "changeme"
play.http.secret.key = ${?PLAY_HTTP_SECRET_KEY}

# See https://www.playframework.com/documentation/2.8.x/AllowedHostsFilter for more details.
# Note: allowed = ["."] matches all hosts hence would not be recommended in a production environment.
play.filters.hosts {
  allowed = ["."]
}

# You can provide configuration overrides via local.conf if you don't want to replace everything in
# this configuration file
include "local.conf"
