Skip to content

A self-hosted media server and file management system

fix: public disk file permission issue with browsershot

aminnausin64532e1b90d4
diff --git a/app/Services/PreviewGeneratorService.php b/app/Services/PreviewGeneratorService.php
index 2ecbd3b9..cc298447 100644
--- a/app/Services/PreviewGeneratorService.php
+++ b/app/Services/PreviewGeneratorService.php
@@ -181,10 +181,7 @@ class PreviewGeneratorService {
'CHROME_CONFIG_HOME' => storage_path('app/chrome/.config'),
]);
- if (! $this->getPuppeteerChromiumPath()) {
- $browsershot = $this->setChromiumBinary($browsershot);
- }
-
+ $browsershot = $this->setChromiumBinary($browsershot);
$browsershot->save($tempPath);
$imageContents = file_get_contents($tempPath);
@@ -285,6 +282,8 @@ class PreviewGeneratorService {
$browsershot->setChromePath('/usr/bin/chromium');
} elseif ($this->canUseDocker()) {
$browsershot->useDocker();
+ } elseif ($this->getPuppeteerChromiumPath()) {
+ return $browsershot;
} else {
throw new ChromiumException('No Chromium or Docker available for Browsershot.');
}
diff --git a/config/filesystems.php b/config/filesystems.php
index cf2c5c89..5f4399b8 100755
--- a/config/filesystems.php
+++ b/config/filesystems.php
@@ -35,6 +35,16 @@ return [
'root' => storage_path('app/private'),
'serve' => true,
'throw' => false,
+ 'permissions' => [
+ 'file' => [
+ 'public' => 0775,
+ 'private' => 0600,
+ ],
+ 'dir' => [
+ 'public' => 0775,
+ 'private' => 0700,
+ ],
+ ],
],
'public' => [
@@ -43,6 +53,16 @@ return [
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
'throw' => false,
+ 'permissions' => [
+ 'file' => [
+ 'public' => 0775,
+ 'private' => 0600,
+ ],
+ 'dir' => [
+ 'public' => 0775,
+ 'private' => 0700,
+ ],
+ ],
],
's3' => [