Skip to content

Commit

Permalink
Exit with error for unsupported S3 backend (#2856)
Browse files Browse the repository at this point in the history
The `lychee:generate_thumbs` command does not support the S3 backend.
This commit outputs an error message and exits the tool when the command
is invoked with such a backend, avoiding incorrect behaviour such as
writing images to the filesystem.
  • Loading branch information
kiancross authored Dec 28, 2024
1 parent 2b74431 commit 2ba3dbd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/Console/Commands/ImageProcessing/GenerateThumbs.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Console\Commands\ImageProcessing;

use App\Assets\Features;
use App\Contracts\Exceptions\ExternalLycheeException;
use App\Contracts\Exceptions\LycheeException;
use App\Contracts\Models\SizeVariantFactory;
Expand Down Expand Up @@ -60,6 +61,13 @@ public function handle(): int

return 1;
}

if (Features::active('use-s3')) {
$this->error('This tool does not support S3 file storage.');

return 1;
}

$sizeVariantType = self::SIZE_VARIANTS[$sizeVariantName];

$amount = (int) $this->argument('amount');
Expand Down

0 comments on commit 2ba3dbd

Please sign in to comment.