fitpub/src/main/resources/application.yml
2026-05-01 11:53:21 +02:00

163 lines
4 KiB
YAML

spring:
application:
name: fitpub
# Default to dev profile if not specified
profiles:
active: ${SPRING_PROFILES_ACTIVE:dev}
# Datasource configuration is handled by Testcontainers in dev mode
# For production, set these via environment variables:
# - SPRING_DATASOURCE_URL
# - SPRING_DATASOURCE_USERNAME
# - SPRING_DATASOURCE_PASSWORD
datasource:
url: ${SPRING_DATASOURCE_URL:}
username: ${SPRING_DATASOURCE_USERNAME:}
password: ${SPRING_DATASOURCE_PASSWORD:}
jpa:
hibernate:
ddl-auto: validate
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
format_sql: true
use_sql_comments: true
show-sql: false
flyway:
enabled: true
baseline-on-migrate: true
locations: classpath:db/migration
schemas: public
validate-on-migrate: true
servlet:
multipart:
max-file-size: 50MB
max-request-size: 50MB
enabled: true
jackson:
serialization:
write-dates-as-timestamps: false
time-zone: UTC
# Cache configuration for privacy zone filtering
cache:
type: caffeine
cache-names:
- filteredTracks
- filteredTrackPoints
caffeine:
spec: maximumSize=1000,expireAfterWrite=7d
# FitPub specific configuration
fitpub:
# Domain and URL configuration
domain: ${FITPUB_DOMAIN:localhost:8080}
base-url: ${FITPUB_BASE_URL:http://localhost:8080}
# ActivityPub federation settings
activitypub:
enabled: true
max-federation-retries: 3
request-timeout-seconds: 30
# Allow connections to private IPs (for local testing only - disable in production!)
allow-private-ips: ${FITPUB_ALLOW_PRIVATE_IPS:false}
# Federation protocol (http or https) - use http for local testing, https for production
federation-protocol: ${FITPUB_FEDERATION_PROTOCOL:https}
# Security settings
security:
jwt:
# JWT_SECRET must be set explicitly. The dev profile (application-dev.yml) provides a development default;
# production deployments without JWT_SECRET set will fail to start.
secret: ${JWT_SECRET:}
expiration: 86400000 # 24 hours in milliseconds
# Registration settings
registration:
enabled: ${REGISTRATION_ENABLED:true}
# Optional password required for new registrations (soft invite system)
# Leave empty to allow open registration
password: ${REGISTRATION_PASSWORD:}
# User settings
user:
bio:
max-length: ${FITPUB_USER_BIO_MAX_LENGTH:500}
# Activity settings
activity:
title:
max-length: ${FITPUB_ACTIVITY_TITLE_MAX_LENGTH:200}
description:
max-length: ${FITPUB_ACTIVITY_DESCRIPTION_MAX_LENGTH:5000}
# Storage settings
storage:
fit-files:
enabled: true
retention-days: 365
images:
path: ${FITPUB_IMAGES_PATH:${java.io.tmpdir}/fitpub/images}
tile-cache:
path: ${FITPUB_TILE_CACHE_PATH:${java.io.tmpdir}/fitpub/tiles}
# Image generation settings
image:
osm-tiles:
enabled: ${OSM_TILES_ENABLED:true}
# Weather API settings
weather:
enabled: ${WEATHER_ENABLED:false}
api-key: ${OPENWEATHERMAP_API_KEY:}
# Logging configuration
logging:
level:
root: INFO
net.javahippie.fitpub: DEBUG
org.hibernate.type.descriptor.sql.BasicBinder: TRACE
org.springframework.security: DEBUG
# Server configuration
server:
port: ${PORT:8080}
error:
include-message: always
include-binding-errors: always
compression:
enabled: true
mime-types:
- application/json
- application/geo+json
- application/activity+json
- application/ld+json
- text/html
- text/xml
- text/plain
- text/css
- application/javascript
min-response-size: 1024 # Only compress responses larger than 1KB
# Actuator configuration
management:
endpoints:
web:
exposure:
include: health,info
base-path: /actuator
endpoint:
health:
show-details: when-authorized
probes:
enabled: true
health:
db:
enabled: true
diskspace:
enabled: true