spring.redis.host=localhost
spring.redis.port=${spring.redis.port:6379}

# Enable Flyway and restrict locations to migrations (avoid callback duplication in tests)
spring.flyway.enabled=true
spring.flyway.locations=classpath:db/migration

# Database Connection Pool (HikariCP)
spring.datasource.hikari.maximum-pool-size=20
spring.datasource.hikari.minimum-idle=5
spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.idle-timeout=600000
spring.datasource.hikari.max-lifetime=1800000
spring.datasource.hikari.pool-name=MosquitoHikariPool

# Application Configuration
app.rate-limit.per-minute=100
app.short-link.code-length=8
app.short-link.max-url-length=2048
app.short-link.landing-base-url=https://example.com/landing
app.short-link.cdn-base-url=https://cdn.example.com
app.security.api-key-iterations=185000

# Poster Configuration
app.poster.default-template=default
app.poster.cdn-base-url=https://cdn.example.com

# Approval Template Consistency Check (enabled by default)
app.approval.template-check-enabled=true

# Logging Configuration
logging.level.root=WARN
logging.level.com.mosquito.project=INFO
logging.level.com.mosquito.project.web=DEBUG
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n

# Actuator Configuration
management.endpoints.web.exposure.include=health,info,metrics
management.endpoint.health.show-details=when_authorized
management.endpoint.health.probes.enabled=true
management.health.redis.enabled=true
management.health.db.enabled=true
management.health.livenessState.enabled=true
management.health.readinessState.enabled=true

# User Introspection Configuration
app.security.introspection.url=
app.security.introspection.client-id=
app.security.introspection.client-secret=
app.security.introspection.timeout-millis=2000
app.security.introspection.cache-ttl-seconds=60
app.security.introspection.negative-cache-seconds=5

# Callback Risk Control Configuration
# 生产环境必须配置白名单IP，否则启动失败（fail-fast）
# 示例: mosquito.callback.whitelist.ips=10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
mosquito.callback.whitelist.ips=${MOSQUITO_CALLBACK_WHITELIST_IPS:}
mosquito.callback.require.device.fingerprint=true
mosquito.callback.rate-limit.ip.max-requests=100
mosquito.callback.rate-limit.ip.window-seconds=60

# CORS Configuration
# 允许的跨域来源，多个用逗号分隔
app.cors.allowed-origins=${CORS_ALLOWED_ORIGINS:http://localhost:5173,http://localhost:3000,http://localhost:8080}
# 允许的HTTP方法
app.cors.allowed-methods=GET,POST,PUT,DELETE,PATCH,OPTIONS
# 允许的请求头
app.cors.allowed-headers=Content-Type,Authorization,X-API-Key,X-Requested-With,Accept,Origin
# 是否允许携带凭证（cookies）
app.cors.allow-credentials=true
# 预检请求的缓存时间（秒）
app.cors.max-age=3600
mosquito.callback.rate-limit.use-redis=true
# 生产环境必须显式配置，不允许localhost
mosquito.callback.allow-localhost=${MOSQUITO_CALLBACK_ALLOW_LOCALHOST:false}
# 生产环境必须显式关闭 permissive 模式
mosquito.callback.whitelist.permissive=${MOSQUITO_CALLBACK_PERMISSIVE:false}

# Internal Account System Configuration
# 生产环境必须配置真实的API地址，不配置会导致奖励发放失败
app.internal-account.api-url=
app.internal-account.api-key=
app.internal-account.timeout=5000
# 生产环境必须设置为false，禁止模拟成功；开发/测试环境可设置为true
app.internal-account.allow-mock-success=${MOSQUITO_INTERNAL_ACCOUNT_MOCK_SUCCESS:false}

# Email Notification Configuration
app.notification.email.provider=mock
app.notification.email.from=noreply@mosquito.com
app.notification.email.smtp-host=
app.notification.email.smtp-port=587
app.notification.email.username=
app.notification.email.password=

# SMS Notification Configuration
app.notification.sms.provider=mock
app.notification.sms.access-key-id=
app.notification.sms.access-key-secret=
app.notification.sms.sign-name=蚊子系统
app.notification.sms.template-code=
