diff --git a/CHANGELOG.md b/CHANGELOG.md index f29719c43..e3037ab3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -96,6 +96,9 @@ - Updated Profile component, make modals scrollable. ([d1c664fa](https://github.com/pixelfed/pixelfed/commit/d1c664fa)) - Updated PostComponent, fixes #2351. ([7a62a42a](https://github.com/pixelfed/pixelfed/commit/7a62a42a)) - Updated DirectMessageController, fix pgsql bug. ([f1c28e7d](https://github.com/pixelfed/pixelfed/commit/f1c28e7d)) +- Updated RegisterController, make the minimum user password length configurable. ([09479c02](https://github.com/pixelfed/pixelfed/commit/09479c02)) +- Updated AuthServiceProvider, added support for configurable OAuth tokens and refresh tokens lifetime. ([7cfae612](https://github.com/pixelfed/pixelfed/commit/7cfae612)) +- Updated EmailService, make case insensitive. ([1b41d664](https://github.com/pixelfed/pixelfed/commit/1b41d664)) ## [v0.10.9 (2020-04-17)](https://github.com/pixelfed/pixelfed/compare/v0.10.8...v0.10.9) ### Added @@ -153,6 +156,7 @@ - Updated StatusTransformer, fixes #[2113](https://github.com/pixelfed/pixelfed/issues/2113) ([eefa6e0d](https://github.com/pixelfed/pixelfed/commit/eefa6e0d)) - Updated InternalApiController, limit remote profile ui to remote profiles ([d918a68e](https://github.com/pixelfed/pixelfed/commit/d918a68e)) - Updated NotificationCard, fix pagination bug #[2019](https://github.com/pixelfed/pixelfed/issues/2019) ([32beaad5](https://github.com/pixelfed/pixelfed/commit/32beaad5)) +- ## [v0.10.8 (2020-01-29)](https://github.com/pixelfed/pixelfed/compare/v0.10.7...v0.10.8) ### Added diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 02dbee42a..0a30c0705 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -115,7 +115,7 @@ class RegisterController extends Controller 'name' => 'nullable|string|max:'.config('pixelfed.max_name_length'), 'username' => $usernameRules, 'email' => $emailRules, - 'password' => 'required|string|min:12|confirmed', + 'password' => 'required|string|min:'.config('pixelfed.min_password_length').'|confirmed', ]; return Validator::make($data, $rules); diff --git a/app/Listeners/AuthLogin.php b/app/Listeners/AuthLogin.php index 9d1ce4a9c..90806965b 100644 --- a/app/Listeners/AuthLogin.php +++ b/app/Listeners/AuthLogin.php @@ -42,6 +42,13 @@ class AuthLogin protected function userProfile($user) { if (empty($user->profile)) { + if($user->created_at->lt(now()->subDays(1)) && empty($user->status)) { + $p = Profile::withTrashed()->whereUserId($user->id)->first(); + if($p) { + $p->restore(); + return; + } + } DB::transaction(function() use($user) { $profile = Profile::firstOrCreate(['user_id' => $user->id]); if($profile->wasRecentlyCreated == true) { diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index 8eb85150b..a3230fa0a 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -28,8 +28,8 @@ class AuthServiceProvider extends ServiceProvider if(config('pixelfed.oauth_enabled')) { Passport::routes(null, ['middleware' => ['twofactor', \Fruitcake\Cors\HandleCors::class]]); - Passport::tokensExpireIn(now()->addDays(15)); - Passport::refreshTokensExpireIn(now()->addDays(30)); + Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration', 15))); + Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 30))); Passport::enableImplicitGrant(); if(config('instance.oauth.pat.enabled')) { Passport::personalAccessClientId(config('instance.oauth.pat.id')); diff --git a/app/Services/EmailService.php b/app/Services/EmailService.php index 70117f529..8582c90d2 100644 --- a/app/Services/EmailService.php +++ b/app/Services/EmailService.php @@ -12,7 +12,7 @@ class EmailService { $parts = explode('@', $email); - return in_array(last($parts), self::bannedDomains()); + return in_array(strtolower(last($parts)), array_map('strtolower', self::bannedDomains())); } public static function bannedDomains() diff --git a/config/instance.php b/config/instance.php index e8047f3ec..489118f0e 100644 --- a/config/instance.php +++ b/config/instance.php @@ -55,6 +55,8 @@ return [ ], 'oauth' => [ + 'token_expiration' => env('OAUTH_TOKEN_DAYS', 15), + 'refresh_expiration' => env('OAUTH_REFRESH_DAYS', 30), 'pat' => [ 'enabled' => env('OAUTH_PAT_ENABLED', false), 'id' => env('OAUTH_PAT_ID'), diff --git a/config/pixelfed.php b/config/pixelfed.php index 7504c9493..cf2935b3e 100644 --- a/config/pixelfed.php +++ b/config/pixelfed.php @@ -119,6 +119,16 @@ return [ */ 'max_name_length' => env('MAX_NAME_LENGTH', 30), + /* + |-------------------------------------------------------------------------- + | Password minimum length limit + |-------------------------------------------------------------------------- + | + | Change the minimum length limit for user passwords. + | + */ + 'min_password_length' => env('MIN_PASSWORD_LENGTH', 12), + /* |-------------------------------------------------------------------------- | Album size limit diff --git a/contrib/docker/Dockerfile.apache b/contrib/docker/Dockerfile.apache index 16395baf1..e9e58805a 100644 --- a/contrib/docker/Dockerfile.apache +++ b/contrib/docker/Dockerfile.apache @@ -4,7 +4,7 @@ FROM php:7.4-apache-buster COPY contrib/docker/php.production.ini "$PHP_INI_DIR/php.ini" # Install Composer -ENV COMPOSER_VERSION=1.10.9 \ +ENV COMPOSER_VERSION=1.10.11 \ COMPOSER_HOME=/var/www/.composer \ COMPOSER_MEMORY_LIMIT=-1 \ PATH="~/.composer/vendor/bin:./vendor/bin:${PATH}" diff --git a/resources/lang/fr/helpcenter.php b/resources/lang/fr/helpcenter.php index 09aa05cf9..655ab5c06 100644 --- a/resources/lang/fr/helpcenter.php +++ b/resources/lang/fr/helpcenter.php @@ -20,5 +20,7 @@ return [ 'blockingAccounts' => 'Blocage des comptes', 'safetyTips' => 'Conseils de sécurité', 'reportSomething' => 'Signaler quelque chose', - 'dataPolicy' => 'Politique en matière de données' + 'dataPolicy' => 'Politique en matière de données', + + 'taggingPeople' => 'Mentionner des personnes' ]; diff --git a/resources/lang/gl/auth.php b/resources/lang/gl/auth.php index 81c434d1a..48645867b 100644 --- a/resources/lang/gl/auth.php +++ b/resources/lang/gl/auth.php @@ -14,6 +14,6 @@ return [ */ 'failed' => 'As credenciais non constan nos nosos rexistros.', - 'throttle' => 'Demasiados intentos de conexión. Por favor, inténteo de novo en :seconds seconds.', + 'throttle' => 'Demasiados intentos de conexión. Por favor, inténtao de novo en :seconds segundos.', ]; diff --git a/resources/lang/gl/exception.php b/resources/lang/gl/exception.php new file mode 100644 index 000000000..15321cec3 --- /dev/null +++ b/resources/lang/gl/exception.php @@ -0,0 +1,11 @@ + [ + 'invalid' => [ + 'album' => 'Debe conter unha soa foto ou vídeo ou varias fotos.', + ], + ], + +]; diff --git a/resources/lang/gl/helpcenter.php b/resources/lang/gl/helpcenter.php new file mode 100644 index 000000000..5cbe967e7 --- /dev/null +++ b/resources/lang/gl/helpcenter.php @@ -0,0 +1,28 @@ + 'Centro de Axuda', + 'whatsnew' => 'Novidades', + + 'gettingStarted' => 'Comezar', + 'sharingMedia' => 'Compartir Multimedia', + 'profile' => 'Perfil', + 'stories' => 'Historias', + 'hashtags' => 'Cancelos', + 'discover' => 'Descubrir', + 'directMessages' => 'Mensaxes Directas', + 'timelines' => 'Cronoloxías', + 'embed' => 'Incrustar', + + 'communityGuidelines' => 'Guías da comunidade', + 'whatIsTheFediverse' => 'Que é o fediverso?', + 'controllingVisibility' => 'Control da visibilidade', + 'blockingAccounts' => 'Bloqueo de contas', + 'safetyTips' => 'Seguridade', + 'reportSomething' => 'Denunicas', + 'dataPolicy' => 'Política de datos', + + 'taggingPeople' => 'Etiquetar persoas' + +]; diff --git a/resources/lang/gl/navmenu.php b/resources/lang/gl/navmenu.php index 4461d0ec9..09651c193 100644 --- a/resources/lang/gl/navmenu.php +++ b/resources/lang/gl/navmenu.php @@ -1,13 +1,19 @@ 'Ver perfil', - 'myTimeline' => 'A miña liña temporal', - 'publicTimeline' => 'Liña temporal pública', - 'remoteFollow' => 'Seguimento remoto', - 'settings' => 'Axustes', - 'admin' => 'Admin', - 'logout' => 'Saír', - + 'search' => 'Buscar', + 'home' => 'Inicio', + 'local' => 'Local', + 'network' => 'Rede', + 'discover' => 'Descubrir', + 'viewMyProfile' => 'Ver perfil', + 'myProfile' => 'O meu perfil', + 'myTimeline' => 'Cronoloxía', + 'publicTimeline' => 'Cronoloxía pública', + 'remoteFollow' => 'Seguimento remoto', + 'settings' => 'Axustes', + 'admin' => 'Admin', + 'logout' => 'Desconectar', + 'directMessages' => 'Mensaxes directas', + 'composePost' => 'Publicar', ]; diff --git a/resources/lang/gl/notification.php b/resources/lang/gl/notification.php index 5a70d5648..d1951fa79 100644 --- a/resources/lang/gl/notification.php +++ b/resources/lang/gl/notification.php @@ -2,7 +2,11 @@ return [ - 'likedPhoto' => 'gustoulle a súa foto.', - 'startedFollowingYou' => 'comezou a seguila.', + 'likedPhoto' => 'gustoulle a túa publicación.', + 'likedComment' => 'gustoulle o teu comentario.', + 'startedFollowingYou' => 'comezou a seguirte.', + 'commented' => 'comentou na túa publicación.', + 'mentionedYou' => 'mencionoute.', + 'shared' => 'compartiu a túa publicación.', ]; diff --git a/resources/lang/gl/passwords.php b/resources/lang/gl/passwords.php index 5df2d9051..f79013146 100644 --- a/resources/lang/gl/passwords.php +++ b/resources/lang/gl/passwords.php @@ -13,10 +13,10 @@ return [ | */ - 'password' => 'Os contrasinais deben ser ao menos de seis caracteres e concordar na confirmación.', - 'reset' => 'Restableceuse o seu contrasinal!', - 'sent' => 'Acabamos de enviarlle unha ligazón para restablecer o contrasinal!', - 'token' => 'Este testemuño de restablecemento de contrasinal non é válido.', - 'user' => 'Non atopamos unha usuaria con ese enderezo de correo.', + 'password' => 'Os contrasinais deben ter seis caracteres como mínimo e concordar na confirmación.', + 'reset' => 'Restableceuse o teu contrasinal!', + 'sent' => 'Se o email está na base de datos, recibirás unha ligazón para restablecer o contrasinal dentro duns minutos. Comproba o cartafol de spam se non recibes o email.', + 'token' => 'O testemuño de restablecemento do contrasinal non é válido.', + 'user' => 'Se o email está na base de datos, recibirás unha ligazón para restablecer o contrasinal dentro duns minutos. Comproba o cartafol de spam se non recibes o email.', ]; diff --git a/resources/lang/gl/profile.php b/resources/lang/gl/profile.php index 2b39d9e62..c6ebeb49b 100644 --- a/resources/lang/gl/profile.php +++ b/resources/lang/gl/profile.php @@ -1,8 +1,15 @@ 'Esta usuaria aínda non publicou!', - 'emptyFollowers' => 'Esta usuaria aínda non ten seguidoras!', - 'emptyFollowing' => 'Esta usuaria aínda non segue a ninguén!', - 'savedWarning' => 'Só vostede pode ver o que gardou', + 'emptyTimeline' => 'Esta usuaria aínda non publicou!', + 'emptyFollowers' => 'Esta usuaria aínda non ten seguidoras!', + 'emptyFollowing' => 'Esta usuaria aínda non segue a ninguén!', + 'emptySaved' => 'Aínda non gardaches ningunha publicación!', + 'savedWarning' => 'Só podes ver o que gardaches', + 'privateProfileWarning' => 'Esta conta é Privada', + 'alreadyFollow' => 'Xa segues :username?', + 'loginToSeeProfile' => 'para ver as súas fotos e vídeos.', + + 'status.disabled.header' => 'Perfil non dispoñible', + 'status.disabled.body' => 'O perfil non está dipoñible neste intre, inténtao dentro dun anaco.', ]; diff --git a/resources/lang/gl/site.php b/resources/lang/gl/site.php index f50a8ef35..28503d03f 100644 --- a/resources/lang/gl/site.php +++ b/resources/lang/gl/site.php @@ -1,13 +1,20 @@ 'Acerca de', - 'help' => 'Axuda', - 'language' => 'Idioma', - 'fediverse' => 'Fediverso', - 'opensource' => 'Código aberto', - 'terms' => 'Termos', - 'privacy' => 'Intimidade', - 'l10nWip' => 'Estamos a traballar no soporte da localización do servizo', - 'currentLocale' => 'Locale actual', - 'selectLocale' => 'Escolla un dos idiomas admitidos', + + 'about' => 'Acerca de', + 'help' => 'Axuda', + 'language' => 'Idioma', + 'fediverse' => 'Fediverso', + 'opensource' => 'Código aberto', + 'terms' => 'Termos', + 'privacy' => 'Privacidade', + 'l10nWip' => 'Estamos a traballar no sistema de tradución', + 'currentLocale' => 'Idioma actual', + 'selectLocale' => 'Elixe un dos idiomas incluídos', + 'contact' => 'Contacto', + 'contact-us' => 'Contacta con nós', + 'places' => 'Lugares', + 'profiles' => 'Perfís', + ]; diff --git a/resources/lang/gl/timeline.php b/resources/lang/gl/timeline.php index 25f07194a..e66ccafd8 100644 --- a/resources/lang/gl/timeline.php +++ b/resources/lang/gl/timeline.php @@ -2,6 +2,6 @@ return [ - 'emptyPersonalTimeline' => 'A súa liña temporal está baldeira.', + 'emptyPersonalTimeline' => 'A cronoloxía está baleira.', ]; diff --git a/resources/lang/gl/validation.php b/resources/lang/gl/validation.php index caa7d2453..f6cb2dbd5 100644 --- a/resources/lang/gl/validation.php +++ b/resources/lang/gl/validation.php @@ -16,10 +16,10 @@ return [ 'accepted' => 'O :attribute debe aceptarse.', 'active_url' => 'O :attribute non é un URL válido.', 'after' => 'A :attribute debe ser unha data posterior :date.', - 'after_or_equal' => 'A :attribute debe ser unha data posterior ou igual a must be a date after or equal to :date.', + 'after_or_equal' => 'A :attribute debe ser unha data posterior ou igual a :date.', 'alpha' => 'O :attribute só pode conter letras.', - 'alpha_dash' => 'O :attribute podería conter só letras, números e guións.', - 'alpha_num' => 'O :attribute podería conter só letras e números.', + 'alpha_dash' => 'O :attribute pode conter só letras, números e trazos.', + 'alpha_num' => 'O :attribute pode conter só letras e números.', 'array' => 'A :attribute debe ser unha cadea.', 'before' => 'A :attribute debe ser unha data anterior a :date.', 'before_or_equal' => 'A :attribute debe ser unha data anterior ou igual a :date.', @@ -30,15 +30,15 @@ return [ 'array' => 'O :attribute debe ter entre :min e :max elementos.', ], 'boolean' => 'O campo :attribute debe ser verdadeiro ou falso.', - 'confirmed' => 'O :attribute de confirmación non coincide.', + 'confirmed' => 'O :attribute de confirmación non concorda.', 'date' => 'A :attribute non é unha data válida.', 'date_format' => 'O :attribute non segue o formato :format.', 'different' => ' :attribute e :other deben ser diferentes.', 'digits' => ' :attribute deben ser :digits díxitos.', 'digits_between' => ' :attribute debe ter entre :min e :max díxitos.', - 'dimensions' => 'The :attribute ten unhas dimensións de imaxe non válidas.', + 'dimensions' => ' :attribute ten unhas dimensións de imaxe non válidas.', 'distinct' => 'O campo :attribute ten un valor duplo.', - 'email' => 'The :attribute debe ser un enderezo de correo válido.', + 'email' => ' :attribute debe ser un enderezo de correo válido.', 'exists' => 'O :attribute escollido non é válido.', 'file' => ' :attribute debe ser un ficheiro.', 'filled' => 'O campo :attribute debe ter un valor.', @@ -72,8 +72,8 @@ return [ 'required' => 'O campo :attribute é requerido.', 'required_if' => 'O campo :attribute é requerido cando :other é :value.', 'required_unless' => 'O campo :attribute é requerido a non ser que :other esté en :values.', - 'required_with' => 'O campo :attribute é requerido cando :values é presente.', - 'required_with_all' => 'O campo :attribute é requerido cando :values é presente.', + 'required_with' => 'O campo :attribute é requerido cando :values está presente.', + 'required_with_all' => 'O campo :attribute é requerido cando :values está presente.', 'required_without' => 'O campo :attribute é requerido cando :values non está presente.', 'required_without_all' => 'O campo :attribute é requerido cando non está presente :values.', 'same' => ' :attribute e :other deben coincidir.', diff --git a/resources/views/auth/sudo.blade.php b/resources/views/auth/sudo.blade.php index 515fcba03..ccaf6cc39 100644 --- a/resources/views/auth/sudo.blade.php +++ b/resources/views/auth/sudo.blade.php @@ -26,7 +26,7 @@
- +
diff --git a/resources/views/settings/partial/sidebar.blade.php b/resources/views/settings/partial/sidebar.blade.php index 21165e1e7..08f7ed304 100644 --- a/resources/views/settings/partial/sidebar.blade.php +++ b/resources/views/settings/partial/sidebar.blade.php @@ -52,9 +52,9 @@ - {{-- --}} +