mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-19 04:51:27 +00:00
commit
57582b1b2e
15 changed files with 1248 additions and 1179 deletions
|
@ -26,6 +26,13 @@
|
||||||
- Update ComposeModal.vue, fix scroll issue and dont hide scrollbar ([2d959fb3](https://github.com/pixelfed/pixelfed/commit/2d959fb3))
|
- Update ComposeModal.vue, fix scroll issue and dont hide scrollbar ([2d959fb3](https://github.com/pixelfed/pixelfed/commit/2d959fb3))
|
||||||
- Update AccountImport, add select first 100 posts button ([625a76a5](https://github.com/pixelfed/pixelfed/commit/625a76a5))
|
- Update AccountImport, add select first 100 posts button ([625a76a5](https://github.com/pixelfed/pixelfed/commit/625a76a5))
|
||||||
- Update ApiV1Controller, add include_reblogs attribute to home timeline ([37fd0342](https://github.com/pixelfed/pixelfed/commit/37fd0342))
|
- Update ApiV1Controller, add include_reblogs attribute to home timeline ([37fd0342](https://github.com/pixelfed/pixelfed/commit/37fd0342))
|
||||||
|
- Update rate limits, fixes #4537 ([1cc6274a](https://github.com/pixelfed/pixelfed/commit/1cc6274a))
|
||||||
|
- Update Services, use zpopmin on predis ([4b2c66f5](https://github.com/pixelfed/pixelfed/commit/4b2c66f5))
|
||||||
|
- Update Inbox, allow storing Create->Note activities without any local followers, disabled by default ([9fa6b3f7](https://github.com/pixelfed/pixelfed/commit/9fa6b3f7))
|
||||||
|
- Update AP Helpers, preserve admin unlisted state before adding to NetworkTimelineService ([0704c7e0](https://github.com/pixelfed/pixelfed/commit/0704c7e0))
|
||||||
|
- Update SearchApiV2Service, improve resolve query logic to better handle remote posts/profiles and local posts/profiles ([c61d0b91](https://github.com/pixelfed/pixelfed/commit/c61d0b91))
|
||||||
|
- Update FollowPipeline, improve follower/following count calculation ([0b515767](https://github.com/pixelfed/pixelfed/commit/0b515767))
|
||||||
|
- Update TransformImports command, increment status_count on profile model ([ba7551d8](https://github.com/pixelfed/pixelfed/commit/ba7551d8))
|
||||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
||||||
|
|
||||||
## [v0.11.8 (2023-05-29)](https://github.com/pixelfed/pixelfed/compare/v0.11.7...v0.11.8)
|
## [v0.11.8 (2023-05-29)](https://github.com/pixelfed/pixelfed/compare/v0.11.7...v0.11.8)
|
||||||
|
|
|
@ -9,6 +9,7 @@ use App\Media;
|
||||||
use App\Profile;
|
use App\Profile;
|
||||||
use App\Status;
|
use App\Status;
|
||||||
use Storage;
|
use Storage;
|
||||||
|
use App\Services\AccountService;
|
||||||
use App\Services\MediaPathService;
|
use App\Services\MediaPathService;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use App\Util\Lexer\Autolink;
|
use App\Util\Lexer\Autolink;
|
||||||
|
@ -38,7 +39,7 @@ class TransformImports extends Command
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ips = ImportPost::whereNull('status_id')->where('skip_missing_media', '!=', true)->take(200)->get();
|
$ips = ImportPost::whereNull('status_id')->where('skip_missing_media', '!=', true)->take(500)->get();
|
||||||
|
|
||||||
if(!$ips->count()) {
|
if(!$ips->count()) {
|
||||||
return;
|
return;
|
||||||
|
@ -135,6 +136,11 @@ class TransformImports extends Command
|
||||||
$ip->creation_id = $idk['incr'];
|
$ip->creation_id = $idk['incr'];
|
||||||
$ip->save();
|
$ip->save();
|
||||||
|
|
||||||
|
$profile->status_count = $profile->status_count + 1;
|
||||||
|
$profile->save();
|
||||||
|
|
||||||
|
AccountService::del($profile->id);
|
||||||
|
|
||||||
ImportService::clearAttempts($profile->id);
|
ImportService::clearAttempts($profile->id);
|
||||||
ImportService::getPostCount($profile->id, true);
|
ImportService::getPostCount($profile->id, true);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1621,7 +1621,7 @@ class ApiV1Controller extends Controller
|
||||||
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
|
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
|
||||||
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
|
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
|
||||||
|
|
||||||
return $dailyLimit >= 250;
|
return $dailyLimit >= 1250;
|
||||||
});
|
});
|
||||||
abort_if($limitReached == true, 429);
|
abort_if($limitReached == true, 429);
|
||||||
|
|
||||||
|
@ -1826,7 +1826,7 @@ class ApiV1Controller extends Controller
|
||||||
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
|
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
|
||||||
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
|
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
|
||||||
|
|
||||||
return $dailyLimit >= 250;
|
return $dailyLimit >= 1250;
|
||||||
});
|
});
|
||||||
abort_if($limitReached == true, 429);
|
abort_if($limitReached == true, 429);
|
||||||
|
|
||||||
|
@ -2838,7 +2838,7 @@ class ApiV1Controller extends Controller
|
||||||
->where('created_at', '>', now()->subDays(1))
|
->where('created_at', '>', now()->subDays(1))
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
return $dailyLimit >= 100;
|
return $dailyLimit >= 1000;
|
||||||
});
|
});
|
||||||
|
|
||||||
abort_if($limitReached == true, 429);
|
abort_if($limitReached == true, 429);
|
||||||
|
|
|
@ -225,7 +225,7 @@ class ApiV2Controller extends Controller
|
||||||
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
|
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
|
||||||
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
|
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
|
||||||
|
|
||||||
return $dailyLimit >= 250;
|
return $dailyLimit >= 1250;
|
||||||
});
|
});
|
||||||
abort_if($limitReached == true, 429);
|
abort_if($limitReached == true, 429);
|
||||||
|
|
||||||
|
|
|
@ -98,7 +98,7 @@ class ComposeController extends Controller
|
||||||
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
|
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
|
||||||
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
|
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
|
||||||
|
|
||||||
return $dailyLimit >= 250;
|
return $dailyLimit >= 1250;
|
||||||
});
|
});
|
||||||
|
|
||||||
abort_if($limitReached == true, 429);
|
abort_if($limitReached == true, 429);
|
||||||
|
@ -190,7 +190,7 @@ class ComposeController extends Controller
|
||||||
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
|
$limitReached = Cache::remember($limitKey, $limitTtl, function() use($user) {
|
||||||
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
|
$dailyLimit = Media::whereUserId($user->id)->where('created_at', '>', now()->subDays(1))->count();
|
||||||
|
|
||||||
return $dailyLimit >= 500;
|
return $dailyLimit >= 1500;
|
||||||
});
|
});
|
||||||
|
|
||||||
abort_if($limitReached == true, 429);
|
abort_if($limitReached == true, 429);
|
||||||
|
@ -499,7 +499,7 @@ class ComposeController extends Controller
|
||||||
->where('created_at', '>', now()->subDays(1))
|
->where('created_at', '>', now()->subDays(1))
|
||||||
->count();
|
->count();
|
||||||
|
|
||||||
return $dailyLimit >= 100;
|
return $dailyLimit >= 1000;
|
||||||
});
|
});
|
||||||
|
|
||||||
abort_if($limitReached == true, 429);
|
abort_if($limitReached == true, 429);
|
||||||
|
|
|
@ -17,91 +17,71 @@ use App\Services\FollowerService;
|
||||||
|
|
||||||
class FollowPipeline implements ShouldQueue
|
class FollowPipeline implements ShouldQueue
|
||||||
{
|
{
|
||||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||||
|
|
||||||
protected $follower;
|
protected $follower;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete the job if its models no longer exist.
|
* Delete the job if its models no longer exist.
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $deleteWhenMissingModels = true;
|
public $deleteWhenMissingModels = true;
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new job instance.
|
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct($follower)
|
|
||||||
{
|
|
||||||
$this->follower = $follower;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Execute the job.
|
* Create a new job instance.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function handle()
|
public function __construct($follower)
|
||||||
{
|
{
|
||||||
$follower = $this->follower;
|
$this->follower = $follower;
|
||||||
$actor = $follower->actor;
|
}
|
||||||
$target = $follower->target;
|
|
||||||
|
|
||||||
if(!$actor || !$target) {
|
/**
|
||||||
return;
|
* Execute the job.
|
||||||
}
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$follower = $this->follower;
|
||||||
|
$actor = $follower->actor;
|
||||||
|
$target = $follower->target;
|
||||||
|
|
||||||
Cache::forget('profile:following:' . $actor->id);
|
if(!$actor || !$target) {
|
||||||
Cache::forget('profile:following:' . $target->id);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
FollowerService::add($actor->id, $target->id);
|
if($target->domain || !$target->private_key) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$actorProfileSync = Cache::get(FollowerService::FOLLOWING_SYNC_KEY . $actor->id);
|
Cache::forget('profile:following:' . $actor->id);
|
||||||
if(!$actorProfileSync) {
|
Cache::forget('profile:following:' . $target->id);
|
||||||
FollowServiceWarmCache::dispatch($actor->id)->onQueue('low');
|
|
||||||
} else {
|
|
||||||
if($actor->following_count) {
|
|
||||||
$actor->increment('following_count');
|
|
||||||
} else {
|
|
||||||
$count = Follower::whereProfileId($actor->id)->count();
|
|
||||||
$actor->following_count = $count;
|
|
||||||
$actor->save();
|
|
||||||
}
|
|
||||||
Cache::put(FollowerService::FOLLOWING_SYNC_KEY . $actor->id, 1, 604800);
|
|
||||||
AccountService::del($actor->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
$targetProfileSync = Cache::get(FollowerService::FOLLOWERS_SYNC_KEY . $target->id);
|
FollowerService::add($actor->id, $target->id);
|
||||||
if(!$targetProfileSync) {
|
|
||||||
FollowServiceWarmCache::dispatch($target->id)->onQueue('low');
|
|
||||||
} else {
|
|
||||||
if($target->followers_count) {
|
|
||||||
$target->increment('followers_count');
|
|
||||||
} else {
|
|
||||||
$count = Follower::whereFollowingId($target->id)->count();
|
|
||||||
$target->followers_count = $count;
|
|
||||||
$target->save();
|
|
||||||
}
|
|
||||||
Cache::put(FollowerService::FOLLOWERS_SYNC_KEY . $target->id, 1, 604800);
|
|
||||||
AccountService::del($target->id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if($target->domain || !$target->private_key) {
|
$count = Follower::whereProfileId($actor->id)->count();
|
||||||
return;
|
$actor->following_count = $count;
|
||||||
}
|
$actor->save();
|
||||||
|
AccountService::del($actor->id);
|
||||||
|
|
||||||
try {
|
$count = Follower::whereFollowingId($target->id)->count();
|
||||||
$notification = new Notification();
|
$target->followers_count = $count;
|
||||||
$notification->profile_id = $target->id;
|
$target->save();
|
||||||
$notification->actor_id = $actor->id;
|
AccountService::del($target->id);
|
||||||
$notification->action = 'follow';
|
|
||||||
$notification->item_id = $target->id;
|
try {
|
||||||
$notification->item_type = "App\Profile";
|
$notification = new Notification();
|
||||||
$notification->save();
|
$notification->profile_id = $target->id;
|
||||||
} catch (Exception $e) {
|
$notification->actor_id = $actor->id;
|
||||||
Log::error($e);
|
$notification->action = 'follow';
|
||||||
}
|
$notification->item_id = $target->id;
|
||||||
}
|
$notification->item_type = "App\Profile";
|
||||||
|
$notification->save();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
Log::error($e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,9 +24,7 @@ class LikeService {
|
||||||
public static function setAdd($profileId, $statusId)
|
public static function setAdd($profileId, $statusId)
|
||||||
{
|
{
|
||||||
if(self::setCount($profileId) > 400) {
|
if(self::setCount($profileId) > 400) {
|
||||||
if(config('database.redis.client') === 'phpredis') {
|
Redis::zpopmin(self::CACHE_SET_KEY . $profileId);
|
||||||
Redis::zpopmin(self::CACHE_SET_KEY . $profileId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Redis::zadd(self::CACHE_SET_KEY . $profileId, $statusId, $statusId);
|
return Redis::zadd(self::CACHE_SET_KEY . $profileId, $statusId, $statusId);
|
||||||
|
|
|
@ -49,9 +49,7 @@ class NetworkTimelineService
|
||||||
public static function add($val)
|
public static function add($val)
|
||||||
{
|
{
|
||||||
if(self::count() > config('instance.timeline.network.cache_dropoff')) {
|
if(self::count() > config('instance.timeline.network.cache_dropoff')) {
|
||||||
if(config('database.redis.client') === 'phpredis') {
|
Redis::zpopmin(self::CACHE_KEY);
|
||||||
Redis::zpopmin(self::CACHE_KEY);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Redis::zadd(self::CACHE_KEY, $val, $val);
|
return Redis::zadd(self::CACHE_KEY, $val, $val);
|
||||||
|
|
|
@ -49,9 +49,7 @@ class PublicTimelineService {
|
||||||
public static function add($val)
|
public static function add($val)
|
||||||
{
|
{
|
||||||
if(self::count() > 400) {
|
if(self::count() > 400) {
|
||||||
if(config('database.redis.client') === 'phpredis') {
|
Redis::zpopmin(self::CACHE_KEY);
|
||||||
Redis::zpopmin(self::CACHE_KEY);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Redis::zadd(self::CACHE_KEY, $val, $val);
|
return Redis::zadd(self::CACHE_KEY, $val, $val);
|
||||||
|
|
|
@ -18,317 +18,355 @@ use App\Services\StatusService;
|
||||||
|
|
||||||
class SearchApiV2Service
|
class SearchApiV2Service
|
||||||
{
|
{
|
||||||
private $query;
|
private $query;
|
||||||
static $mastodonMode = false;
|
static $mastodonMode = false;
|
||||||
|
|
||||||
public static function query($query, $mastodonMode = false)
|
public static function query($query, $mastodonMode = false)
|
||||||
{
|
{
|
||||||
self::$mastodonMode = $mastodonMode;
|
self::$mastodonMode = $mastodonMode;
|
||||||
return (new self)->run($query);
|
return (new self)->run($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function run($query)
|
protected function run($query)
|
||||||
{
|
{
|
||||||
$this->query = $query;
|
$this->query = $query;
|
||||||
$q = urldecode($query->input('q'));
|
$q = urldecode($query->input('q'));
|
||||||
|
|
||||||
if($query->has('resolve') &&
|
if($query->has('resolve') &&
|
||||||
( Str::startsWith($q, 'https://') ||
|
( Str::startsWith($q, 'https://') ||
|
||||||
Str::substrCount($q, '@') >= 1)
|
Str::substrCount($q, '@') >= 1)
|
||||||
) {
|
) {
|
||||||
return $this->resolveQuery();
|
return $this->resolveQuery();
|
||||||
}
|
}
|
||||||
|
|
||||||
if($query->has('type')) {
|
if($query->has('type')) {
|
||||||
switch ($query->input('type')) {
|
switch ($query->input('type')) {
|
||||||
case 'accounts':
|
case 'accounts':
|
||||||
return [
|
return [
|
||||||
'accounts' => $this->accounts(),
|
'accounts' => $this->accounts(),
|
||||||
'hashtags' => [],
|
'hashtags' => [],
|
||||||
'statuses' => []
|
'statuses' => []
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
case 'hashtags':
|
case 'hashtags':
|
||||||
return [
|
return [
|
||||||
'accounts' => [],
|
'accounts' => [],
|
||||||
'hashtags' => $this->hashtags(),
|
'hashtags' => $this->hashtags(),
|
||||||
'statuses' => []
|
'statuses' => []
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
case 'statuses':
|
case 'statuses':
|
||||||
return [
|
return [
|
||||||
'accounts' => [],
|
'accounts' => [],
|
||||||
'hashtags' => [],
|
'hashtags' => [],
|
||||||
'statuses' => $this->statuses()
|
'statuses' => $this->statuses()
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if($query->has('account_id')) {
|
if($query->has('account_id')) {
|
||||||
return [
|
return [
|
||||||
'accounts' => [],
|
'accounts' => [],
|
||||||
'hashtags' => [],
|
'hashtags' => [],
|
||||||
'statuses' => $this->statusesById()
|
'statuses' => $this->statusesById()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'accounts' => $this->accounts(),
|
'accounts' => $this->accounts(),
|
||||||
'hashtags' => $this->hashtags(),
|
'hashtags' => $this->hashtags(),
|
||||||
'statuses' => $this->statuses()
|
'statuses' => $this->statuses()
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function accounts($initalQuery = false)
|
protected function accounts($initalQuery = false)
|
||||||
{
|
{
|
||||||
$mastodonMode = self::$mastodonMode;
|
$mastodonMode = self::$mastodonMode;
|
||||||
$user = request()->user();
|
$user = request()->user();
|
||||||
$limit = $this->query->input('limit') ?? 20;
|
$limit = $this->query->input('limit') ?? 20;
|
||||||
$offset = $this->query->input('offset') ?? 0;
|
$offset = $this->query->input('offset') ?? 0;
|
||||||
$rawQuery = $initalQuery ? $initalQuery : $this->query->input('q');
|
$rawQuery = $initalQuery ? $initalQuery : $this->query->input('q');
|
||||||
$query = $rawQuery . '%';
|
$query = $rawQuery . '%';
|
||||||
$webfingerQuery = $query;
|
$webfingerQuery = $query;
|
||||||
if(Str::substrCount($rawQuery, '@') == 1 && substr($rawQuery, 0, 1) !== '@') {
|
if(Str::substrCount($rawQuery, '@') == 1 && substr($rawQuery, 0, 1) !== '@') {
|
||||||
$query = '@' . $query;
|
$query = '@' . $query;
|
||||||
}
|
}
|
||||||
if(substr($webfingerQuery, 0, 1) !== '@') {
|
if(substr($webfingerQuery, 0, 1) !== '@') {
|
||||||
$webfingerQuery = '@' . $webfingerQuery;
|
$webfingerQuery = '@' . $webfingerQuery;
|
||||||
}
|
}
|
||||||
$banned = InstanceService::getBannedDomains();
|
$banned = InstanceService::getBannedDomains();
|
||||||
$operator = config('database.default') === 'pgsql' ? 'ilike' : 'like';
|
$operator = config('database.default') === 'pgsql' ? 'ilike' : 'like';
|
||||||
$results = Profile::select('username', 'id', 'followers_count', 'domain')
|
$results = Profile::select('username', 'id', 'followers_count', 'domain')
|
||||||
->where('username', $operator, $query)
|
->where('username', $operator, $query)
|
||||||
->orWhere('webfinger', $operator, $webfingerQuery)
|
->orWhere('webfinger', $operator, $webfingerQuery)
|
||||||
->orderByDesc('profiles.followers_count')
|
->orderByDesc('profiles.followers_count')
|
||||||
->offset($offset)
|
->offset($offset)
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->get()
|
->get()
|
||||||
->filter(function($profile) use ($banned) {
|
->filter(function($profile) use ($banned) {
|
||||||
return in_array($profile->domain, $banned) == false;
|
return in_array($profile->domain, $banned) == false;
|
||||||
})
|
})
|
||||||
->map(function($res) use($mastodonMode) {
|
->map(function($res) use($mastodonMode) {
|
||||||
return $mastodonMode ?
|
return $mastodonMode ?
|
||||||
AccountService::getMastodon($res['id']) :
|
AccountService::getMastodon($res['id']) :
|
||||||
AccountService::get($res['id']);
|
AccountService::get($res['id']);
|
||||||
})
|
})
|
||||||
->filter(function($account) {
|
->filter(function($account) {
|
||||||
return $account && isset($account['id']);
|
return $account && isset($account['id']);
|
||||||
})
|
})
|
||||||
->values();
|
->values();
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function hashtags()
|
protected function hashtags()
|
||||||
{
|
{
|
||||||
$mastodonMode = self::$mastodonMode;
|
$mastodonMode = self::$mastodonMode;
|
||||||
$q = $this->query->input('q');
|
$q = $this->query->input('q');
|
||||||
$limit = $this->query->input('limit') ?? 20;
|
$limit = $this->query->input('limit') ?? 20;
|
||||||
$offset = $this->query->input('offset') ?? 0;
|
$offset = $this->query->input('offset') ?? 0;
|
||||||
$query = Str::startsWith($q, '#') ? '%' . substr($q, 1) . '%' : '%' . $q . '%';
|
$query = Str::startsWith($q, '#') ? '%' . substr($q, 1) . '%' : '%' . $q . '%';
|
||||||
$operator = config('database.default') === 'pgsql' ? 'ilike' : 'like';
|
$operator = config('database.default') === 'pgsql' ? 'ilike' : 'like';
|
||||||
return Hashtag::where('name', $operator, $query)
|
return Hashtag::where('name', $operator, $query)
|
||||||
->orWhere('slug', $operator, $query)
|
->orWhere('slug', $operator, $query)
|
||||||
->where(function($q) {
|
->where(function($q) {
|
||||||
return $q->where('can_search', true)
|
return $q->where('can_search', true)
|
||||||
->orWhereNull('can_search');
|
->orWhereNull('can_search');
|
||||||
})
|
})
|
||||||
->orderByDesc('cached_count')
|
->orderByDesc('cached_count')
|
||||||
->offset($offset)
|
->offset($offset)
|
||||||
->limit($limit)
|
->limit($limit)
|
||||||
->get()
|
->get()
|
||||||
->map(function($tag) use($mastodonMode) {
|
->map(function($tag) use($mastodonMode) {
|
||||||
$res = [
|
$res = [
|
||||||
'name' => $tag->name,
|
'name' => $tag->name,
|
||||||
'url' => $tag->url()
|
'url' => $tag->url()
|
||||||
];
|
];
|
||||||
|
|
||||||
if(!$mastodonMode) {
|
if(!$mastodonMode) {
|
||||||
$res['history'] = [];
|
$res['history'] = [];
|
||||||
$res['count'] = HashtagService::count($tag->id);
|
$res['count'] = HashtagService::count($tag->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $res;
|
return $res;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function statuses()
|
protected function statuses()
|
||||||
{
|
{
|
||||||
// Removed until we provide more relevent sorting/results
|
// Removed until we provide more relevent sorting/results
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function statusesById()
|
protected function statusesById()
|
||||||
{
|
{
|
||||||
// Removed until we provide more relevent sorting/results
|
// Removed until we provide more relevent sorting/results
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function resolveQuery()
|
protected function resolveQuery()
|
||||||
{
|
{
|
||||||
$default = [
|
$default = [
|
||||||
'accounts' => [],
|
'accounts' => [],
|
||||||
'hashtags' => [],
|
'hashtags' => [],
|
||||||
'statuses' => [],
|
'statuses' => [],
|
||||||
];
|
];
|
||||||
$mastodonMode = self::$mastodonMode;
|
$mastodonMode = self::$mastodonMode;
|
||||||
$query = urldecode($this->query->input('q'));
|
$query = urldecode($this->query->input('q'));
|
||||||
if(substr($query, 0, 1) === '@' && !Str::contains($query, '.')) {
|
if(substr($query, 0, 1) === '@' && !Str::contains($query, '.')) {
|
||||||
$default['accounts'] = $this->accounts(substr($query, 1));
|
$default['accounts'] = $this->accounts(substr($query, 1));
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
if(Helpers::validateLocalUrl($query)) {
|
if(Helpers::validateLocalUrl($query)) {
|
||||||
if(Str::contains($query, '/p/')) {
|
if(Str::contains($query, '/p/') || Str::contains($query, 'i/web/post/')) {
|
||||||
return $this->resolveLocalStatus();
|
return $this->resolveLocalStatus();
|
||||||
} else {
|
} else if(Str::contains($query, 'i/web/profile/')) {
|
||||||
return $this->resolveLocalProfile();
|
return $this->resolveLocalProfileId();
|
||||||
}
|
} else {
|
||||||
} else {
|
return $this->resolveLocalProfile();
|
||||||
if(!Helpers::validateUrl($query) && strpos($query, '@') == -1) {
|
}
|
||||||
return $default;
|
} else {
|
||||||
}
|
if(!Helpers::validateUrl($query) && strpos($query, '@') == -1) {
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
|
||||||
if(!Str::startsWith($query, 'http') && Str::substrCount($query, '@') == 1 && strpos($query, '@') !== 0) {
|
if(!Str::startsWith($query, 'http') && Str::substrCount($query, '@') == 1 && strpos($query, '@') !== 0) {
|
||||||
try {
|
try {
|
||||||
$res = WebfingerService::lookup('@' . $query, $mastodonMode);
|
$res = WebfingerService::lookup('@' . $query, $mastodonMode);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
if($res && isset($res['id'])) {
|
if($res && isset($res['id'])) {
|
||||||
$default['accounts'][] = $res;
|
$default['accounts'][] = $res;
|
||||||
return $default;
|
return $default;
|
||||||
} else {
|
} else {
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Str::substrCount($query, '@') == 2) {
|
if(Str::substrCount($query, '@') == 2) {
|
||||||
try {
|
try {
|
||||||
$res = WebfingerService::lookup($query, $mastodonMode);
|
$res = WebfingerService::lookup($query, $mastodonMode);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
if($res && isset($res['id'])) {
|
if($res && isset($res['id'])) {
|
||||||
$default['accounts'][] = $res;
|
$default['accounts'][] = $res;
|
||||||
return $default;
|
return $default;
|
||||||
} else {
|
} else {
|
||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
if($sid = Status::whereUri($query)->first()) {
|
||||||
$res = ActivityPubFetchService::get($query);
|
$s = StatusService::get($sid->id, false);
|
||||||
$banned = InstanceService::getBannedDomains();
|
if(in_array($s['visibility'], ['public', 'unlisted'])) {
|
||||||
if($res) {
|
$default['statuses'][] = $s;
|
||||||
$json = json_decode($res, true);
|
return $default;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!$json || !isset($json['@context']) || !isset($json['type']) || !in_array($json['type'], ['Note', 'Person'])) {
|
try {
|
||||||
return [
|
$res = ActivityPubFetchService::get($query);
|
||||||
'accounts' => [],
|
$banned = InstanceService::getBannedDomains();
|
||||||
'hashtags' => [],
|
if($res) {
|
||||||
'statuses' => [],
|
$json = json_decode($res, true);
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
switch($json['type']) {
|
if(!$json || !isset($json['@context']) || !isset($json['type']) || !in_array($json['type'], ['Note', 'Person'])) {
|
||||||
case 'Note':
|
return [
|
||||||
$obj = Helpers::statusFetch($query);
|
'accounts' => [],
|
||||||
if(!$obj || !isset($obj['id'])) {
|
'hashtags' => [],
|
||||||
return $default;
|
'statuses' => [],
|
||||||
}
|
];
|
||||||
$note = $mastodonMode ?
|
}
|
||||||
StatusService::getMastodon($obj['id']) :
|
|
||||||
StatusService::get($obj['id']);
|
|
||||||
if(!$note) {
|
|
||||||
return $default;
|
|
||||||
}
|
|
||||||
$default['statuses'][] = $note;
|
|
||||||
return $default;
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'Person':
|
switch($json['type']) {
|
||||||
$obj = Helpers::profileFetch($query);
|
case 'Note':
|
||||||
if(!$obj) {
|
$obj = Helpers::statusFetch($query);
|
||||||
return $default;
|
if(!$obj || !isset($obj['id'])) {
|
||||||
}
|
return $default;
|
||||||
if(in_array($obj['domain'], $banned)) {
|
}
|
||||||
return $default;
|
$note = $mastodonMode ?
|
||||||
}
|
StatusService::getMastodon($obj['id'], false) :
|
||||||
$default['accounts'][] = $mastodonMode ?
|
StatusService::get($obj['id'], false);
|
||||||
AccountService::getMastodon($obj['id']) :
|
if(!$note) {
|
||||||
AccountService::get($obj['id']);
|
return $default;
|
||||||
return $default;
|
}
|
||||||
break;
|
if(!isset($note['visibility']) || !in_array($note['visibility'], ['public', 'unlisted'])) {
|
||||||
|
return $default;
|
||||||
|
}
|
||||||
|
$default['statuses'][] = $note;
|
||||||
|
return $default;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
case 'Person':
|
||||||
return [
|
$obj = Helpers::profileFetch($query);
|
||||||
'accounts' => [],
|
if(!$obj) {
|
||||||
'hashtags' => [],
|
return $default;
|
||||||
'statuses' => [],
|
}
|
||||||
];
|
if(in_array($obj['domain'], $banned)) {
|
||||||
break;
|
return $default;
|
||||||
}
|
}
|
||||||
}
|
$default['accounts'][] = $mastodonMode ?
|
||||||
} catch (\Exception $e) {
|
AccountService::getMastodon($obj['id'], true) :
|
||||||
return [
|
AccountService::get($obj['id'], true);
|
||||||
'accounts' => [],
|
return $default;
|
||||||
'hashtags' => [],
|
break;
|
||||||
'statuses' => [],
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
return $default;
|
default:
|
||||||
}
|
return [
|
||||||
}
|
'accounts' => [],
|
||||||
|
'hashtags' => [],
|
||||||
|
'statuses' => [],
|
||||||
|
];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return [
|
||||||
|
'accounts' => [],
|
||||||
|
'hashtags' => [],
|
||||||
|
'statuses' => [],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
protected function resolveLocalStatus()
|
return $default;
|
||||||
{
|
}
|
||||||
$query = urldecode($this->query->input('q'));
|
}
|
||||||
$query = last(explode('/', $query));
|
|
||||||
$status = StatusService::getMastodon($query);
|
|
||||||
if(!$status) {
|
|
||||||
return [
|
|
||||||
'accounts' => [],
|
|
||||||
'hashtags' => [],
|
|
||||||
'statuses' => []
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
$res = [
|
protected function resolveLocalStatus()
|
||||||
'accounts' => [],
|
{
|
||||||
'hashtags' => [],
|
$query = urldecode($this->query->input('q'));
|
||||||
'statuses' => [$status]
|
$query = last(explode('/', parse_url($query, PHP_URL_PATH)));
|
||||||
];
|
$status = StatusService::getMastodon($query, false);
|
||||||
|
if(!$status || !in_array($status['visibility'], ['public', 'unlisted'])) {
|
||||||
|
return [
|
||||||
|
'accounts' => [],
|
||||||
|
'hashtags' => [],
|
||||||
|
'statuses' => []
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
return $res;
|
$res = [
|
||||||
}
|
'accounts' => [],
|
||||||
|
'hashtags' => [],
|
||||||
|
'statuses' => [$status]
|
||||||
|
];
|
||||||
|
|
||||||
protected function resolveLocalProfile()
|
return $res;
|
||||||
{
|
}
|
||||||
$query = urldecode($this->query->input('q'));
|
|
||||||
$query = last(explode('/', $query));
|
|
||||||
$profile = Profile::whereNull('status')
|
|
||||||
->whereNull('domain')
|
|
||||||
->whereUsername($query)
|
|
||||||
->first();
|
|
||||||
|
|
||||||
if(!$profile) {
|
protected function resolveLocalProfile()
|
||||||
return [
|
{
|
||||||
'accounts' => [],
|
$query = urldecode($this->query->input('q'));
|
||||||
'hashtags' => [],
|
$query = last(explode('/', parse_url($query, PHP_URL_PATH)));
|
||||||
'statuses' => []
|
$profile = Profile::whereNull('status')
|
||||||
];
|
->whereNull('domain')
|
||||||
}
|
->whereUsername($query)
|
||||||
|
->first();
|
||||||
|
|
||||||
$fractal = new Fractal\Manager();
|
if(!$profile) {
|
||||||
$fractal->setSerializer(new ArraySerializer());
|
return [
|
||||||
$resource = new Fractal\Resource\Item($profile, new AccountTransformer());
|
'accounts' => [],
|
||||||
return [
|
'hashtags' => [],
|
||||||
'accounts' => $fractal->createData($resource)->toArray(),
|
'statuses' => []
|
||||||
'hashtags' => [],
|
];
|
||||||
'statuses' => []
|
}
|
||||||
];
|
|
||||||
}
|
$fractal = new Fractal\Manager();
|
||||||
|
$fractal->setSerializer(new ArraySerializer());
|
||||||
|
$resource = new Fractal\Resource\Item($profile, new AccountTransformer());
|
||||||
|
return [
|
||||||
|
'accounts' => [$fractal->createData($resource)->toArray()],
|
||||||
|
'hashtags' => [],
|
||||||
|
'statuses' => []
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function resolveLocalProfileId()
|
||||||
|
{
|
||||||
|
$query = urldecode($this->query->input('q'));
|
||||||
|
$query = last(explode('/', parse_url($query, PHP_URL_PATH)));
|
||||||
|
$profile = Profile::whereNull('status')
|
||||||
|
->find($query);
|
||||||
|
|
||||||
|
if(!$profile) {
|
||||||
|
return [
|
||||||
|
'accounts' => [],
|
||||||
|
'hashtags' => [],
|
||||||
|
'statuses' => []
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
$fractal = new Fractal\Manager();
|
||||||
|
$fractal->setSerializer(new ArraySerializer());
|
||||||
|
$resource = new Fractal\Resource\Item($profile, new AccountTransformer());
|
||||||
|
return [
|
||||||
|
'accounts' => [$fractal->createData($resource)->toArray()],
|
||||||
|
'hashtags' => [],
|
||||||
|
'statuses' => []
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -281,7 +281,8 @@ class Inbox
|
||||||
}
|
}
|
||||||
|
|
||||||
if($actor->followers_count == 0) {
|
if($actor->followers_count == 0) {
|
||||||
if(FollowerService::followerCount($actor->id, true) == 0) {
|
if(config('federation.activitypub.ingest.store_notes_without_followers')) {
|
||||||
|
} else if(FollowerService::followerCount($actor->id, true) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
75
composer.lock
generated
75
composer.lock
generated
|
@ -62,16 +62,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "aws/aws-sdk-php",
|
"name": "aws/aws-sdk-php",
|
||||||
"version": "3.275.5",
|
"version": "3.275.7",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/aws/aws-sdk-php.git",
|
"url": "https://github.com/aws/aws-sdk-php.git",
|
||||||
"reference": "d46961b82e857f77059c0c78160719ecb26f6cc6"
|
"reference": "54dcef3349c81b46c0f5f6e54b5f9bfb5db19903"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/d46961b82e857f77059c0c78160719ecb26f6cc6",
|
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/54dcef3349c81b46c0f5f6e54b5f9bfb5db19903",
|
||||||
"reference": "d46961b82e857f77059c0c78160719ecb26f6cc6",
|
"reference": "54dcef3349c81b46c0f5f6e54b5f9bfb5db19903",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -151,9 +151,9 @@
|
||||||
"support": {
|
"support": {
|
||||||
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
|
||||||
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
"issues": "https://github.com/aws/aws-sdk-php/issues",
|
||||||
"source": "https://github.com/aws/aws-sdk-php/tree/3.275.5"
|
"source": "https://github.com/aws/aws-sdk-php/tree/3.275.7"
|
||||||
},
|
},
|
||||||
"time": "2023-07-07T18:20:11+00:00"
|
"time": "2023-07-13T18:21:04+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "bacon/bacon-qr-code",
|
"name": "bacon/bacon-qr-code",
|
||||||
|
@ -2357,16 +2357,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/framework",
|
"name": "laravel/framework",
|
||||||
"version": "v10.14.1",
|
"version": "v10.15.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/framework.git",
|
"url": "https://github.com/laravel/framework.git",
|
||||||
"reference": "6f89a2b74b232d8bf2e1d9ed87e311841263dfcb"
|
"reference": "c7599dc92e04532824bafbd226c2936ce6a905b8"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/framework/zipball/6f89a2b74b232d8bf2e1d9ed87e311841263dfcb",
|
"url": "https://api.github.com/repos/laravel/framework/zipball/c7599dc92e04532824bafbd226c2936ce6a905b8",
|
||||||
"reference": "6f89a2b74b232d8bf2e1d9ed87e311841263dfcb",
|
"reference": "c7599dc92e04532824bafbd226c2936ce6a905b8",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -2553,7 +2553,7 @@
|
||||||
"issues": "https://github.com/laravel/framework/issues",
|
"issues": "https://github.com/laravel/framework/issues",
|
||||||
"source": "https://github.com/laravel/framework"
|
"source": "https://github.com/laravel/framework"
|
||||||
},
|
},
|
||||||
"time": "2023-06-28T14:25:16+00:00"
|
"time": "2023-07-11T13:43:52+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/helpers",
|
"name": "laravel/helpers",
|
||||||
|
@ -2613,16 +2613,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/horizon",
|
"name": "laravel/horizon",
|
||||||
"version": "v5.17.0",
|
"version": "v5.18.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/horizon.git",
|
"url": "https://github.com/laravel/horizon.git",
|
||||||
"reference": "569c7154033679a1ca05b43bfa640cc60aa3b37b"
|
"reference": "b14498a09af826035e46ae8d6b013d0ec849bdb7"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/horizon/zipball/569c7154033679a1ca05b43bfa640cc60aa3b37b",
|
"url": "https://api.github.com/repos/laravel/horizon/zipball/b14498a09af826035e46ae8d6b013d0ec849bdb7",
|
||||||
"reference": "569c7154033679a1ca05b43bfa640cc60aa3b37b",
|
"reference": "b14498a09af826035e46ae8d6b013d0ec849bdb7",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -2685,9 +2685,9 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/laravel/horizon/issues",
|
"issues": "https://github.com/laravel/horizon/issues",
|
||||||
"source": "https://github.com/laravel/horizon/tree/v5.17.0"
|
"source": "https://github.com/laravel/horizon/tree/v5.18.0"
|
||||||
},
|
},
|
||||||
"time": "2023-06-13T20:49:30+00:00"
|
"time": "2023-06-30T15:11:51+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/passport",
|
"name": "laravel/passport",
|
||||||
|
@ -6651,23 +6651,24 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "react/promise",
|
"name": "react/promise",
|
||||||
"version": "v2.10.0",
|
"version": "v3.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/reactphp/promise.git",
|
"url": "https://github.com/reactphp/promise.git",
|
||||||
"reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38"
|
"reference": "c86753c76fd3be465d93b308f18d189f01a22be4"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38",
|
"url": "https://api.github.com/repos/reactphp/promise/zipball/c86753c76fd3be465d93b308f18d189f01a22be4",
|
||||||
"reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38",
|
"reference": "c86753c76fd3be465d93b308f18d189f01a22be4",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.4.0"
|
"php": ">=7.1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36"
|
"phpstan/phpstan": "1.10.20 || 1.4.10",
|
||||||
|
"phpunit/phpunit": "^9.5 || ^7.5"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
|
@ -6711,7 +6712,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/reactphp/promise/issues",
|
"issues": "https://github.com/reactphp/promise/issues",
|
||||||
"source": "https://github.com/reactphp/promise/tree/v2.10.0"
|
"source": "https://github.com/reactphp/promise/tree/v3.0.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -6719,7 +6720,7 @@
|
||||||
"type": "open_collective"
|
"type": "open_collective"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-05-02T15:15:43+00:00"
|
"time": "2023-07-11T16:12:49+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "react/socket",
|
"name": "react/socket",
|
||||||
|
@ -10920,16 +10921,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "filp/whoops",
|
"name": "filp/whoops",
|
||||||
"version": "2.15.2",
|
"version": "2.15.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/filp/whoops.git",
|
"url": "https://github.com/filp/whoops.git",
|
||||||
"reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73"
|
"reference": "c83e88a30524f9360b11f585f71e6b17313b7187"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/filp/whoops/zipball/aac9304c5ed61bf7b1b7a6064bf9806ab842ce73",
|
"url": "https://api.github.com/repos/filp/whoops/zipball/c83e88a30524f9360b11f585f71e6b17313b7187",
|
||||||
"reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73",
|
"reference": "c83e88a30524f9360b11f585f71e6b17313b7187",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -10979,7 +10980,7 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/filp/whoops/issues",
|
"issues": "https://github.com/filp/whoops/issues",
|
||||||
"source": "https://github.com/filp/whoops/tree/2.15.2"
|
"source": "https://github.com/filp/whoops/tree/2.15.3"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
@ -10987,7 +10988,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-04-12T12:00:00+00:00"
|
"time": "2023-07-13T12:00:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "hamcrest/hamcrest-php",
|
"name": "hamcrest/hamcrest-php",
|
||||||
|
@ -11101,16 +11102,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel/telescope",
|
"name": "laravel/telescope",
|
||||||
"version": "v4.15.0",
|
"version": "v4.15.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/laravel/telescope.git",
|
"url": "https://github.com/laravel/telescope.git",
|
||||||
"reference": "572a19b4c9b09295848de9a2352737a756a0fb05"
|
"reference": "5d74ae4c9f269b756d7877ad1527770c59846e14"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/laravel/telescope/zipball/572a19b4c9b09295848de9a2352737a756a0fb05",
|
"url": "https://api.github.com/repos/laravel/telescope/zipball/5d74ae4c9f269b756d7877ad1527770c59846e14",
|
||||||
"reference": "572a19b4c9b09295848de9a2352737a756a0fb05",
|
"reference": "5d74ae4c9f269b756d7877ad1527770c59846e14",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
@ -11166,9 +11167,9 @@
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/laravel/telescope/issues",
|
"issues": "https://github.com/laravel/telescope/issues",
|
||||||
"source": "https://github.com/laravel/telescope/tree/v4.15.0"
|
"source": "https://github.com/laravel/telescope/tree/v4.15.2"
|
||||||
},
|
},
|
||||||
"time": "2023-06-08T13:57:22+00:00"
|
"time": "2023-07-13T20:06:27+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mockery/mockery",
|
"name": "mockery/mockery",
|
||||||
|
|
|
@ -2,56 +2,59 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| ActivityPub
|
| ActivityPub
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| ActivityPub configuration
|
| ActivityPub configuration
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'activitypub' => [
|
'activitypub' => [
|
||||||
'enabled' => env('ACTIVITY_PUB', false),
|
'enabled' => env('ACTIVITY_PUB', false),
|
||||||
'outbox' => env('AP_OUTBOX', true),
|
'outbox' => env('AP_OUTBOX', true),
|
||||||
'inbox' => env('AP_INBOX', true),
|
'inbox' => env('AP_INBOX', true),
|
||||||
'sharedInbox' => env('AP_SHAREDINBOX', true),
|
'sharedInbox' => env('AP_SHAREDINBOX', true),
|
||||||
|
|
||||||
'remoteFollow' => env('AP_REMOTE_FOLLOW', true),
|
'remoteFollow' => env('AP_REMOTE_FOLLOW', true),
|
||||||
|
|
||||||
'delivery' => [
|
'delivery' => [
|
||||||
'timeout' => env('ACTIVITYPUB_DELIVERY_TIMEOUT', 30.0),
|
'timeout' => env('ACTIVITYPUB_DELIVERY_TIMEOUT', 30.0),
|
||||||
'concurrency' => env('ACTIVITYPUB_DELIVERY_CONCURRENCY', 10),
|
'concurrency' => env('ACTIVITYPUB_DELIVERY_CONCURRENCY', 10),
|
||||||
'logger' => [
|
'logger' => [
|
||||||
'enabled' => env('AP_LOGGER_ENABLED', false),
|
'enabled' => env('AP_LOGGER_ENABLED', false),
|
||||||
'driver' => 'log'
|
'driver' => 'log'
|
||||||
]
|
]
|
||||||
]
|
],
|
||||||
],
|
|
||||||
|
|
||||||
'atom' => [
|
'ingest' => [
|
||||||
'enabled' => env('ATOM_FEEDS', true),
|
'store_notes_without_followers' => env('AP_INGEST_STORE_NOTES_WITHOUT_FOLLOWERS', false),
|
||||||
],
|
],
|
||||||
|
],
|
||||||
|
|
||||||
'avatars' => [
|
'atom' => [
|
||||||
'store_local' => env('REMOTE_AVATARS', true),
|
'enabled' => env('ATOM_FEEDS', true),
|
||||||
],
|
],
|
||||||
|
|
||||||
'nodeinfo' => [
|
'avatars' => [
|
||||||
'enabled' => env('NODEINFO', true),
|
'store_local' => env('REMOTE_AVATARS', true),
|
||||||
],
|
],
|
||||||
|
|
||||||
'webfinger' => [
|
'nodeinfo' => [
|
||||||
'enabled' => env('WEBFINGER', true)
|
'enabled' => env('NODEINFO', true),
|
||||||
],
|
],
|
||||||
|
|
||||||
'network_timeline' => env('PF_NETWORK_TIMELINE', true),
|
'webfinger' => [
|
||||||
'network_timeline_days_falloff' => env('PF_NETWORK_TIMELINE_DAYS_FALLOFF', 2),
|
'enabled' => env('WEBFINGER', true)
|
||||||
|
],
|
||||||
|
|
||||||
'custom_emoji' => [
|
'network_timeline' => env('PF_NETWORK_TIMELINE', true),
|
||||||
'enabled' => env('CUSTOM_EMOJI', false),
|
'network_timeline_days_falloff' => env('PF_NETWORK_TIMELINE_DAYS_FALLOFF', 2),
|
||||||
|
|
||||||
// max size in bytes, default is 2mb
|
'custom_emoji' => [
|
||||||
'max_size' => env('CUSTOM_EMOJI_MAX_SIZE', 2000000),
|
'enabled' => env('CUSTOM_EMOJI', false),
|
||||||
]
|
|
||||||
|
|
||||||
|
// max size in bytes, default is 2mb
|
||||||
|
'max_size' => env('CUSTOM_EMOJI_MAX_SIZE', 2000000),
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('followers', function (Blueprint $table) {
|
||||||
|
$table->boolean('show_reblogs')->default(true)->index()->after('local_following');
|
||||||
|
$table->boolean('notify')->default(false)->index()->after('show_reblogs');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('followers', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('show_reblogs');
|
||||||
|
$table->dropColumn('notify');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in a new issue