1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Images: Updated local disk to have open dir perms

Closes #5605
This commit is contained in:
Dan Brown
2025-05-14 18:15:20 +01:00
parent 3e99ce4098
commit 5ab31a8191
3 changed files with 33 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ return [
'root' => public_path(),
'serve' => false,
'throw' => true,
'directory_visibility' => 'public',
],
'local_secure_attachments' => [

View File

@@ -7,6 +7,7 @@ use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Filesystem\FilesystemAdapter;
use Illuminate\Support\Facades\Log;
use League\Flysystem\UnableToSetVisibility;
use League\Flysystem\Visibility;
use Symfony\Component\HttpFoundation\StreamedResponse;
class ImageStorageDisk
@@ -85,7 +86,7 @@ class ImageStorageDisk
// require different ACLs for S3, and this provides us more logical control.
if ($makePublic && !$this->isS3Like()) {
try {
$this->filesystem->setVisibility($path, 'public');
$this->filesystem->setVisibility($path, Visibility::PUBLIC);
} catch (UnableToSetVisibility $e) {
Log::warning("Unable to set visibility for image upload with relative path: {$path}");
}