Files
mtusi2026lab4/src/main/resources/application.yaml
T
2026-10-23 17:49:14 +03:00

119 lines
3.2 KiB
YAML

spring:
application:
name: messenger-lab2
config:
import: "optional:configtree:/run/secrets/"
lifecycle:
timeout-per-shutdown-phase: 30s
jackson:
default-property-inclusion: non_null
datasource:
driver-class-name: org.postgresql.Driver
url: ${SPRING_DATASOURCE_URL:jdbc:postgresql://localhost:5432/messenger}
username: ${SPRING_DATASOURCE_USERNAME:messenger}
password: ${SPRING_DATASOURCE_PASSWORD:change-me-local-only}
hikari:
maximum-pool-size: 20
minimum-idle: 5
connection-timeout: 2000
validation-timeout: 1000
idle-timeout: 60000
max-lifetime: 1800000
jpa:
hibernate:
ddl-auto: validate
open-in-view: false
properties:
hibernate:
jdbc:
time_zone: UTC
dialect: org.hibernate.dialect.PostgreSQLDialect
flyway:
enabled: true
locations: classpath:db/migration
data:
redis:
host: ${SPRING_DATA_REDIS_HOST:localhost}
port: ${SPRING_DATA_REDIS_PORT:6379}
cache:
type: redis
servlet:
multipart:
max-file-size: ${MAX_UPLOAD_BYTES:10485760}
max-request-size: ${MAX_UPLOAD_BYTES:10485760}
file-size-threshold: 0
resolve-lazily: false
server:
address: ${APP_HOST:0.0.0.0}
port: ${APP_PORT:8080}
shutdown: graceful
management:
endpoints:
web:
exposure:
include: health,metrics,caches
endpoint:
health:
probes:
enabled: true
show-details: always
caches:
enabled: true
app:
idempotency:
key-max-length: ${IDEMPOTENCY_KEY_MAX_LENGTH:128}
key-pattern: '${IDEMPOTENCY_KEY_PATTERN:^[A-Za-z0-9._:-]+$}'
retention-hours: ${IDEMPOTENCY_RETENTION_HOURS:24}
instance:
id: ${INSTANCE_ID:${HOSTNAME:${random.uuid}}}
limits:
max-messages-per-chat: ${MAX_MESSAGES_PER_CHAT:10000}
rate:
rate-per-minute: ${RATE_PER_MINUTE:600}
retry-after-seconds: ${RETRY_AFTER_SECONDS:60}
session:
ttl: ${SESSION_TTL_SECONDS:400}s
redis:
host: ${SPRING_DATA_REDIS_HOST:localhost}
port: ${SPRING_DATA_REDIS_PORT:6379}
command-timeout: ${REDIS_COMMAND_TIMEOUT:500ms}
connect-timeout: ${REDIS_CONNECT_TIMEOUT:500ms}
shutdown-timeout: ${REDIS_SHUTDOWN_TIMEOUT:100ms}
keep-alive-idle: ${REDIS_KEEP_ALIVE_IDLE:30s}
keep-alive-interval: ${REDIS_KEEP_ALIVE_INTERVAL:10s}
tcp-user-timeout: ${REDIS_TCP_USER_TIMEOUT:10s}
s3:
endpoint: ${S3_ENDPOINT:http://minio:9000}
bucket: ${S3_BUCKET:messenger-attachments}
region: ${S3_REGION:us-east-1}
access-key: ${S3_ACCESS_KEY_ID:}
secret-key: ${S3_SECRET_ACCESS_KEY:}
path-style-access: true
presign-expiry-seconds: ${S3_PRESIGN_EXPIRY_SECONDS:300}
upload:
max-bytes: ${MAX_UPLOAD_BYTES:10485760}
max-pixels: ${MAX_IMAGE_PIXELS:40000000}
allowed-content-types:
- image/png
- image/jpeg
reconciler:
enabled: ${RECONCILER_ENABLED:true}
interval-ms: ${RECONCILER_INTERVAL_MS:3600000}
grace-period-minutes: ${RECONCILER_GRACE_PERIOD_MINUTES:15}
dry-run: ${RECONCILER_DRY_RUN:false}
logging:
pattern:
console: "%d{ISO8601} %-5level [%X{requestId}] %logger{20} - %msg%n"
level:
org.springframework.cache: TRACE
org.springframework.cache.interceptor: TRACE
software.amazon.awssdk: DEBUG