From 3eed68a9c366510eeea37d9eac54757d44f21182 Mon Sep 17 00:00:00 2001 From: Vincent BRIDIER Date: Fri, 5 Sep 2025 10:03:55 +0200 Subject: [PATCH] feat: Update download url signature for k8s env - Close #33 --- app/Http/Controllers/API/SyncController.php | 5 +++-- routes/web-bo.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/API/SyncController.php b/app/Http/Controllers/API/SyncController.php index 5ea448b..657353f 100644 --- a/app/Http/Controllers/API/SyncController.php +++ b/app/Http/Controllers/API/SyncController.php @@ -182,10 +182,11 @@ class SyncController extends Controller $exists = Storage::disk('public') ->exists(sprintf('docs/%s/%s.%s', \tenant()->getKey(), $doc['uuid'], $doc['type'])); if ($exists) { - array_push($attach, URL::temporarySignedRoute( + array_push($attach, config('app.url') . URL::temporarySignedRoute( 'docs.download', now()->addDays(30), - ['tenant' => \tenant()->getKey(), 'uuid' => $doc['uuid']] + ['tenant' => \tenant()->getKey(), 'uuid' => $doc['uuid']], + false )); array_push($filesName, $doc['title']); } else { diff --git a/routes/web-bo.php b/routes/web-bo.php index 95b09e9..c37a4ad 100644 --- a/routes/web-bo.php +++ b/routes/web-bo.php @@ -110,4 +110,4 @@ Route::middleware(['web', 'admin-secure'])->name('bo.')->group(function () { // Public files download. Route::get('/{tenant}/docs/{uuid}/download', [DocumentController::class, 'download']) ->name('docs.download') - ->middleware('signed'); + ->middleware('signed:relative');