diff --git a/CHANGELOG.md b/CHANGELOG.md
index d7ee1304..17f621e0 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,8 @@
### Added
- Added ```BANNED_USERNAMES``` .env var, an optional comma separated string to ban specific usernames from being used ([6cdd64c6](https://github.com/pixelfed/pixelfed/commit/6cdd64c6))
- Added RestrictedAccess middleware for Restricted Mode ([17c1a83d](https://github.com/pixelfed/pixelfed/commit/17c1a83d))
+- Added FailedJob garbage collection ([5d424f12](https://github.com/pixelfed/pixelfed/commit/5d424f12))
+- Added Password Reset garbage collection ([829c41e1](https://github.com/pixelfed/pixelfed/commit/829c41e1))
### Fixed
- Fixed Story Compose bug affecting postgres instances ([#1918](https://github.com/pixelfed/pixelfed/pull/1918))
@@ -22,6 +24,9 @@
- Updated StoryCompose component, added upload progress page ([2de3c56f](https://github.com/pixelfed/pixelfed/commit/2de3c56f))
- Updated instance config, cleanup and add restricted mode ([3be32597](https://github.com/pixelfed/pixelfed/commit/3be32597))
- Update RelationshipSettings Controller, fixes #1605 ([4d2da2f1](https://github.com/pixelfed/pixelfed/commit/4d2da2f1))
+- Updated password reset, now expires after 24 hours ([829c41e1](https://github.com/pixelfed/pixelfed/commit/829c41e1))
+- Updated nav layout ([73249dc2](https://github.com/pixelfed/pixelfed/commit/73249dc2))
+- Updated views with noscript warnings ([eaca43a6](https://github.com/pixelfed/pixelfed/commit/eaca43a6))
### Changed
diff --git a/app/Console/Commands/FailedJobGC.php b/app/Console/Commands/FailedJobGC.php
new file mode 100644
index 00000000..f48d49b8
--- /dev/null
+++ b/app/Console/Commands/FailedJobGC.php
@@ -0,0 +1,49 @@
+failed_at->lt(now()->subMonth())) {
+ $job->delete();
+ }
+ }
+ });
+ }
+}
diff --git a/app/Console/Commands/PasswordResetGC.php b/app/Console/Commands/PasswordResetGC.php
new file mode 100644
index 00000000..2dbcc35e
--- /dev/null
+++ b/app/Console/Commands/PasswordResetGC.php
@@ -0,0 +1,48 @@
+subMinutes(1441))
+ ->chunk(50, function($emails) {
+ foreach($emails as $em) {
+ $em->delete();
+ }
+ });
+ }
+}
diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php
index 1e3364af..a29ace35 100644
--- a/app/Console/Kernel.php
+++ b/app/Console/Kernel.php
@@ -31,6 +31,8 @@ class Kernel extends ConsoleKernel
->hourly();
$schedule->command('horizon:snapshot')->everyFiveMinutes();
$schedule->command('story:gc')->everyFiveMinutes();
+ $schedule->command('gc:failedjobs')->dailyAt(3);
+ $schedule->command('gc:passwordreset')->dailyAt('09:41');
}
/**
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.php
index 57301a8b..37ccbba3 100644
--- a/app/Http/Controllers/AccountController.php
+++ b/app/Http/Controllers/AccountController.php
@@ -6,6 +6,7 @@ use Auth;
use Cache;
use Mail;
use Illuminate\Support\Facades\Redis;
+use Illuminate\Support\Str;
use Carbon\Carbon;
use App\Mail\ConfirmEmail;
use Illuminate\Http\Request;
@@ -80,8 +81,8 @@ class AccountController extends Controller
EmailVerification::whereUserId(Auth::id())->delete();
$user = User::whereNull('email_verified_at')->find(Auth::id());
- $utoken = str_random(64);
- $rtoken = str_random(128);
+ $utoken = Str::uuid() . Str::random(mt_rand(5,9));
+ $rtoken = Str::random(mt_rand(64, 70));
$verify = new EmailVerification();
$verify->user_id = $user->id;
@@ -98,7 +99,7 @@ class AccountController extends Controller
public function confirmVerifyEmail(Request $request, $userToken, $randomToken)
{
$verify = EmailVerification::where('user_token', $userToken)
- ->where('created_at', '>', now()->subWeeks(2))
+ ->where('created_at', '>', now()->subHours(24))
->where('random_token', $randomToken)
->firstOrFail();
diff --git a/resources/views/emails/confirm_email.blade.php b/resources/views/emails/confirm_email.blade.php
index cb521c9b..2fc98a75 100644
--- a/resources/views/emails/confirm_email.blade.php
+++ b/resources/views/emails/confirm_email.blade.php
@@ -1,12 +1,17 @@
@component('mail::message')
# Email Confirmation
-Please confirm your email address.
+Hello @{{$verify->user->username}}, please confirm your email address.
+
+If you did not create this account, please disregard this email.
@component('mail::button', ['url' => $verify->url()])
Confirm Email
@endcomponent
+
This link expires after 24 hours.
+
+
Thanks,
-{{ config('pixelfed.domain.app') }}
+{{ config('pixelfed.domain.app') }}
@endcomponent
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index 46b01ba8..c46cc59b 100644
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -41,6 +41,12 @@
@include('layouts.partial.nav')
@yield('content')
+
diff --git a/resources/views/layouts/partial/footer.blade.php b/resources/views/layouts/partial/footer.blade.php
index dfe3987d..24e3fe32 100644
--- a/resources/views/layouts/partial/footer.blade.php
+++ b/resources/views/layouts/partial/footer.blade.php
@@ -1,3 +1,4 @@
+@if(config('instance.restricted.enabled') == false)
+ @endif
diff --git a/resources/views/layouts/partial/nav.blade.php b/resources/views/layouts/partial/nav.blade.php
index 1f246f18..b5537b46 100644
--- a/resources/views/layouts/partial/nav.blade.php
+++ b/resources/views/layouts/partial/nav.blade.php
@@ -1,107 +1,118 @@
-