From 682f5f0f33b52873db3c89b1f0d88c6997e26a7d Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 17 Nov 2022 18:09:16 -0700 Subject: [PATCH 1/7] Add Manually verify email address command --- app/Console/Commands/UserVerifyEmail.php | 53 ++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 app/Console/Commands/UserVerifyEmail.php diff --git a/app/Console/Commands/UserVerifyEmail.php b/app/Console/Commands/UserVerifyEmail.php new file mode 100644 index 000000000..3b3cac5ef --- /dev/null +++ b/app/Console/Commands/UserVerifyEmail.php @@ -0,0 +1,53 @@ +argument('username'))->first(); + + if(!$user) { + $this->error('Username not found'); + return; + } + + $user->email_verified_at = now(); + $user->save(); + $this->info('Successfully verified email address for ' . $user->username); + } +} From 54500ae376f4832c5abcad209ee5f93dca8c907f Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 17 Nov 2022 18:09:36 -0700 Subject: [PATCH 2/7] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fae8ec20..0f39660d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### New Features - Portfolios ([#3705](https://github.com/pixelfed/pixelfed/pull/3705)) - Server Directory ([#3762](https://github.com/pixelfed/pixelfed/pull/3762)) +- Manually verify email address (php artisan user:verifyemail) ([682f5f0f](https://github.com/pixelfed/pixelfed/commit/682f5f0f)) ### Updates - Update ApiV1Controller, include self likes in favourited_by endpoint ([58b331d2](https://github.com/pixelfed/pixelfed/commit/58b331d2)) From 4e1accdf1d43a7904a8b7f8e6be29624d57df4b0 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 17 Nov 2022 18:24:00 -0700 Subject: [PATCH 3/7] Fix cs lang --- resources/lang/cs/helpcenter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/cs/helpcenter.php b/resources/lang/cs/helpcenter.php index 29dbc5aec..70ff2d0f9 100644 --- a/resources/lang/cs/helpcenter.php +++ b/resources/lang/cs/helpcenter.php @@ -25,4 +25,4 @@ return [ 'taggingPeople' => 'Označování lidí' -] +]; From 8e9b7f6be32be925084fadbb7d0fc6c8c635f758 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 17 Nov 2022 18:26:33 -0700 Subject: [PATCH 4/7] Remove unused lang --- resources/lang/me/web.php | 186 -------------------------------------- 1 file changed, 186 deletions(-) delete mode 100644 resources/lang/me/web.php diff --git a/resources/lang/me/web.php b/resources/lang/me/web.php deleted file mode 100644 index 3844f847a..000000000 --- a/resources/lang/me/web.php +++ /dev/null @@ -1,186 +0,0 @@ - [ - 'comment' => 'Comment', - 'commented' => 'Commented', - 'comments' => 'Comments', - 'like' => 'Like', - 'liked' => 'Liked', - 'likes' => 'Likes', - 'share' => 'Share', - 'shared' => 'Shared', - 'shares' => 'Shares', - 'unshare' => 'Unshare', - - 'cancel' => 'Cancel', - 'copyLink' => 'Copy Link', - 'delete' => 'Delete', - 'error' => 'Error', - 'errorMsg' => 'Something went wrong. Please try again later.', - 'oops' => 'Oops!', - 'other' => 'Other', - 'readMore' => 'Read more', - 'success' => 'Success', - - 'sensitive' => 'Sensitive', - 'sensitiveContent' => 'Sensitive Content', - 'sensitiveContentWarning' => 'This post may contain sensitive content', - ], - - 'site' => [ - 'terms' => 'Terms of Use', - 'privacy' => 'Privacy Policy', - ], - - 'navmenu' => [ - 'search' => 'Search', - 'admin' => 'Admin Dashboard', - - // Timelines - 'homeFeed' => 'Home Feed', - 'localFeed' => 'Local Feed', - 'globalFeed' => 'Global Feed', - - // Core features - 'discover' => 'Discover', - 'directMessages' => 'Direct Messages', - 'notifications' => 'Notifications', - 'groups' => 'Groups', - 'stories' => 'Stories', - - // Self links - 'profile' => 'Profile', - 'drive' => 'Drive', - 'settings' => 'Settings', - 'compose' => 'Create New', - 'logout' => 'Logout', - - // Nav footer - 'about' => 'About', - 'help' => 'Help', - 'language' => 'Language', - 'privacy' => 'Privacy', - 'terms' => 'Terms', - - // Temporary links - 'backToPreviousDesign' => 'Go back to previous design' - ], - - 'directMessages' => [ - 'inbox' => 'Inbox', - 'sent' => 'Sent', - 'requests' => 'Requests' - ], - - 'notifications' => [ - 'liked' => 'liked your', - 'commented' => 'commented on your', - 'reacted' => 'reacted to your', - 'shared' => 'shared your', - 'tagged' => 'tagged you in a', - - 'updatedA' => 'updated a', - 'sentA' => 'sent a', - - 'followed' => 'followed', - 'mentioned' => 'mentioned', - 'you' => 'you', - - 'yourApplication' => 'Your application to join', - 'applicationApproved' => 'was approved!', - 'applicationRejected' => 'was rejected. You can re-apply to join in 6 months.', - - 'dm' => 'dm', - 'groupPost' => 'group post', - 'modlog' => 'modlog', - 'post' => 'post', - 'story' => 'story', - ], - - 'post' => [ - 'shareToFollowers' => 'Share to followers', - 'shareToOther' => 'Share to other', - 'noLikes' => 'No likes yet', - 'uploading' => 'Uploading', - ], - - 'profile' => [ - 'posts' => 'Posts', - 'followers' => 'Followers', - 'following' => 'Following', - 'admin' => 'Admin', - 'collections' => 'Collections', - 'follow' => 'Follow', - 'unfollow' => 'Unfollow', - 'editProfile' => 'Edit Profile', - 'followRequested' => 'Follow Requested', - 'joined' => 'Joined', - - 'emptyCollections' => 'We can\'t seem to find any collections', - 'emptyPosts' => 'We can\'t seem to find any posts', - ], - - 'menu' => [ - 'viewPost' => 'View Post', - 'viewProfile' => 'View Profile', - 'moderationTools' => 'Moderation Tools', - 'report' => 'Report', - 'archive' => 'Archive', - 'unarchive' => 'Unarchive', - 'embed' => 'Embed', - - 'selectOneOption' => 'Select one of the following options', - 'unlistFromTimelines' => 'Unlist from Timelines', - 'addCW' => 'Add Content Warning', - 'removeCW' => 'Remove Content Warning', - 'markAsSpammer' => 'Mark as Spammer', - 'markAsSpammerText' => 'Unlist + CW existing and future posts', - 'spam' => 'Spam', - 'sensitive' => 'Sensitive Content', - 'abusive' => 'Abusive or Harmful', - 'underageAccount' => 'Underage Account', - 'copyrightInfringement' => 'Copyright Infringement', - 'impersonation' => 'Impersonation', - 'scamOrFraud' => 'Scam or Fraud', - 'confirmReport' => 'Confirm Report', - 'confirmReportText' => 'Are you sure you want to report this post?', - 'reportSent' => 'Report Sent!', - 'reportSentText' => 'We have successfully received your report.', - 'reportSentError' => 'There was an issue reporting this post.', - - 'modAddCWConfirm' => 'Are you sure you want to add a content warning to this post?', - 'modCWSuccess' => 'Successfully added content warning', - 'modRemoveCWConfirm' => 'Are you sure you want to remove the content warning on this post?', - 'modRemoveCWSuccess' => 'Successfully removed content warning', - 'modUnlistConfirm' => 'Are you sure you want to unlist this post?', - 'modUnlistSuccess' => 'Successfully unlisted post', - 'modMarkAsSpammerConfirm' => 'Are you sure you want to mark this user as a spammer? All existing and future posts will be unlisted on timelines and a content warning will be applied.', - 'modMarkAsSpammerSuccess' => 'Successfully marked account as spammer', - - 'toFollowers' => 'to Followers', - - 'showCaption' => 'Show Caption', - 'showLikes' => 'Show Likes', - 'compactMode' => 'Compact Mode', - 'embedConfirmText' => 'By using this embed, you agree to our', - - 'deletePostConfirm' => 'Are you sure you want to delete this post?', - 'archivePostConfirm' => 'Are you sure you want to archive this post?', - 'unarchivePostConfirm' => 'Are you sure you want to unarchive this post?', - ], - - 'story' => [ - 'add' => 'Add Story' - ], - - 'timeline' => [ - 'peopleYouMayKnow' => 'People you may know' - ], - - 'hashtags' => [ - 'emptyFeed' => 'We can\'t seem to find any posts for this hashtag' - ], - -]; From 59702d406b0979bba427ba1fe033696cecbd2da8 Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 17 Nov 2022 18:40:47 -0700 Subject: [PATCH 5/7] Update federation config, enable remote follows by default --- config/federation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/federation.php b/config/federation.php index 91575abd9..4b6795687 100644 --- a/config/federation.php +++ b/config/federation.php @@ -16,7 +16,7 @@ return [ 'inbox' => env('AP_INBOX', true), 'sharedInbox' => env('AP_SHAREDINBOX', true), - 'remoteFollow' => env('AP_REMOTE_FOLLOW', false), + 'remoteFollow' => env('AP_REMOTE_FOLLOW', true), 'delivery' => [ 'timeout' => env('ACTIVITYPUB_DELIVERY_TIMEOUT', 30.0), From 1d52ad0b2726e9d4f3c5e3a89bfa83e6a54c3a5b Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 17 Nov 2022 18:59:51 -0700 Subject: [PATCH 6/7] Update ApiV1Controller, fix followAccountById with firstOrCreate() --- app/Http/Controllers/Api/ApiV1Controller.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index c2ab4ac1e..ea555dfd4 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -692,10 +692,10 @@ class ApiV1Controller extends Controller (new FollowerController())->sendFollow($user->profile, $target); } } else { - $follower = new Follower(); - $follower->profile_id = $user->profile_id; - $follower->following_id = $target->id; - $follower->save(); + $follower = Follower::firstOrCreate([ + 'profile_id' => $user->profile_id, + 'following_id' => $target->id + ]); if($remote == true && config('federation.activitypub.remoteFollow') == true) { (new FollowerController())->sendFollow($user->profile, $target); From 04a498af9cc52a1f41ef10c3f69aff944e6933ff Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Thu, 17 Nov 2022 19:21:31 -0700 Subject: [PATCH 7/7] Update SendUpdateActor command --- app/Console/Commands/SendUpdateActor.php | 29 +++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/app/Console/Commands/SendUpdateActor.php b/app/Console/Commands/SendUpdateActor.php index f0c753760..a874ee7c8 100644 --- a/app/Console/Commands/SendUpdateActor.php +++ b/app/Console/Commands/SendUpdateActor.php @@ -3,6 +3,7 @@ namespace App\Console\Commands; use Illuminate\Console\Command; +use Storage; use App\Profile; use App\User; use App\Instance; @@ -64,6 +65,7 @@ class SendUpdateActor extends Command return; } } + $this->touchStorageCache($domain); $this->line(' '); $this->error('Keep this window open during this process or it will not complete!'); $sharedInbox = Profile::whereDomain($domain)->whereNotNull('sharedInbox')->first(); @@ -76,8 +78,13 @@ class SendUpdateActor extends Command $this->info('Found sharedInbox: ' . $url); $bar = $this->output->createProgressBar($totalUserCount); $bar->start(); - User::whereNull('status')->chunk(50, function($users) use($bar, $url) { + + $startCache = $this->getStorageCache($domain); + User::whereNull('status')->when($startCache, function($query, $startCache) { + return $query->where('id', '>', $startCache); + })->chunk(50, function($users) use($bar, $url, $domain) { foreach($users as $user) { + $this->updateStorageCache($domain, $user->id); $profile = Profile::find($user->profile_id); if(!$profile) { continue; @@ -120,6 +127,26 @@ class SendUpdateActor extends Command ]; } + protected function touchStorageCache($domain) + { + $path = 'actor-update-cache/' . $domain; + if(!Storage::exists($path)) { + Storage::put($path, ""); + } + } + + protected function getStorageCache($domain) + { + $path = 'actor-update-cache/' . $domain; + return Storage::get($path); + } + + protected function updateStorageCache($domain, $value) + { + $path = 'actor-update-cache/' . $domain; + Storage::put($path, $value); + } + protected function actorObject($profile) { $permalink = $profile->permalink();