diff --git a/CHANGELOG.md b/CHANGELOG.md index 23b69dc80..87635ac00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - WebP Support ([069a0e4a](https://github.com/pixelfed/pixelfed/commit/069a0e4a)) - Auto Following support for admins ([68aa2540](https://github.com/pixelfed/pixelfed/commit/68aa2540)) - Mark as spammer mod tool, unlists and applies content warning to existing and future post ([6d956a86](https://github.com/pixelfed/pixelfed/commit/6d956a86)) +- Diagnostics for error page and admin dashboard ([64725ecc](https://github.com/pixelfed/pixelfed/commit/64725ecc)) ### Updated - Updated PrettyNumber, fix deprecated warning. ([20ec870b](https://github.com/pixelfed/pixelfed/commit/20ec870b)) diff --git a/app/Http/Controllers/AdminController.php b/app/Http/Controllers/AdminController.php index a55a48c1a..0bf49da89 100644 --- a/app/Http/Controllers/AdminController.php +++ b/app/Http/Controllers/AdminController.php @@ -440,4 +440,29 @@ class AdminController extends Controller $redirect = $news->published_at ? $news->permalink() : $news->editUrl(); return redirect($redirect); } + + public function diagnosticsHome(Request $request) + { + return view('admin.diagnostics.home'); + } + + public function diagnosticsDecrypt(Request $request) + { + $this->validate($request, [ + 'payload' => 'required' + ]); + + $key = 'exception_report:'; + $decrypted = decrypt($request->input('payload')); + + if(!starts_with($decrypted, $key)) { + abort(403, 'Can only decrypt error diagnostics'); + } + + $res = [ + 'decrypted' => substr($decrypted, strlen($key)) + ]; + + return response()->json($res); + } } diff --git a/resources/views/admin/diagnostics/home.blade.php b/resources/views/admin/diagnostics/home.blade.php new file mode 100644 index 000000000..d4031b442 --- /dev/null +++ b/resources/views/admin/diagnostics/home.blade.php @@ -0,0 +1,111 @@ +@extends('admin.partial.template') + +@include('admin.settings.sidebar') + +@section('section') +
+

Diagnostics

+

Instance diagnostics

+
+ +
+

+ Information + Copy +

+ +
+
+
+
+ + +

The payload is from the "Something went wrong" page, anyone can copy the payload for you to decrypt.
Contents are encrypted due to potential sensitive information.

+
+
+ + +
+
+ +
+
+
+@endsection + +@push('scripts') + + +@endpush diff --git a/resources/views/admin/partial/sidenav.blade.php b/resources/views/admin/partial/sidenav.blade.php index 85ba069c7..88b291eb5 100644 --- a/resources/views/admin/partial/sidenav.blade.php +++ b/resources/views/admin/partial/sidenav.blade.php @@ -64,6 +64,13 @@ + + + +