Add an ephemeral similarity check page

- /similar (nav: Similar): drop a file to get the exact MD5 match, the
  perceptual matches against the library, and e621 IQDB candidates
  (auto-run for images when credentials are configured). Read-only —
  nothing enters the library.
- SimilarityCheck model + /api/similarity/ (create/list/retrieve/delete)
  with signed preview URLs and an expires_at timestamp.
- Temp files are wiped on startup (AppConfig.ready, file-only so no
  database access during initialization), lazily past
  SIMILARITY_TTL_MINUTES (default 30, env-overridable), on delete, and
  by manage.py cleanup_similarity.
- uploadFile() takes a target path; .env.example documents the TTL.
This commit is contained in:
2026-09-17 18:22:11 -05:00
parent cea34422ec
commit 1c2cb8d468
15 changed files with 875 additions and 5 deletions
+4
View File
@@ -18,3 +18,7 @@ REDIS_URL=redis://127.0.0.1:6380/1
# Redis by `manage.py refresh_guest_blacklist`.
# GUEST_BLACKLIST_FALLBACK=young,cub,shota,loli,child,underage
# GUEST_BLACKLIST_TTL=3600
# Ephemeral similarity checks: temp files are wiped on startup and after
# this many minutes.
# SIMILARITY_TTL_MINUTES=30