Skip to content

A self-hosted media server and file management system

fix: manifest is not loaded by browser since it isnt public

aminnausin62f6263f76c4
diff --git a/.dockerignore b/.dockerignore
index 04589269..a8b67c39 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -4,6 +4,7 @@
public/build
public/hot
public/storage
+public/manifest.json
storage/*.key
storage/pail
storage/app
@@ -36,5 +37,6 @@ Dockerfile
docker-compose.yml
setup.*
+
!storage/app/public/avatars/default.jpg
!storage/app/public/thumbnails/default.webp
diff --git a/.gitignore b/.gitignore
index 3c29c689..aa612a05 100755
--- a/.gitignore
+++ b/.gitignore
@@ -40,3 +40,4 @@ install.sh
/coverage
/database/schema
/database/dump
+public/manifest.json
diff --git a/app/Console/Commands/GenerateManifest.php b/app/Console/Commands/GenerateManifest.php
index 03272fe7..acf6239b 100644
--- a/app/Console/Commands/GenerateManifest.php
+++ b/app/Console/Commands/GenerateManifest.php
@@ -24,7 +24,7 @@ class GenerateManifest extends Command {
'cpu_cores' => shell_exec('nproc') ?: 'unknown',
], JSON_PRETTY_PRINT);
- File::put(storage_path('app/manifest.json'), $data);
+ File::put(public_path('manifest.json'), $data);
$this->info("App manifest generated: $version ($commit)");
}
diff --git a/app/Support/AppManifest.php b/app/Support/AppManifest.php
index 4ec06ab4..6458fb48 100644
--- a/app/Support/AppManifest.php
+++ b/app/Support/AppManifest.php
@@ -7,7 +7,7 @@ use Illuminate\Support\Facades\File;
class AppManifest {
public static function info(): array {
- $path = storage_path('app/manifest.json');
+ $path = public_path('manifest.json');
if (! File::exists($path)) {
Artisan::call('app:manifest');
diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php
index a3d4d173..5a71578b 100755
--- a/resources/views/layouts/app.blade.php
+++ b/resources/views/layouts/app.blade.php
@@ -24,6 +24,7 @@
window.addEventListener('resize', setVhUnit)
</script>
+ <link rel="manifest" href="/manifest.json">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
diff --git a/routes/web.php b/routes/web.php
index fdfb366a..eb88c8f7 100755
--- a/routes/web.php
+++ b/routes/web.php
@@ -54,6 +54,18 @@ Route::middleware('web')->group(function () {
abort(403);
});
+ Route::get('/manifest.json', function () {
+ $path = public_path('manifest.json');
+
+ if (! file_exists($path)) {
+ abort(404);
+ }
+
+ return response()->file($path, [
+ 'Content-Type' => 'application/json',
+ ]);
+ });
+
// Root directory
Route::get('/', function () {
if (Auth::user()) {