Commit Graph

636 Commits (163cd9f589a485e6191c7ba8b3fa8f666deb80c8)

Author SHA1 Message Date
Your Name e3b6cebf27 Fix MariaDB driver detection and reblog caption null inserts
Laravel 11 exposes MariaDB as a dedicated 'mariadb' driver, so
config('database.default') === 'mysql' checks silently misclassified
MariaDB as the non-mysql (postgres) branch.

- Add App\Util\Database\DatabaseDriver with isMysqlLike()/isPgsql()
  plus db_is_mysql_like()/db_is_pgsql() global helpers.
- Route all database.default driver checks through the helpers so
  MySQL and MariaDB are treated as one group.
- Use '' (not null) for share/compose caption+rendered, valid whether
  the column is nullable or NOT NULL (it is NOT NULL on MySQL/MariaDB).
- Guard pgsql strtolower() in registration against missing fields.
- Scope CustomEmoji::duplicateShortcodes to the grouped column for
  Postgres GROUP BY validity.
- Remove stale Postgres guard in status:dedup; use havingRaw for
  cross-driver HAVING.
1 week ago
Your Name 3a23606573 Enforce can-post role check on POST /api/v2/media 1 week ago
Your Name b4bd3c87a0 Validate report object_id as a positive integer to fix 500 on array input 1 week ago
Your Name 5ec239404b Import Purify facade in ApiV1Controller to fix larastan class.notFound 1 week ago
Daniel Supernault d2a45ee4d3
Update ApiV1Controller 1 week ago
Daniel Supernault b0ca632026
Update unbookmark endpoint 1 week ago
Daniel Supernault e0550c441c
Fix AdminApiController profiles endpoint, dont include deleted accounts 1 week ago
Daniel Supernault b2deebb72b
Update AdminApiController, fix typo 2 weeks ago
Daniel Supernault 6232d35d90
Update AccountService and AdminApiController 2 weeks ago
Daniel Supernault 96229868ff
Update AdminApiController, fix missing resource 2 weeks ago
Daniel Supernault 27bc6e792a
Update AdminApiController and PublicTimelineService 2 weeks ago
Daniel Supernault fbd52dd8fc
Improve federation handling 2 weeks ago
Shlee caffc40a45
Fix URL construction for API timeline request 2 weeks ago
Your Name 277b8aa970 Use now() helper instead of Carbon::now() for current-time access
Aligns with the app's dominant convention (413 now()/today() call
sites vs 12 Carbon::now()). Carbon::parse() calls are untouched since
they parse arbitrary date strings, not current-time access.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2 weeks ago
Daniel Supernault 7975ba9c75
Fix StoryCarousel cache invalidation 2 weeks ago
Daniel Supernault 915879ff57
Update account suggestions 2 weeks ago
Daniel Supernault 9aafa37364
Update ApiV1Controller.php 2 weeks ago
Daniel Supernault 6a33716870
Update ApiV1Controller, fix account suggestions 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
Daniel Supernault 13aa36efb4
Update ApiV1Controller.php 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
Your Name d190ba7b66 Only dispatch SharePipeline for newly-created reblogs 2 weeks ago
Your Name 3cb5b6e1ff Fix login activity groupBy returning stale rows and 500 on strict DBs 2 weeks ago
Shlee 3f63b245bc
Merge pull request #7126 from shleeable/fix/admin-instance-stats-postgres-guard
Fix admin instance stats endpoint 404 on Postgres via strict is_admin boolean check
2 weeks ago
Shlee fe8c53ddd7
Merge pull request #7127 from shleeable/fix/favourites-pagination-off-by-one
Fix favourites pagination skipping one favourite per page
2 weeks ago
Shlee 602e498f0a
Update ApiV1Controller.php 2 weeks ago
Your Name e79135a771 Fix favourites pagination skipping one favourite per page boundary 2 weeks ago
Your Name df1e771f93 Fix admin instance stats endpoint 404 on Postgres via strict is_admin check 2 weeks ago
Your Name 3b951d41d8 Fix accounts statuses max_id pagination returning duplicate boundary status 2 weeks ago
Daniel Supernault 7376a007a5
Update ApiV1Controller.php 2 weeks ago
Daniel Supernault 085eabccf9
Update account statuses endpoint 2 weeks ago
Shlee 003953eb3e
Merge pull request #7045 from pixelfed/perf/follower-service-following-ids
Deduplocation: add FollowerService::getFollowingIds for common function
3 weeks ago
Daniel Supernault c9b0ee3bdd
Refactor NotificationService 3 weeks ago
Your Name 667f6e2fc9 Extract following-ids lookup into FollowerService::getFollowingIds
The Cache::remember('profile:following:'.$pid, ...) block that plucks
following_id and appends the caller's own id was copy-pasted across four
call sites, with inconsistent TTLs (1440 minutes vs 1209600 seconds).

Add FollowerService::getFollowingIds($pid), which owns the cache key that
add()/remove() already invalidate, and use it from InternalApiController,
PublicApiController, ApiV1Controller and HashtagUnfollowPipeline. Removes
the now-unused Follower/Cache imports left behind.

Adds a test covering the followed-ids-plus-self result and the
follows-nobody case.
3 weeks ago
Your Name 29280cd950 Fix silent failure in avatar upload endpoints
AvatarController@store and BaseApiController@avatarUpdate wrapped the
upload flow in an empty catch(\Exception) block and returned a success
response even when the upload or save failed.

Log the exception and return a real error response (500 JSON for the
API endpoint, a redirect with validation errors for the web endpoint).

Adds regression tests covering the failure path, the success path, and
non-image rejection.
3 weeks ago
Daniel Supernault 9e33bed630
Add only_reposts 3 weeks ago
Daniel Supernault 4c4a457fe4
Update ApiV1Controller, fix napi in timelines 3 weeks ago
Daniel Supernault ccac8b31bd
Update Report endpoint, add support for optional message 3 weeks ago
Shlee c623a7afbf
Remove 'true' argument from usernameToId call 3 weeks ago
Shlee 7c3644c3e1
Update ApiV1Controller.php 3 weeks ago
Your Name 302edf09d5 refactor: rename PixelfedUsername rule to ValidUsername
Pure rename of the App\Rules\PixelfedUsername validation rule to
App\Rules\ValidUsername for a clearer, more idiomatic name. Updates
the class, filename, test, and all 8 controller call sites. No
behavior change.
4 weeks ago
Your Name 7c5d93e96b refactor: consolidate username validation into PixelfedUsername rule
Replace 7 duplicated inline username validation closures across 6
controllers (ApiV1Dot1, RemoteAuth, CuratedRegister, AdminInvite x2,
AppRegister, Auth/Register) with the existing PixelfedUsername rule.

Add the 'must contain at least one alphabetical character' check to
the rule so all call sites share consistent, stricter validation.

Add PixelfedUsernameTest covering all validation branches.
4 weeks ago
Daniel Supernault e3a2640704
Fix endsWith. Closes #6904 4 weeks ago
Your Name c0cde2f682 refactor: move 52 legacy models from App\ to App\Models\
Move all Eloquent models from the app/ root directory to app/Models/
for consistency with modern Laravel conventions. The project already had
54 models in App\Models; this migrates the remaining 52 legacy models.

Changes:
- Move 52 model files from app/ to app/Models/
- Update namespace declarations in each model
- Update all ~1000 import references across the codebase
- Add Relation::morphMap() in AppServiceProvider for backward
  compatibility with existing polymorphic database records
- Add missing HasSnowflakePrimary imports for models that relied
  on same-namespace resolution
4 weeks ago
Your Name 54cfdf3c2b refactor: add return type declarations to controller methods
Adds explicit return type declarations to 498 controller methods
across 88 files. Types inferred from return statements:

- JsonResponse for response()->json() returns
- RedirectResponse for redirect()/back() returns
- View (contract) for view() returns
- Response for response() returns
- void for methods with no return value
- array for array returns
- string/int/bool for scalar returns

Also fixes 3 methods with incorrect bare returns:
- AvatarController::deleteAvatar - bare return → json response
- ImportPostController::checkPermissions - bare return → true
- RemoteAuthController::accountToId - bare return → empty array
4 weeks ago
Your Name 4320231c1f fix: replace deprecated $request->get() with $request->input()
Symfony 8.0 removes Request::get(). Laravel 13 will support Symfony 8,
so these 11 usages would break on upgrade. Using $request->input()
which checks both query string and request body (same behavior as the
old get() method).
4 weeks ago
Your Name ffcef3eb2d fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago
Your Name 1617734907 Revert "Merge pull request #6851 from pixelfed/fix/phpstan-auth-request-scope-2"
This reverts commit ce4baf6995, reversing
changes made to 9235cb979a.
4 weeks ago
Your Name 0939f495bb fix: replace Auth facade with $request->user() in request-scoped classes
Replace Auth::user() with $request->user() and Auth::check() with
$request->user() !== null (or ! $request->user()) across all
controllers and middleware that have access to the request object.

This resolves 99 larastan.noAuthFacadeInRequestScope errors and
improves Octane compatibility.

For protected helper methods without $request in scope, uses the
request() helper instead.

Methods that previously lacked a Request parameter but used Auth
facade now accept Request $request via Laravel's auto-injection.
4 weeks ago