Merge pull request #6962 from pixelfed/fix/emoji-cloud-url-and-guard

fix: emoji admin URLs and cloud-migration guard
pull/6963/head
Shlee 4 weeks ago committed by GitHub
commit 6e73fd4877
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -36,7 +36,12 @@ class EmojiMoveStorageLocalToCloud extends Command
public function handle(): int
{
if (! (bool) config_cache('pixelfed.cloud_storage')) {
// Consider cloud enabled if either the live config or the (possibly
// 12h-cached) config_cache value says so, so a stale cache can't make
// this silently no-op right after cloud is turned on.
$cloudEnabled = (bool) config('pixelfed.cloud_storage') || (bool) config_cache('pixelfed.cloud_storage');
if (! $cloudEnabled) {
$this->error('Cloud storage is not enabled (pixelfed.cloud_storage is false).');
return self::FAILURE;

@ -15,7 +15,11 @@ return new class extends Migration
*/
public function up(): void
{
if (! (bool) config_cache('pixelfed.cloud_storage')) {
// Consider cloud enabled if either the live config or the (possibly
// cached) config_cache value says so; the command guards again anyway.
$cloudEnabled = (bool) config('pixelfed.cloud_storage') || (bool) config_cache('pixelfed.cloud_storage');
if (! $cloudEnabled) {
return;
}

@ -28,7 +28,7 @@
<div class="list-group">
<div class="list-group-item">
<div class="media align-items-center">
<img src="{{url('storage/' . $emoji->media_path)}}" width="40" height="40" class="mr-3">
<img src="{{ $emoji->url() }}" width="40" height="40" class="mr-3">
<div class="media-body">
<p class="font-weight-bold mb-0">{{ $emoji->shortcode }}</p>
@ -62,7 +62,7 @@
@foreach($emojis as $emoji)
<div class="list-group-item">
<div class="media align-items-center">
<img src="{{url('storage/' . $emoji->media_path)}}" width="40" height="40" class="mr-3">
<img src="{{ $emoji->url() }}" width="40" height="40" class="mr-3">
<div class="media-body">
<p class="font-weight-bold mb-0">{{ $emoji->shortcode }}</p>

@ -105,7 +105,7 @@
@foreach($emojis as $emoji)
<div class="list-group-item">
<div class="media align-items-center">
<img src="{{url('storage/' . $emoji->media_path)}}" width="40" height="40" class="mr-3">
<img src="{{ $emoji->url() }}" width="40" height="40" class="mr-3">
<div class="media-body">
<p class="font-weight-bold mb-0">{{ $emoji->shortcode }}</p>

Loading…
Cancel
Save