- RateLimitFilter: fixed-window counters in Redis (Lua INCR+PEXPIRE) per client IP for login, registration, refresh, check-login, post creation, uploads, chat start and public ad endpoints; 429 with Retry-After; fails open when Redis is down. Rules live in rate-limit.* in application.yaml. - Login is blocked for an account after 10 failed attempts in 15 minutes, independent of the client IP. - Registration requires a password of at least 8 characters. - server.forward-headers-strategy=native so the client IP survives a reverse proxy; graceful shutdown. - /actuator/health with liveness/readiness probes is public (no details). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
1.2 KiB
Java
30 lines
1.2 KiB
Java
package com.krylov.refound;
|
|
|
|
import com.krylov.refound.ai.config.AiProperties;
|
|
import com.krylov.refound.ai.config.AiRetryProperties;
|
|
import com.krylov.refound.config.MinioProperties;
|
|
import com.krylov.refound.ratelimit.RateLimitProperties;
|
|
import com.krylov.refound.search.SearchProperties;
|
|
import io.awspring.cloud.autoconfigure.s3.S3AutoConfiguration;
|
|
import org.springframework.boot.SpringApplication;
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
import org.springframework.boot.autoconfigure.security.servlet.UserDetailsServiceAutoConfiguration;
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
import org.springframework.retry.annotation.EnableRetry;
|
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
|
|
|
@SpringBootApplication(
|
|
scanBasePackages = "com.krylov.refound",
|
|
exclude = { S3AutoConfiguration.class, UserDetailsServiceAutoConfiguration.class }
|
|
)@EnableScheduling
|
|
@EnableConfigurationProperties({MinioProperties.class, AiProperties.class, AiRetryProperties.class,
|
|
SearchProperties.class, RateLimitProperties.class})
|
|
@EnableRetry
|
|
public class ReFoundApplication {
|
|
|
|
public static void main(String[] args) {
|
|
SpringApplication.run(ReFoundApplication.class, args);
|
|
}
|
|
|
|
}
|