Merge pull request #3360 from pixelfed/staging

Staging
This commit is contained in:
daniel 2022-04-05 22:22:36 -06:00 committed by GitHub
commit d90379c15f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 19 additions and 43 deletions

View file

@ -237,6 +237,9 @@ class CollectionController extends Controller
return Collection::whereProfileId($profile->id) return Collection::whereProfileId($profile->id)
->whereIn('visibility', $visibility) ->whereIn('visibility', $visibility)
->when(!$owner, function($q, $owner) {
return $q->whereNotNull('published_at');
})
->orderByDesc('id') ->orderByDesc('id')
->paginate(9) ->paginate(9)
->map(function($collection) { ->map(function($collection) {

View file

@ -81,9 +81,7 @@ class ProfileController extends Controller
'list' => $settings->show_profile_followers 'list' => $settings->show_profile_followers
] ]
]; ];
$ui = $request->has('ui') && $request->input('ui') == 'memory' ? 'profile.memory' : 'profile.show'; return view('profile.show', compact('profile', 'settings'));
return view($ui, compact('profile', 'settings'));
} else { } else {
$key = 'profile:settings:' . $user->id; $key = 'profile:settings:' . $user->id;
$ttl = now()->addHours(6); $ttl = now()->addHours(6);

View file

@ -213,6 +213,9 @@ class DeleteWorker implements ShouldQueue
'User-Agent' => 'PixelfedBot v0.1 - https://pixelfed.org', 'User-Agent' => 'PixelfedBot v0.1 - https://pixelfed.org',
])->get($actor->remote_url); ])->get($actor->remote_url);
$res = json_decode($res->body(), true, 8); $res = json_decode($res->body(), true, 8);
if(!isset($res['publicKey'], $res['publicKey']['id'])) {
return;
}
if($res['publicKey']['id'] !== $actor->key_id) { if($res['publicKey']['id'] !== $actor->key_id) {
return; return;
} }

View file

@ -7,10 +7,10 @@ use Illuminate\Support\Str;
class Config { class Config {
const CACHE_KEY = 'api:site:configuration:_v0.5'; const CACHE_KEY = 'api:site:configuration:_v0.6';
public static function get() { public static function get() {
return Cache::remember(self::CACHE_KEY, 86400, function() { return Cache::remember(self::CACHE_KEY, 900, function() {
return [ return [
'open_registration' => (bool) config_cache('pixelfed.open_registration'), 'open_registration' => (bool) config_cache('pixelfed.open_registration'),
'uploader' => [ 'uploader' => [
@ -51,12 +51,15 @@ class Config {
], ],
'features' => [ 'features' => [
'timelines' => [
'local' => true,
'network' => (bool) config('federation.network_timeline'),
],
'mobile_apis' => (bool) config_cache('pixelfed.oauth_enabled'), 'mobile_apis' => (bool) config_cache('pixelfed.oauth_enabled'),
'circles' => false,
'stories' => (bool) config_cache('instance.stories.enabled'), 'stories' => (bool) config_cache('instance.stories.enabled'),
'video' => Str::contains(config_cache('pixelfed.media_types'), 'video/mp4'), 'video' => Str::contains(config_cache('pixelfed.media_types'), 'video/mp4'),
'import' => [ 'import' => [
'instagram' => config_cache('pixelfed.import.instagram.enabled'), 'instagram' => (bool) config_cache('pixelfed.import.instagram.enabled'),
'mastodon' => false, 'mastodon' => false,
'pixelfed' => false 'pixelfed' => false
], ],

View file

@ -33,6 +33,8 @@ class Nodeinfo {
return Status::whereLocal(true)->count(); return Status::whereLocal(true)->count();
}); });
$features = [ 'features' => \App\Util\Site\Config::get()['features'] ];
return [ return [
'metadata' => [ 'metadata' => [
'nodeName' => config_cache('app.name'), 'nodeName' => config_cache('app.name'),
@ -40,7 +42,7 @@ class Nodeinfo {
'homepage' => 'https://pixelfed.org', 'homepage' => 'https://pixelfed.org',
'repo' => 'https://github.com/pixelfed/pixelfed', 'repo' => 'https://github.com/pixelfed/pixelfed',
], ],
'config' => \App\Util\Site\Config::get() 'config' => $features
], ],
'protocols' => [ 'protocols' => [
'activitypub', 'activitypub',

View file

@ -175,6 +175,7 @@ return [
'memory' => 128, 'memory' => 128,
'tries' => 3, 'tries' => 3,
'nice' => 0, 'nice' => 0,
'timeout' => 60
], ],
], ],
@ -187,6 +188,7 @@ return [
'memory' => 128, 'memory' => 128,
'tries' => 3, 'tries' => 3,
'nice' => 0, 'nice' => 0,
'timeout' => 60
], ],
], ],
], ],

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/js/profile.js vendored

Binary file not shown.

BIN
public/js/spa.js vendored

Binary file not shown.

Binary file not shown.

View file

@ -1,35 +0,0 @@
@extends('layouts.app',['title' => $profile->username . " on " . config('app.name')])
@section('content')
@if (session('error'))
<div class="alert alert-danger text-center font-weight-bold mb-0">
{{ session('error') }}
</div>
@endif
<memory-profile profile-id="{{$profile->id}}" profile-username="{{$profile->username}}" :profile-settings="{{json_encode($settings)}}" profile-layout="{{$profile->profile_layout ?? 'metro'}}"></memory-profile>
@if($profile->website)
<a class="d-none" href="{{$profile->website}}" rel="me">{{$profile->website}}</a>
@endif
<noscript>
<div class="container">
<p class="pt-5 text-center lead">Please enable javascript to view this content.</p>
</div>
</noscript>
@endsection
@push('meta')<meta property="og:description" content="{{$profile->bio}}">
@if(false == $settings['crawlable'] || $profile->remote_url)
<meta name="robots" content="noindex, nofollow">
@else <meta property="og:image" content="{{$profile->avatarUrl()}}">
<link href="{{$profile->permalink('.atom')}}" rel="alternate" title="{{$profile->username}} on Pixelfed" type="application/atom+xml">
<link href='{{$profile->permalink()}}' rel='alternate' type='application/activity+json'>
@endif
@endpush
@push('scripts')<script type="text/javascript" src="{{ mix('js/memoryprofile.js') }}"></script>
<script type="text/javascript" defer>App.boot();</script>
@endpush