# Banco de dados
spring.datasource.url=jdbc:postgresql://162.240.165.193:5432/wwgeom_dev_prod
spring.datasource.username=postgres
spring.datasource.password=Geometr!s@
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true

# POOL DE CONEXÕES HIKARI 
spring.datasource.hikari.keepalive-time=200000
spring.datasource.hikari.maximum-pool-size=10
spring.datasource.hikari.minimum-idle=3
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.idle-timeout=600000
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.leak-detection-threshold=60000
spring.jpa.properties.hibernate.connection.autocommit=false
spring.transaction.default-timeout=30
spring.datasource.hikari.auto-commit=false
spring.jpa.properties.hibernate.connection.provider_disables_autocommit=true

# CONFIGURAÇÕES DO TOMCAT
server.tomcat.max-threads=35
server.tomcat.threads.min-spare=10
server.tomcat.accept-count=100
server.tomcat.max-connections=200
server.tomcat.connection-timeout=20000
server.tomcat.keep-alive-timeout=5000
server.tomcat.max-keep-alive-requests=100
server.tomcat.max-http-header-size=8192
server.tomcat.max-http-post-size=2097152
server.tomcat.min-spare-threads=10

# JPA/HIBERNATE
spring.jpa.properties.hibernate.order_inserts=true
spring.jpa.properties.hibernate.order_updates=true
spring.jpa.properties.hibernate.jdbc.batch_size=10
spring.jpa.properties.hibernate.cache.use_second_level_cache=false
spring.jpa.properties.hibernate.cache.use_query_cache=false
spring.jpa.properties.hibernate.bytecode.use_reflection_optimizer=false

# Segurança
api.security.token.secret=e47e608134e9ae780f275a813859b336e445cb54eab001093db1945b301807bb

# Email
spring.mail.host=mail.geometrisa-prod.com.br
spring.mail.port=465
spring.mail.username=noreply@geometrisa-prod.com.br
spring.mail.password=vQ4U44INAU9c
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.ssl.enable=true

# Arquivos
file.upload-dir=/home/wwgeomprod/public_html/storage/app/public
file.base-url=/storage/
file.psb-dir=${file.upload-dir}/psb
application.frontend-url=https://geometrisa-prod.com.br

# API Externa
ana.api.identifier=01809622000128
ana.api.password=5tx2_6hv
ana.api.auth-url=https://www.ana.gov.br/hidrowebservice/EstacoesTelemetricas/OAUth/v1
ana.api.telemetry-url=https://www.ana.gov.br/hidrowebservice/EstacoesTelemetricas/HidroinfoanaSerieTelemetricaAdotada/v1

# COMPRESSÃO
server.compression.enabled=true
server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json
server.compression.min-response-size=1024

# Cache configuration
spring.cache.type=caffeine
logging.level.io.micrometer.core.instrument.binder.cache.CaffeineCacheMetrics=ERROR

# Configuração para lidar com tentativas de HTTPS em servidor HTTP
server.tomcat.reject-illegal-header=false
server.tomcat.relaxed-query-chars=|,{,},[,]
server.tomcat.relaxed-path-chars=|,{,},[,]

# Cabeçalhos de segurança para informar clientes sobre HTTP
server.http.encoding.force=true
server.servlet.encoding.charset=UTF-8
server.servlet.encoding.enabled=true

# PROFILE
# spring.profiles.active=dev