mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-nostr.git
synced 2026-01-27 06:33:18 +00:00
- ✅ 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
52 lines
2.2 KiB
PHP
52 lines
2.2 KiB
PHP
<?php
|
|
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Route;
|
|
use Illuminate\Support\Facades\Session;
|
|
use Spatie\MediaLibrary\MediaCollections\Models\Media;
|
|
|
|
Route::redirect('/', '/association/profile');
|
|
|
|
Route::get('dl/{media}', function (Media $media, Request $request) {
|
|
return response()->download($media->getPath(), $media->name);
|
|
})
|
|
->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();
|
|
|
|
return redirect('/');
|
|
})->name('logout');
|
|
|
|
// Association Routes
|
|
Route::livewire('/association/profile', 'association.profile')->name('association.profile');
|
|
Route::livewire('/association/benefits', 'association.benefits')->name('association.benefits');
|
|
|
|
Route::livewire('/association/election', 'association.election.index')->name('association.elections');
|
|
Route::livewire('/association/election/{election:year}', 'association.election.show')->name('association.election');
|
|
Route::livewire('/association/election/admin/{election:year}', 'association.election.admin')->name('association.election.admin');
|
|
|
|
Route::livewire('/association/members/admin', 'association.members.admin')->name('association.members.admin');
|
|
|
|
Route::livewire('/association/news', 'association.news')->name('association.news');
|
|
|
|
Route::livewire('/association/project-support', 'association.project-support.index')->name('association.projectSupport');
|
|
Route::livewire('/association/project-support/create', 'association.project-support.form.create')->name('association.projectSupport.create');
|
|
Route::livewire('/association/project-support/{projectProposal:slug}', 'association.project-support.show')->name('association.projectSupport.item');
|
|
Route::livewire('/association/project-support/edit/{projectProposal:slug}', 'association.project-support.form.edit')->name('association.projectSupport.edit');
|
|
|
|
// Other pages
|
|
Route::livewire('/changelog', 'changelog')->name('changelog');
|
|
Route::livewire('/welcome', 'welcome')->name('welcome');
|