micronaut:
application:
name: firmiana
server:
port: 8899 # HTTP server port
cors:
enabled: true
configurations:
web:
allowed-origins-regex: .* # WARNING: Restrict in production
allowed-methods: [POST, PUT, GET, DELETE, OPTIONS]
allowed-headers: [Content-Type, Authorization, X-Requested-With]
expose-headers: [Content-Type, Authorization]
allow-credentials: false
security:
enabled: true
authentication: bearer
token:
name: Authorization
jwt:
enabled: true # Note: Matrix auth uses opaque tokens, not JWT
signatures:
secret:
default:
secret: ${JWT_SECRET:...}
# Matrix homeserver settings
matrix:
client:
support:
email-address: admin@localhost
role: m.role.admin
homeserver:
base-url: http://localhost:8899
identity-server:
base-url: http://localhost:8899
identity:
mode: disabled # disabled | embedded | proxy
# Rate limiting
rate-limit:
enabled: true
max-requests-per-window: 100
window-ms: 60000
# H2 Database
h2:
enabled: true
mode: file
path: ./data/matrix
pool-size: 10
max-lifetime: 1800000
web-console: false
schema-initializer:
enabled: false # Use Flyway instead
# Datasource
datasources:
default:
url: ${DB_URL:jdbc:h2:./data/matrix;DB_CLOSE_DELAY=-1}
driver-class-name: org.h2.Driver
username: ${DB_USERNAME:sa}
password: ${DB_PASSWORD:}
schema-generate: NONE
dialect: H2
# Flyway migrations
flyway:
datasources:
default:
enabled: true
locations: classpath:db/migration
baseline-on-migrate: true
# Security headers
security-headers:
content-security-policy: "default-src 'self'"
x-content-type-options: nosniff
x-frame-options: DENY
strict-transport-security: "max-age=31536000; includeSubDomains"