mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-28 07:43:18 +00:00
🔒 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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user