From c8e43c60943fca230a2ebc781b0882d36c38dce3 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 26 May 2021 20:11:25 -0600 Subject: [PATCH 1/7] Update api, remove auth requirement for hashtag timeline --- app/Http/Controllers/Api/ApiV1Controller.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 307bafa64..f48602ae9 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -1988,8 +1988,6 @@ class ApiV1Controller extends Controller */ public function timelineHashtag(Request $request, $hashtag) { - abort_if(!$request->user(), 403); - $this->validate($request,[ 'page' => 'nullable|integer|max:40', 'min_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX, From 224bda1760c3ffe120c7094c2e2f5f5ef4cf09ff Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 26 May 2021 20:12:24 -0600 Subject: [PATCH 2/7] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 897cb7226..3bfa7a887 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -95,6 +95,7 @@ - Updated ComposeController, bail on empty attachments. ([061b145b](https://github.com/pixelfed/pixelfed/commit/061b145b)) - Updated landing and about page. ([92dc7af6](https://github.com/pixelfed/pixelfed/commit/92dc7af6)) - Updated AdminStatsService, fix postgres bug. ([af719135](https://github.com/pixelfed/pixelfed/commit/af719135)) +- Updated api, remove auth requirement for hashtag timeline. ([c8e43c60](https://github.com/pixelfed/pixelfed/commit/c8e43c60)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10) From 78ad4e77d9a41b91a0510f55eb1f8d6255381ccb Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 26 May 2021 20:29:33 -0600 Subject: [PATCH 3/7] Update NotificationCard component, fix default value --- resources/assets/js/components/NotificationCard.vue | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/assets/js/components/NotificationCard.vue b/resources/assets/js/components/NotificationCard.vue index f44205317..9fe9e3c2f 100644 --- a/resources/assets/js/components/NotificationCard.vue +++ b/resources/assets/js/components/NotificationCard.vue @@ -20,7 +20,7 @@

- {{truncate(n.account.username)}} liked your + {{truncate(n.account.username)}} liked your post. @@ -86,6 +86,12 @@

0 Notifications!

+
+
+

+

No notifications yet

+
+
@@ -253,4 +259,4 @@ } } } - \ No newline at end of file + From 0788bffa37ce44506c9633e7548d45eb9694f023 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 26 May 2021 20:31:11 -0600 Subject: [PATCH 4/7] Update Timeline component, show counts and make sidebar footer lighter --- resources/assets/js/components/Timeline.vue | 42 +++++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue index 98ed5633e..c0a3ab5a0 100644 --- a/resources/assets/js/components/Timeline.vue +++ b/resources/assets/js/components/Timeline.vue @@ -355,6 +355,22 @@ --> +
@@ -388,18 +404,17 @@
@@ -898,7 +913,10 @@ }) } ] - } + }, + discover_min_id: 0, + discover_max_id: 0, + discover_feed: [] } }, From 178ed63d0afa8959497559390ee1cb3defaab5cd Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 May 2021 23:04:24 -0600 Subject: [PATCH 5/7] Update AuthServiceProvider, increase default token + refresh token lifetime --- app/Providers/AuthServiceProvider.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/Providers/AuthServiceProvider.php b/app/Providers/AuthServiceProvider.php index a3230fa0a..1184e6a11 100644 --- a/app/Providers/AuthServiceProvider.php +++ b/app/Providers/AuthServiceProvider.php @@ -26,10 +26,10 @@ class AuthServiceProvider extends ServiceProvider { $this->registerPolicies(); - if(config('pixelfed.oauth_enabled')) { + if(config_cache('pixelfed.oauth_enabled') == true) { Passport::routes(null, ['middleware' => ['twofactor', \Fruitcake\Cors\HandleCors::class]]); - Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration', 15))); - Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 30))); + Passport::tokensExpireIn(now()->addDays(config('instance.oauth.token_expiration', 356))); + Passport::refreshTokensExpireIn(now()->addDays(config('instance.oauth.refresh_expiration', 400))); Passport::enableImplicitGrant(); if(config('instance.oauth.pat.enabled')) { Passport::personalAccessClientId(config('instance.oauth.pat.id')); @@ -48,8 +48,8 @@ class AuthServiceProvider extends ServiceProvider ]); } - Gate::define('viewWebSocketsDashboard', function ($user = null) { - return $user->is_admin; - }); + // Gate::define('viewWebSocketsDashboard', function ($user = null) { + // return $user->is_admin; + // }); } } From 7e0be154043fef62f9064a85bb35aa72008c4821 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 May 2021 23:06:47 -0600 Subject: [PATCH 6/7] Update exceptions handler --- app/Exceptions/Handler.php | 91 +++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 45 deletions(-) diff --git a/app/Exceptions/Handler.php b/app/Exceptions/Handler.php index 13534549f..a2aa11f98 100644 --- a/app/Exceptions/Handler.php +++ b/app/Exceptions/Handler.php @@ -4,55 +4,56 @@ namespace App\Exceptions; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Throwable; +use League\OAuth2\Server\Exception\OAuthServerException; class Handler extends ExceptionHandler { - /** - * A list of the exception types that are not reported. - * - * @var array - */ - protected $dontReport = [ - // - ]; + /** + * A list of the exception types that are not reported. + * + * @var array + */ + protected $dontReport = [ + OAuthServerException::class + ]; - /** - * A list of the inputs that are never flashed for validation exceptions. - * - * @var array - */ - protected $dontFlash = [ - 'password', - 'password_confirmation', - ]; + /** + * A list of the inputs that are never flashed for validation exceptions. + * + * @var array + */ + protected $dontFlash = [ + 'password', + 'password_confirmation', + ]; - /** - * Report or log an exception. - * - * @param \Exception $exception - * - * @return void - */ - public function report(Throwable $exception) - { - parent::report($exception); - } + /** + * Report or log an exception. + * + * @param \Exception $exception + * + * @return void + */ + public function report(Throwable $exception) + { + parent::report($exception); + } - /** - * Render an exception into an HTTP response. - * - * @param \Illuminate\Http\Request $request - * @param \Exception $exception - * - * @return \Illuminate\Http\Response - */ - public function render($request, Throwable $exception) - { - if ($request->wantsJson()) - return response()->json( - ['error' => $exception->getMessage()], - method_exists($exception, 'getStatusCode') ? $exception->getStatusCode() : 500 - ); - return parent::render($request, $exception); - } + /** + * Render an exception into an HTTP response. + * + * @param \Illuminate\Http\Request $request + * @param \Exception $exception + * + * @return \Illuminate\Http\Response + */ + public function render($request, Throwable $exception) + { + if ($request->wantsJson()) + return response()->json( + ['error' => $exception->getMessage()], + method_exists($exception, 'getStatusCode') ? $exception->getStatusCode() : 500 + ); + return parent::render($request, $exception); + } } From 525dce1c59588a45521ad27fc376fe5597eb301b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 27 May 2021 23:07:30 -0600 Subject: [PATCH 7/7] Update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bfa7a887..3121245d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ - Profile pronouns ([fabb57a9](https://github.com/pixelfed/pixelfed/commit/fabb57a9)) - Hashtag timeline api support ([241ae036](https://github.com/pixelfed/pixelfed/commit/241ae036)) - New admin dashboard layout ([eb7d5a4e](https://github.com/pixelfed/pixelfed/commit/eb7d5a4e)) +- Fresh about page layout ([92dc7af6](https://github.com/pixelfed/pixelfed/commit/92dc7af6)) +- Instance Rules ([a4efbb75](https://github.com/pixelfed/pixelfed/commit/a4efbb75)) ### Updated - Updated AdminController, fix variable name in updateSpam method. ([6edaf940](https://github.com/pixelfed/pixelfed/commit/6edaf940)) @@ -96,6 +98,9 @@ - Updated landing and about page. ([92dc7af6](https://github.com/pixelfed/pixelfed/commit/92dc7af6)) - Updated AdminStatsService, fix postgres bug. ([af719135](https://github.com/pixelfed/pixelfed/commit/af719135)) - Updated api, remove auth requirement for hashtag timeline. ([c8e43c60](https://github.com/pixelfed/pixelfed/commit/c8e43c60)) +- Updated NotificationCard component, fix default value. ([78ad4e77](https://github.com/pixelfed/pixelfed/commit/78ad4e77)) +- Updated Timeline component, show counts and make sidebar footer lighter. ([0788bffa](https://github.com/pixelfed/pixelfed/commit/0788bffa)) +- Updated AuthServiceProvider, increase default token + refresh token lifetime. ([178ed63d](https://github.com/pixelfed/pixelfed/commit/178ed63d)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10)