Commit Graph

19 Commits

Author SHA1 Message Date
SlimusMinus
48351398b5 Add Redis rate limiting, login lockout, password policy and health probes
- 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>
2026-10-20 01:31:12 +03:00
SlimusMinus
6e001fbc41 Fix post deletion, moderation races and cache leftovers
- PostService.delete did not remove favorites (FK without cascade -> 500 once a
  post was favorited) or chat links; owner, admin and nightly cleanup now share
  PostDeletionService, which deletes MinIO files only after commit. The nightly
  job also removes the images of expired posts.
- Moderation reads a snapshot in a short transaction, calls AI outside of it and
  applies the verdict only if the post is still in MODERATION and unchanged, so
  an edit made during a check can no longer go live unmoderated. Storage/AI
  outages keep the post in MODERATION instead of rejecting it.
- Posts without a category broke PostMapper with an NPE; title/phone/reward and
  address are checked against column sizes; a long address no longer overflows
  posts.city; Nominatim outages fall back to the address instead of 503.
- Favorites list hides posts that are back in moderation or rejected.
- Statistics counters use atomic UPDATEs instead of read-modify-write.
- Removed MapCacheService: its version key was bumped but never read.
- hibernate.default_batch_fetch_size=50 removes N+1 on images/users; show-sql
  is off by default.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 01:02:12 +03:00
SlimusMinus
a68b89981c fix AI moderation response mapping and long post text
The AI service returns snake_case JSON, so detectedLabels was always null
and blocked posts carried no labels. Map it with @JsonProperty("detected_labels").

Post text longer than the service limit (5000 chars) got 422, which became
AiBadRequestException and the post was rejected. Text is now sent in
overlapping chunks within ai.text-max-length; blank text is skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 00:33:31 +03:00
SlimusMinus
96b4be5e6f fixed search and add hints 2026-10-18 23:46:13 +03:00
SlimusMinus
c83d41a036 fixed ai image timeout 2026-10-15 00:48:58 +03:00
SlimusMinus
818c8f6a11 Add Docker build and deploy pipeline
All checks were successful
deploy-backend / deploy (push) Successful in 8m24s
2026-10-07 22:56:56 +03:00
SlimusMinus
015b68d96d changed jdk on 25 springBoot on 3.5.6 and fix code 2026-09-30 00:27:10 +03:00
SlimusMinus
870739f45f added posts on feed and posts on map 2026-09-29 01:03:54 +03:00
SlimusMinus
942cd09585 added advertising 2026-09-23 23:34:05 +03:00
SlimusMinus
5b06b420ef added reward text 2026-09-10 01:02:03 +03:00
SlimusMinus
4ebd16f48d fixed minio lifecycle on 180 days 2026-09-09 23:44:50 +03:00
SlimusMinus
e83c08b395 fixed image moderation and dell redis config 2026-09-07 01:39:07 +03:00
SlimusMinus
a44b6c42ba added searchMap methods 2026-08-20 01:35:23 +03:00
SlimusMinus
13ed934c60 fixed web-socket and add rewards on post 2026-08-12 00:41:31 +03:00
SlimusMinus
7660128d96 added refresh token 2026-08-03 02:43:46 +03:00
SlimusMinus
a6fb187212 added ai-moderation image and text 2026-07-29 00:56:32 +03:00
SlimusMinus
f371a442d0 fixed image locale storage on minio 2026-07-10 01:27:30 +03:00
SlimusMinus
bafb636cbe added security and fix edit profile 2026-06-18 00:22:50 +03:00
SlimusMinus
263242e469 start backend 2026-03-26 00:21:30 +03:00