spring:
  application:
    name: Familienarchiv

  datasource:
    url: ${SPRING_DATASOURCE_URL}
    username: ${SPRING_DATASOURCE_USERNAME}
    password: ${SPRING_DATASOURCE_PASSWORD}
    driver-class-name: org.postgresql.Driver

  flyway:
    enabled: false  # Managed explicitly via FlywayConfig bean

  jpa:
    open-in-view: false  # Prevents holding DB connections for the full HTTP request lifecycle
    hibernate:
      ddl-auto: none
    properties:
      hibernate:
        dialect: org.hibernate.dialect.PostgreSQLDialect
    show-sql: false

  servlet:
    multipart:
      max-file-size: 50MB
      max-request-size: 500MB   # supports 10-file chunk at max per-file size; see #317
      file-size-threshold: 2KB

  mail:
    host: ${MAIL_HOST:}
    port: ${MAIL_PORT:587}
    username: ${MAIL_USERNAME:}
    password: ${MAIL_PASSWORD:}
    properties:
      mail:
        smtp:
          auth: true
          starttls:
            enable: true

management:
  health:
    mail:
      enabled: false

springdoc:
  api-docs:
    enabled: false
  swagger-ui:
    enabled: false

app:
  s3:
    endpoint: ${S3_ENDPOINT}
    access-key: ${S3_ACCESS_KEY}
    secret-key: ${S3_SECRET_KEY}
    bucket: ${S3_BUCKET_NAME}
    region: ${S3_REGION}

  base-url: ${APP_BASE_URL:http://localhost:3000}

  mail:
    from: ${APP_MAIL_FROM:noreply@familienarchiv.local}

  admin:
    username: ${APP_ADMIN_USERNAME:admin}
    password: ${APP_ADMIN_PASSWORD:admin123}

  import:
    col:
      index: 0
      box: 1
      folder: 2
      sender: 3
      receivers: 5
      date: 7
      location: 9
      tags: 10
      summary: 11
      transcription: 13

ocr:
  sender-model:
    activation-threshold: 100
    retrain-delta: 50
