server:
  servlet:
    context-path: /
  port:
    ${SERVICE_PORT:8000}
  compression:
    enabled: true
    mime-types: [ text/html, text/xml, text/plain, text/css, text/javascript, application/javascript, application/json ]
    min-response-size: 400
  http2:
    enabled: true
  error:
    include-message: ALWAYS
    include-stacktrace: NEVER
  tomcat:
    accept-count: ${SERVER_TOMCAT_ACCEPT_COUNT:120}
    processor-cache: ${SERVER_TOMCAT_PROCESSOR_CACHE:240}
    threads:
      max: ${SERVER_TOMCAT_THREADS_MAX:240}
    use-relative-redirects: true

management:
  health:
    elasticsearch:
      enabled: false

logging:
  level:
    io.delphiplatform.api: ${LOG_LEVEL:INFO}

# Defaults that can (and will) be overridden by runtime configuration
sentry:
  dsn: '' # null to disable sentry locally by default
  exception-resolver-order: 2147483647
  use-git-commit-id-as-release: false
  environment: ${ENVIRONMENT:local}
  logging:
    enabled: true
    minimum-event-level: info
    minimum-breadcrumb-level: debug

delphi:
  environment: ${ENVIRONMENT:dev}
  revision: ${REVISION:unknown}
  executor:
    core-pool-size: ${DELPHI_EXECUTOR_CORE_POOL_SIZE:24}
    max-pool-size: ${DELPHI_EXECUTOR_MAX_POOL_SIZE:64}
    queue-capacity: ${DELPHI_EXECUTOR_QUEUE_CAPACITY:10}
  executor-bt-query:
    core-pool-size: ${DELPHI_EXECUTOR_BT_QUERY_CORE_POOL_SIZE:24}
    max-pool-size: ${DELPHI_EXECUTOR_BT_QUERY_MAX_POOL_SIZE:64}
    queue-capacity: ${DELPHI_EXECUTOR_BT_QUERY_QUEUE_CAPACITY:10}
  youtube-image-service:
    host: ${YT_IMAGE_HOST:https://i.ytimg.com}
  atlas-service:
    host: ${ATLAS_HOST:https://images-api.atlas.stream/v2}
  bigtable:
    project-id: ${BIGTABLE_PROJECT_ID:delphi-stage}
    application-profile-id: ${BIGTABLE_APP_PROFILE_ID:delphi-api}
    instance-id: ${BIGTABLE_INSTANCE_ID:stg-delphi-consumer-analytics-hdd}
    timeout: 60000
    query-batch-size: 16
  postgres:
    db: ${POSTGRES_DB:test_db}
    host: ${POSTGRES_ADDRESS:localhost}
    port: ${POSTGRES_PORT:5432}
    username: ${POSTGRES_USER:postgres}
    password: ${POSTGRES_PASSWORD:postgres}
    cluster-id: ${POSTGRES_CLUSTER_ID:unknown}
  elasticsearch:
    host: ${ELASTICSEARCH_HOST:vpc-stage-delphi-search-kssthemcj2ebjshnnzaqu6ky7q.us-east-1.es.amazonaws.com}
    port: ${ELASTICSEARCH_PORT:443}
  spotify:
    client-id: ${SPOTIFY_CLIENT_ID:test}
    client-secret: ${SPOTIFY_CLIENT_SECRET:test}


auth0:
  audience: ${AUTH0_API_AUDIENCE:dev-delphi-api}
  grant-type: client_credentials
  token-endpoint-auth-method: client_secret_post
  domain: ${AUTH0_DOMAIN:dev-delphi.auth0.com}
  issuer: https://${auth0.domain}/
  token-url: https://${auth0.domain}/oauth/token
  authorize-url: https://${auth0.domain}/authorize
  jwks-url: https://${auth0.domain}/.well-known/jwks.json
  jwks-cache-ttl-mins: 600


springdoc:
  # https://springdoc.org/#swagger-ui-properties
  swagger-ui:
    path: /api-docs/ui
    urls:
      - url: /api-v2.swagger.yaml
        name: v2
      - url: /api-v3.swagger.yaml
        name: v3
    operations-sorter: alpha
    tags-sorter: alpha
    disable-swagger-default-url: true
    syntax-highlight:
      theme: arta
    doc-expansion: none
  api-docs:
    enabled: false

spring:
  mvc:
    async:
      request-timeout: 1200000
  jmx:
    enabled: true
  application:
    name: delphi-api
  main:
    banner-mode: off
  data:
    rest:
      base-path: /v3
  jackson:
    date-format: io.delphiplatform.api.v2.model.RFC3339DateFormat
    serialization:
      WRITE_DATES_AS_TIMESTAMPS: false

  jpa:
    properties.hibernate.dialect: io.delphiplatform.api.v3.rdb.service.CustomPostgresDialect
    properties.hibernate.order_by.default_null_ordering: last
    open-in-view: true
  #    show-sql: true
  #    properties.hibernate.format_sql: true
  datasource:
    driver-class-name: org.postgresql.Driver
    url: jdbc:postgresql://${delphi.postgres.host}:${delphi.postgres.port}/${delphi.postgres.db}
    username: ${delphi.postgres.username}
    password: ${delphi.postgres.password}
    hikari:
      maximum-pool-size: 40
      connection-timeout: 60000
      keepalive-time: 60000
