Commit Graph

176 Commits (5b566752e8a1e5277ec82b93f36ff67a1fc1cb30)

Author SHA1 Message Date
Shlee 84df3de562
Update StoryExpireRemoteCacheTest.php 2 weeks ago
Daniel Supernault 7a5192481c
Fix StoryExpireRemoteCacheTest 2 weeks ago
Your Name ce073ffc92 Merge remote-tracking branch 'origin/staging' into feature/honeypot-spam-protection
# Conflicts:
#	routes/web.php
2 weeks ago
Your Name 08a442e661 Rewrite 2FA tests for the pending-login refactor
The 2FA flow moved from a middleware-gated i/auth/checkpoint model to a
pending-login model (auth.pending session, POST /login/2fa, /login?step=2fa
challenge). The old tests referenced the removed route and dead session keys
(2fa.session.active, 2fa.attempts) and failed with 404s.

Rewritten against the new code as source of truth:
- Checkpoint test: throttle assertion retargeted to the login/2fa route;
  failed-verification audit log now driven through a pending 2FA session.
- Logout-session test: asserts auth.pending is cleared and the user stays a
  guest after MAX_2FA_ATTEMPTS failures (replacing the old flag cleanup).
- TwoFactorTest: challenge-redirect and challenge-page cases rewritten around
  the login flow; setup/recovery password-confirmation cases unchanged.
- MiddlewarePipelineTest: 2FA is enforced at login, not per-request, so an
  authenticated 2FA user browses normally.

Full suite: 715 passed.
2 weeks ago
Your Name 007f97f987 Expand test coverage for storage_used improvements
- Suspended/missing user guards for get, increase, decrement, recalculate
- Staleness window boundary (fresh at N-1h, stale at N+1h)
- Sub-1000-byte rounding on increase/decrement (floor to KB)
- Command --stale filter (only recomputes stale/never-calculated users) and
  missing --user id failure
- Migration dispatches the backfill job to the low queue (Bus::fake)
2 weeks ago
Your Name 5a9c235922 Backfill storage_used on upgrade via queued job + data migration
Repair accounts whose storage counter drifted before the self-heal logic
existed (#7169). A data migration dispatches RecalculateAllUserStoragePipeline
to the low queue so the deploy is not blocked while every user is recomputed
from source. The job is unique and idempotent, so re-runs are harmless.

- RecalculateAllUserStoragePipeline: chunked recalc of all active users
- Migration dispatches the job (no inline heavy work during deploy)
- Test covers bulk recalculation from actual media
2 weeks ago
Your Name 61a1c30756 Self-heal stale storage_used on read to unblock stuck accounts
UserStorageService::get() now recalculates from source when the cached
counter is missing or older than STALE_AFTER_HOURS, instead of returning a
possibly-inflated cached value. This is what unblocks a user stuck at the
account size limit: the limit check on their next upload attempt reads the
freshly recalculated real usage rather than the drifted value (#7169).

The upload flow reads get() and enforces the limit BEFORE the write-path
heal runs, so a blocked user could never self-heal via upload/delete alone.
Healing on read closes that gap and makes the scheduled reconciler a
belt-and-suspenders safety net rather than a requirement.

A fresh counter is still trusted as-is (no per-read SUM). Adds tests for the
stale-get recompute and fresh-get trust paths.
2 weeks ago
Your Name 26d3e8bb8e Self-heal stale storage_used on upload/delete hot path
Make increaseStorageUsed/decrementStorageUsed recalculate from source when
the cached counter is older than STALE_AFTER_HOURS (168h) or never
calculated, so an affected user is corrected the next time they upload or
delete without waiting for the nightly reconciler. Callers save/delete the
media row before calling these, so the from-source recalc already reflects
the change and the incremental delta is skipped on the recalc path.

- Add UserStorageService::STALE_AFTER_HOURS and isStale() helper (no extra
  query: reads the already-loaded model), with defensive Carbon parsing
- Cast users.storage_used_updated_at to datetime so freshness comparisons
  work on a Carbon instance
- Add tests for stale/fresh/never-calculated increase and decrement paths
2 weeks ago
Your Name 6496904293 Fix account storage limit not freeing on media deletion (#7169)
users.storage_used only ever grew: uploads incremented it but no deletion
path decremented it, so users hit the account size limit even when their
real media usage was well below it.

- Decrement storage_used in MediaDeletePipeline when media is removed
- Add UserStorageService::increaseStorageUsed / decrementStorageUsed as the
  fast, symmetric hot-path counter updates (floor-based, clamped at zero)
- Refactor the 6 upload call sites to use increaseStorageUsed instead of
  duplicated inline writes (also fixes ceil/floor drift vs the reconciler)
- Add (user_id, size) covering index so per-user SUM(size) is not a full
  table scan (INPLACE/LOCK=NONE, skipped on sqlite)
- Add user:storage:recalculate command to repair affected accounts, with a
  daily --stale=168 scheduled reconciler to correct any drift
- Add regression tests for the pipeline and UserStorageService
2 weeks ago
Shlee 5d38faa257
Merge pull request #7166 from shleeable/fix/dangerzone-logout-clear-2fa-session
Invalidate session on DangerZone forced logout to clear 2FA state
2 weeks ago
Your Name 58e8a4922d Invalidate session on DangerZone forced logout to clear 2FA state 2 weeks ago
Shlee e60082b9b9
Merge pull request #7165 from shleeable/fix/media-blocklist-indexed-lookup
Use indexed query for media blocklist lookups and allow removing inactive hashes
2 weeks ago
Your Name e8f2b06afe Use indexed query for media blocklist lookups and allow removing inactive hashes 2 weeks ago
Shlee 9cf879d375
Merge pull request #7163 from shleeable/fix/status-lexer-no-autolink-fanout
Deliver posts regardless of profile no_autolink flag
2 weeks ago
Your Name 9e14151228 Deliver posts regardless of profile no_autolink flag 2 weeks ago
Your Name 742c1a6bc8 Require dangerzone sudo mode on curated register, shadow filter and page admin controllers 2 weeks ago
Your Name 68becbe2cc lint 2 weeks ago
Shlee 97b5d2f180
Merge pull request #7159 from shleeable/fix/directory-exclude-private-profiles
Exclude private profiles from public directory and clear suggestable on going private
2 weeks ago
Your Name 1581863093 Exclude private profiles from public directory and clear suggestable on going private 2 weeks ago
Shlee 903c191f10
Merge pull request #7158 from shleeable/fix/2fa-logout-session-cleanup
Clear 2FA session state on forced logout after failed attempts
2 weeks ago
Your Name 97f1a097ff Clear 2FA session state on forced logout after failed attempts 2 weeks ago
Shlee eaadf425f2
Merge pull request #7157 from shleeable/fix/dangerzone-oidc-per-user
Scope DangerZone OIDC sudo bypass to OIDC-registered users
2 weeks ago
Your Name 7483a4b05b Scope DangerZone OIDC sudo bypass to OIDC-registered users 2 weeks ago
Shlee 72f0990dd8
Merge pull request #7156 from shleeable/fix/network-timeline-null-account
Filter null-account statuses from non-cached network timeline
2 weeks ago
Shlee e65a17c175
Merge pull request #7155 from shleeable/fix/get-or-fetch-remote-profile-fallback
Fall back to stored profile when remote refresh fails
2 weeks ago
Your Name 917a13d4a7 Filter null-account statuses from non-cached network timeline 2 weeks ago
Your Name 73fb5ed696 Fall back to stored profile when remote refresh fails 2 weeks ago
Your Name 444c796bac Trigger StatusHashtag observer on deletion to keep cached_count accurate 2 weeks ago
Shlee 5bd33640fe
Merge pull request #7151 from shleeable/fix/status-dedupe-deterministic
Deterministically keep earliest status per uri in dedupe command
2 weeks ago
Your Name e360fab619 Deterministically keep earliest status per uri in dedupe command 2 weeks ago
Shlee 189408edf0
Merge pull request #7149 from shleeable/fix/authorize-interaction-intended-redirect
Use intended-redirect session for authorize_interaction guest login
2 weeks ago
Your Name 0234a305ae Use intended-redirect session for authorize_interaction guest login 2 weeks ago
Your Name 1ffda3eba9 Federate unlike before deleting Like so retries can deliver 2 weeks ago
Your Name eb9bd11303 Apply Pint lint fixes to session test files 2 weeks ago
Shlee 46fb9613e3
Merge pull request #7146 from shleeable/fix/2fa-checkpoint-throttle
Rate limit and audit-log 2FA checkpoint verification
2 weeks ago
Your Name 8cebb24c04 Rate limit and audit-log 2FA checkpoint verification 2 weeks ago
Shlee 0ebe1f8fb1
Merge pull request #7145 from shleeable/fix/media-blocklist-check-before-store
Check media blocklist before storing uploads to prevent orphaned files
2 weeks ago
Your Name ec6827bae2 Check media blocklist before storing uploads to prevent orphaned files 2 weeks ago
Shlee c3e01f86cf
Merge pull request #7144 from shleeable/fix/curated-register-email-escape
Escape user-provided content in curated register admin emails
2 weeks ago
Your Name 4df40cb772 Escape user-provided content in curated register admin emails 2 weeks ago
Shlee cecdad5b53
Merge pull request #7143 from shleeable/fix/search-controller-pgsql-ilike
Use ILIKE for case-insensitive search on PostgreSQL
2 weeks ago
Your Name 613cf413de Use ILIKE for case-insensitive search on PostgreSQL 2 weeks ago
Shlee 173abef5c5
Merge pull request #7142 from shleeable/fix/reblog-duplicate-dispatch
Only dispatch SharePipeline for newly-created reblogs
2 weeks ago
Your Name d190ba7b66 Only dispatch SharePipeline for newly-created reblogs 2 weeks ago
Shlee 0fc121b685
Merge pull request #7134 from shleeable/fix/storyfetch-ssrf
Route StoryFetch outbound requests through SSRF-hardened fetch service
2 weeks ago
Shlee 58c83a2c6b
Merge pull request #7141 from shleeable/fix/import-instagram-missing-profile
Drop Instagram import job when profile is missing instead of crashing
2 weeks ago
Your Name 922d7f766e Drop Instagram import job when profile is missing instead of crashing 2 weeks ago
Shlee ee64de9df4
Merge pull request #7140 from shleeable/fix/user-account-delete-user-agent
Send Pixelfed User-Agent on federated account deletion deliveries
2 weeks ago
Shlee ae31ed8e66
Merge pull request #7137 from shleeable/fix/story-remote-expiry-cache
Invalidate latest-story cache on remote story expiry and null-guard l…
2 weeks ago
Your Name 327348be02 Send Pixelfed User-Agent on federated account deletion deliveries 2 weeks ago