Merge pull request #3787 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-11-17 19:22:51 -07:00 committed by GitHub
commit 0eb4034278
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 88 additions and 193 deletions

View file

@ -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))

View file

@ -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();

View file

@ -0,0 +1,53 @@
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Str;
use App\User;
class UserVerifyEmail extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'user:verifyemail {username}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'Verify user email address';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
$user = User::whereUsername($this->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);
}
}

View file

@ -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);

View file

@ -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),

View file

@ -25,4 +25,4 @@ return [
'taggingPeople' => 'Označování lidí'
]
];

View file

@ -1,186 +0,0 @@
<?php
return [
'common' => [
'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'
],
];