Commit Graph

81 Commits (ab893133cc7ce56b893e5055bb4a67ec31a6abb4)

Author SHA1 Message Date
Daniel Supernault ab893133cc
Update apps endpoint 1 week ago
Daniel Supernault 5e0171cf11
Add revoke token endpoint 1 week ago
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 b4bd3c87a0 Validate report object_id as a positive integer to fix 500 on array input 1 week 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
Your Name 3cb5b6e1ff Fix login activity groupBy returning stale rows and 500 on strict DBs 2 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
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 c807a8524c refactor: replace short facade aliases with fully-qualified imports
Convert all 273 short facade alias imports (e.g. 'use Cache;') to their
fully-qualified class names (e.g. 'use Illuminate\Support\Facades\Cache;')
across 193 files.

This resolves 643 PHPStan 'class.notFound' errors caused by the static
analyzer being unable to resolve global aliases, and aligns with modern
Laravel conventions. It also unblocks removing the aliases array from
config/app.php in a future change.

All 107 tests pass.
4 weeks ago
Your Name edb4368b08 refactor: replace deprecated laravel/helpers with native alternatives
Replace all deprecated helper function calls:
- str_slug() → Str::slug()
- starts_with() → str_starts_with()
- ends_with() → str_ends_with()
- array_first() → Arr::first()
- array_last() → Arr::last()
- array_flatten() → Arr::flatten()

Remove laravel/helpers package from composer.json as it is no longer
needed and will not be maintained for Laravel 13.
4 weeks ago
Your Name 79541afaa0 Merge origin/staging, resolve conflicts keeping matomo/device-detector over jenssegers/agent 4 weeks ago
Shift 19880c2ffb
Convert string references to `::class`
PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
4 weeks ago
Your Name 651f0de74f Replace jenssegers/agent with matomo/device-detector
- Remove unmaintained jenssegers/agent package (no releases since 2021)
- Add matomo/device-detector v6.5 as actively maintained replacement
- Create App\Services\UserAgentService wrapper for drop-in compatibility
- Update UserDevice model and ApiV1Dot1Controller to use new service
4 weeks ago
Your Name b329ee9edc API: Media uploads leak orphaned files when status creation validation fails 6 months ago
Your Name 45a9a3b472 RemoveUnreachableStatementRector 11 months ago
Your Name 15cc07e602 Fix all class.notFound PHPStan issues - 31 fixes 11 months ago
Daniel Supernault 3686c92122
Update Status storage, add SanitizerService to fix spacing in html stripped content 1 year ago
Daniel Supernault ec21eec508
Update ApiV1Dot1Controller, fix Story report follower check 1 year ago
Daniel Supernault f5dced0f7a
Update ApiV1Dot1Controller, add story report support 1 year ago
Daniel Supernault 4e938a8ffa
Fix heic, avif, webp support and add libvips driver 1 year ago
Daniel Supernault ab9c13fe0d
New supported formats, Preserve ICC Color Profiles, libvips support
Update image pipeline to handle avif, heic and webp and preserve ICC color profiles and added libvips support.
1 year ago
Daniel Supernault 207bb36c89
Increase username length limit from 15 to 30 2 years ago
Anil Kulkarni 4d0cb32f79
Fix notifications not being delivered by directly checking the state from the database 2 years ago
Daniel Supernault 56f17b9957
Update ApiV1Dot1Controller, fix in-app registration 2 years ago
Daniel Supernault 85124aa642
Fix rendered caption 2 years ago
Daniel Supernault 1d2f76c8e5
Postgres fixes 2 years ago
Daniel Supernault 9eeb7b6741
Update Status caption logic, stop storing duplicate html caption in db and defer to cached StatusService rendering 2 years ago
Daniel Supernault 7820b506d8
Update ApiV1Dot1Controller, allow upto 5 similar push tokens 2 years ago
Daniel Supernault 78d2783db8
Fix push token for php8.2 2 years ago
Daniel Supernault 078ea326c6
Update ApiV1Dot1Controller 2 years ago
Daniel Supernault df5a9f2659
Update nag endpoint 2 years ago
Daniel Supernault 33621dd680
Add Notify App Gateway support 2 years ago
Daniel Supernault 73b9a75a64
Add UserStorageService 2 years ago
Daniel Supernault 2803861083
Update ApiV1Dot1Controller.php 2 years ago
Daniel Supernault b03f5cec8b
Update ApiV1Dot1Controller, add new single media status create endpoint 2 years ago
Daniel Supernault bd3d072227
Update ApiV1Dot1Controller.php 2 years ago
Daniel Supernault 8f7becc58b
Add push notification api endpoints 2 years ago
Daniel Supernault a8bb97b22b
Update ApiV1Dot1Controller, fix mutual api 2 years ago
Daniel Supernault 5b85efb570
Update ApiV1Dot1Controller, lint 2 years ago
Daniel Supernault 4d6cea9aa4
Update ApiV1Dot1Controller, fix username to id endpoint 2 years ago
Daniel Supernault b29527cf53
Add api endpoint 2 years ago
Daniel Supernault cbf996c9b6
Update ApiV1Dot1Controller, fix in app registration bug that prevents proper auth flow due to missing oauth scopes 2 years ago
Daniel Supernault b0cb4456a9
Update ApiV1Dot1Controller, use config_cache for in-app registration 3 years ago
Emelia Smith 0f8e45fe75
Implement proper OAuth authorization on API endpoints 3 years ago
Emelia Smith 9330cd02f7
Implement proper OAuth authorization on Admin API endpoints 3 years ago