🔒 Implement signed media URLs and migrate media storage to private disk

-  Introduce `getSignedMediaUrl` in models for temporary signed URLs
- 🗂️ Migrate media collections to private disk for added security
- 🔧 Add `media:move-to-private` command to streamline migration
- ⚙️ Update views and components to use signed media URLs
- ✏️ Adjust route `media.signed` for signed file access handling
This commit is contained in:
HolgerHatGarKeineNode
2026-01-25 19:14:49 +01:00
parent fe2f321a12
commit 10dac9d02b
11 changed files with 335 additions and 5 deletions

View File

@@ -13,6 +13,15 @@ Route::get('dl/{media}', function (Media $media, Request $request) {
->name('dl')
->middleware('signed');
Route::get('media/{media}', function (Media $media, Request $request) {
return response()->file($media->getPath(), [
'Content-Type' => $media->mime_type,
'Cache-Control' => 'private, max-age=3600',
]);
})
->name('media.signed')
->middleware('signed');
Route::post('logout', function () {
\App\Support\NostrAuth::logout();
Session::flush();