Commit Graph

62 Commits (0435d08568baf6c502c623e8fc8075375d6ae151)

Author SHA1 Message Date
Your Name 0435d08568 RemoveAlwaysElseRector 5 days ago
Your Name 163cd9f589 polish 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 ce073ffc92 Merge remote-tracking branch 'origin/staging' into feature/honeypot-spam-protection
# Conflicts:
#	routes/web.php
2 weeks ago
Daniel Supernault 1d96c94054
Refactor Auth, remove expensive middleware 2 weeks ago
Your Name afcb68c183 Fix registration form redirecting when max_users is falsy 2 weeks ago
Your Name ce4343e3e2 Replace custom register token with spatie/laravel-honeypot
Swap the custom 'rt' register token anti-spam mechanism for
spatie/laravel-honeypot on the registration and parental-controls
invite flows.

- Add spatie/laravel-honeypot and publish config/honeypot.php
- Remove getRegisterToken() and the rt validation rule from RegisterController
- Replace the rt hidden field with the @honeypot directive in both forms
- Attach ProtectAgainstSpam middleware to POST /register and the
  parental-controls invite register route
- Update RegisterTest to disable honeypot for the valid registration case
2 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
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 97929f0876 fix: resolve str_ends_with TypeError in RegisterController
PHP's str_ends_with() only accepts a string needle, not an array.
The username validation was passing an array of extensions which
caused a TypeError on every registration attempt.

Replace with a loop over a configurable array of disallowed extensions,
making it easy to add new entries.

Also updates RegisterTest to properly test the registration flow
including the RT anti-bot token and age verification fields.
4 weeks ago
Your Name 7c964f3b4f fix: replace backslash-prefixed facade calls with imported references
Replace \Cache::, \Log::, \DB:: calls with their imported facade
equivalents. The backslash-prefix relies on global aliases which
PHPStan cannot resolve, causing class.notFound errors.
4 weeks ago
Your Name e7ba43e2e1 fix: add missing use imports to resolve phpstan class.notFound errors
Add missing imports for Log, Cache, DB, FollowerService, StatusService,
LikeService, ReblogService, UserFilterService, AdminProfile, OauthClient,
and fix StatusTimelineTransformer reference (class didn't exist, replaced
with StatusTransformer).
4 weeks ago
Your Name 98267eb26f refactor: replace deprecated str_random() with Str::random()
str_random() is a deprecated helper from laravel/helpers that was
missed in the initial helpers removal. Replace all 18 call sites
with the modern Str::random() equivalent.
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
Daniel Supernault 4960421073
Update CuratedOnboarding, add new app:curated-onboarding command, extend email verification window to 7 days and fix resend verification mails 2 years ago
Daniel Supernault 207bb36c89
Increase username length limit from 15 to 30 2 years ago
Daniel Supernault dd6e3cc290
Update RegisterController, update username constraints, require atleast one alpha char 2 years ago
Daniel Supernault 8a89e3c963
Update captcha, use config_cache helper 3 years ago
Daniel Supernault 8dac2caf1d
Add Curated Onboarding 3 years ago
Daniel Supernault c53894fe16
Add Parental Controls feature 3 years ago
Daniel Supernault a6d10f0389
Update RegisterController 3 years ago
Daniel Supernault c071c7195e
Update login/register views and captcha config, enable login or register captchas or both 3 years ago
Daniel Supernault 1bbee6d07b
Update RegisterController, improve max_users calculation and add kb page to redirect to if conditions are met 3 years ago
Robert von Burg 7e8938d749
[Fix] Don't count inactive accounts for registration blocking 3 years ago
Daniel Supernault d4c967de98
Update RegisterController, store client ip during registration 3 years ago
Daniel Supernault 50ab2e2039
Add cloud ip bans to BouncerService 3 years ago
Daniel Supernault 9bbd6dcd23
Update v1.1 api, add post moderation endpoint 4 years ago
Daniel Supernault 042c5b6c33
Improve onboarding 5 years ago
Daniel Supernault e503a8da85
Update RegisterController 5 years ago
Rodrigo Fonseca 31330e0aed
Fix starting check of username to allow numbers.
The check for the first letter of username used to be !ctype_alpha, but the error message says "Must start with a letter or number." Updated check to be !ctype_alnum, to be coherent with the error message.
5 years ago
Daniel Supernault 27b722e7a7
Update config() to config_cache() 5 years ago
Daniel Supernault 082c1ccb26
Add hCaptcha 6 years ago
Daniel Supernault 78a8798ace
Update RegisterController, fixes #2436 6 years ago
delthas 09479c02ca Make the minimum user password length configurable
Previously, all passwords had to be at least 12 characters long.

Some users use a slightly shorter password, so some instances could wish
to reduce the password length limit to a slightly lesser value.

This makes the minimum password length configurable in the .env file,
with the MIN_PASSWORD_LENGTH variable, that defaults to 12 to keep the
previous behaviour by default.
6 years ago
Daniel Supernault 3b7ff030f2
Update RegisterController 6 years ago
dx7 913bf77ba4
Improve email validation error for restricted emails 6 years ago
dx7 693f530326
Improve username validation error for restricted names 6 years ago
Daniel Supernault 5bcb43a673
Update RegisterController, fix CI bug 7 years ago
Daniel Supernault 14ba350ba3
Fix postgres bugs 7 years ago
Daniel Supernault fa8e0dca4d
Update RegisterController 7 years ago
Daniel Supernault d11e82c3d9
Update landing page, add age check 7 years ago
Daniel Supernault 64950748cf
Update RegisterController 7 years ago
Daniel Supernault f22a4b2d75
Update RegisterController, bump min password length from 6 to 8 7 years ago
Daniel Supernault b885cccd6b
Update Auth controller 7 years ago
Shleeble d61c48c62b
Update RegisterController.php 8 years ago
Daniel Supernault 12995989c4
Add max user limit 8 years ago
Daniel Supernault e39f88f6c6
Bump version to 0.7.1 8 years ago
Daniel Supernault c6b1164620
Update AuthLogin 8 years ago