Merge pull request #3791 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-11-17 23:32:21 -07:00 committed by GitHub
commit 5613f6e84f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 68 additions and 43 deletions

View file

@ -19,6 +19,11 @@
- Update ApiV1Controller, fix followAccountById with firstOrCreate() ([1d52ad0b](https://github.com/pixelfed/pixelfed/commit/1d52ad0b)) - Update ApiV1Controller, fix followAccountById with firstOrCreate() ([1d52ad0b](https://github.com/pixelfed/pixelfed/commit/1d52ad0b))
- Update AccountService, fix delete status ([8b7121f9](https://github.com/pixelfed/pixelfed/commit/8b7121f9)) - Update AccountService, fix delete status ([8b7121f9](https://github.com/pixelfed/pixelfed/commit/8b7121f9))
- Update ap helpers, fix duplicate entry bug ([85cfa1ba](https://github.com/pixelfed/pixelfed/commit/85cfa1ba)) - Update ap helpers, fix duplicate entry bug ([85cfa1ba](https://github.com/pixelfed/pixelfed/commit/85cfa1ba))
- Update Inbox, fix handleUndoActivity ([d660e46b](https://github.com/pixelfed/pixelfed/commit/d660e46b))
- Update HomeSettings controller, bail earlier when attempting to update email that already exists ([399bf5f8](https://github.com/pixelfed/pixelfed/commit/399bf5f8))
- Update ProfileController, cache actor object and atom feed ([8665eab1](https://github.com/pixelfed/pixelfed/commit/8665eab1))
- Update NotificationTransformer, fix mediaTag and modLog types ([b6c06c4b](https://github.com/pixelfed/pixelfed/commit/b6c06c4b))
- Update landing view, add `app.name` and `app.short_description` for better customizability ([bda9d16b](https://github.com/pixelfed/pixelfed/commit/bda9d16b))
- ([](https://github.com/pixelfed/pixelfed/commit/)) - ([](https://github.com/pixelfed/pixelfed/commit/))
## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4) ## [v0.11.4 (2022-10-04)](https://github.com/pixelfed/pixelfed/compare/v0.11.3...v0.11.4)

View file

@ -187,10 +187,12 @@ class ProfileController extends Controller
abort_if(!config_cache('federation.activitypub.enabled'), 404); abort_if(!config_cache('federation.activitypub.enabled'), 404);
abort_if($user->domain, 404); abort_if($user->domain, 404);
return Cache::remember('pf:activitypub:user-object:by-id:' . $user->id, 3600, function() use($user) {
$fractal = new Fractal\Manager(); $fractal = new Fractal\Manager();
$resource = new Fractal\Resource\Item($user, new ProfileTransformer); $resource = new Fractal\Resource\Item($user, new ProfileTransformer);
$res = $fractal->createData($resource)->toArray(); $res = $fractal->createData($resource)->toArray();
return response(json_encode($res['data']))->header('Content-Type', 'application/activity+json'); return response(json_encode($res['data']))->header('Content-Type', 'application/activity+json');
});
} }
public function showAtomFeed(Request $request, $user) public function showAtomFeed(Request $request, $user)
@ -201,10 +203,11 @@ class ProfileController extends Controller
abort_if(!$pid, 404); abort_if(!$pid, 404);
$profile = AccountService::get($pid); $profile = AccountService::get($pid, true);
abort_if(!$profile || $profile['locked'] || !$profile['local'], 404); abort_if(!$profile || $profile['locked'] || !$profile['local'], 404);
$data = Cache::remember('pf:atom:user-feed:by-id:' . $profile['id'], 86400, function() use($pid, $profile) {
$items = DB::table('statuses') $items = DB::table('statuses')
->whereProfileId($pid) ->whereProfileId($pid)
->whereVisibility('public') ->whereVisibility('public')
@ -228,9 +231,19 @@ class ProfileController extends Controller
if($items && $items->count()) { if($items && $items->count()) {
$headers['Last-Modified'] = now()->parse($items->first()['created_at'])->toRfc7231String(); $headers['Last-Modified'] = now()->parse($items->first()['created_at'])->toRfc7231String();
} }
return compact('items', 'permalink', 'headers');
});
abort_if(!$data, 404);
return response() return response()
->view('atom.user', compact('profile', 'items', 'permalink')) ->view('atom.user',
->withHeaders($headers); [
'profile' => $profile,
'items' => $data['items'],
'permalink' => $data['permalink']
]
)
->withHeaders($data['headers']);
} }
public function meRedirect() public function meRedirect()

View file

@ -159,7 +159,7 @@ trait HomeSettings
public function emailUpdate(Request $request) public function emailUpdate(Request $request)
{ {
$this->validate($request, [ $this->validate($request, [
'email' => 'required|email', 'email' => 'required|email|unique:users,email',
]); ]);
$changes = false; $changes = false;
$email = $request->input('email'); $email = $request->input('email');

View file

@ -32,19 +32,23 @@ class NotificationTransformer extends Fractal\TransformerAbstract
if($n->item_id && $n->item_type == 'App\ModLog') { if($n->item_id && $n->item_type == 'App\ModLog') {
$ml = $n->item; $ml = $n->item;
if($ml && $ml->object_uid) {
$res['modlog'] = [ $res['modlog'] = [
'id' => $ml->object_uid, 'id' => $ml->object_uid,
'url' => url('/i/admin/users/modlogs/' . $ml->object_uid) 'url' => url('/i/admin/users/modlogs/' . $ml->object_uid)
]; ];
} }
}
if($n->item_id && $n->item_type == 'App\MediaTag') { if($n->item_id && $n->item_type == 'App\MediaTag') {
$ml = $n->item; $ml = $n->item;
if($ml && $ml->tagged_username) {
$res['tagged'] = [ $res['tagged'] = [
'username' => $ml->tagged_username, 'username' => $ml->tagged_username,
'post_url' => '/p/'.HashidService::encode($ml->status_id) 'post_url' => '/p/'.HashidService::encode($ml->status_id)
]; ];
} }
}
return $res; return $res;
} }

View file

@ -13,9 +13,9 @@ return [
'timeout' => 3600, 'timeout' => 3600,
'enable_logging' => env('FFMPEG_LOG', false), 'log_channel' => env('FFMPEG_LOG_CHANNEL', false), // set to false to completely disable logging
'set_command_and_error_output_on_exception' => false,
'temporary_files_root' => env('FFMPEG_TEMPORARY_FILES_ROOT', sys_get_temp_dir()), 'temporary_files_root' => env('FFMPEG_TEMPORARY_FILES_ROOT', sys_get_temp_dir()),
'temporary_files_encrypted_hls' => env('FFMPEG_TEMPORARY_ENCRYPTED_HLS', env('FFMPEG_TEMPORARY_FILES_ROOT', sys_get_temp_dir())),
]; ];

View file

@ -53,15 +53,18 @@
<p class="display-2 font-weight-bold">Photo Sharing</p> <p class="display-2 font-weight-bold">Photo Sharing</p>
<p class="h1 font-weight-bold">For Everyone.</p> <p class="h1 font-weight-bold">For Everyone.</p>
</div> </div>
<p class="lead font-weight-light mt-5">{{ config_cache('app.short_description') ?? 'Pixelfed is an image sharing platform, an ethical alternative to centralized platforms.' }}</p>
<p><a href="https://pixelfed.org" target="_blank" class="font-weight-bold">Learn more</a></p>
</div> </div>
<div class="col-12 col-md-5 offset-md-1"> <div class="col-12 col-md-5 offset-md-1">
<div> <div>
<div class="pt-md-3 d-flex justify-content-center align-items-center"> <div class="pt-md-3 d-flex justify-content-center align-items-center">
<img src="/img/pixelfed-icon-color.svg" loading="lazy" width="50px" height="50px"> <img src="/img/pixelfed-icon-color.svg" loading="lazy" width="50px" height="50px">
<span class="font-weight-bold h3 ml-2 pt-2">Pixelfed</span> <span class="font-weight-bold h3 ml-2 pt-2">{{ config_cache('app.name') ?? 'Pixelfed' }}</span>
</div> </div>
<div class="d-block d-md-none"> <div class="d-block d-md-none">
<p class="font-weight-bold mb-0 text-center">Photo Sharing. For Everyone</p> <p class="font-weight-light mt-3 mb-5 text-center px-5">{{ config_cache('app.short_description') ?? 'Pixelfed is an image sharing platform, an ethical alternative to centralized platforms.' }}</p>
</div> </div>
<div class="card my-4 shadow-none border"> <div class="card my-4 shadow-none border">
<div class="card-body px-lg-5"> <div class="card-body px-lg-5">