From 302d902f755fb14af3175ed154bab25d0664aab5 Mon Sep 17 00:00:00 2001 From: Paulo Castellano Date: Fri, 24 Jul 2026 21:33:39 -0300 Subject: [PATCH] Move signed upload URL TTL into config/trypost.php. Keep API media upload settings out of the Laravel AI package config so they are not overwritten on package updates. Co-authored-by: Cursor --- app/Mcp/Tools/Post/RequestMediaUploadTool.php | 2 +- config/ai.php | 17 ----------------- config/trypost.php | 4 ++++ 3 files changed, 5 insertions(+), 18 deletions(-) diff --git a/app/Mcp/Tools/Post/RequestMediaUploadTool.php b/app/Mcp/Tools/Post/RequestMediaUploadTool.php index 1352458e..2f1e4b9c 100644 --- a/app/Mcp/Tools/Post/RequestMediaUploadTool.php +++ b/app/Mcp/Tools/Post/RequestMediaUploadTool.php @@ -25,7 +25,7 @@ public function handle(Request $request): Response|ResponseFactory // Same ceiling the web/API FormRequests use (largest per-type cap). $maxBytes = MediaType::Video->maxSizeInBytes(); - $ttlMinutes = (int) config('ai.mcp.upload.url_ttl_minutes'); + $ttlMinutes = (int) config('trypost.media.signed_upload_url_ttl_minutes'); $token = (string) Str::uuid(); $expiresAt = CarbonImmutable::now()->addMinutes($ttlMinutes); diff --git a/config/ai.php b/config/ai.php index 228d6fc9..1a393ff0 100644 --- a/config/ai.php +++ b/config/ai.php @@ -39,23 +39,6 @@ ], ], - /* - |-------------------------------------------------------------------------- - | MCP Media Upload - |-------------------------------------------------------------------------- - | - | Settings for the MCP signed-URL upload flow. Size caps come from - | config('trypost.media.max_size_mb') via Media\Type — same source as - | web and REST API uploads. - | - */ - - 'mcp' => [ - 'upload' => [ - 'url_ttl_minutes' => (int) env('MCP_UPLOAD_URL_TTL_MINUTES', 15), - ], - ], - /* |-------------------------------------------------------------------------- | AI Providers diff --git a/config/trypost.php b/config/trypost.php index 96749e8a..3196567e 100644 --- a/config/trypost.php +++ b/config/trypost.php @@ -56,6 +56,9 @@ | uploads (StoreAssetRequest, AssetController::storeChunked), URL | fetches (MediaAttacher), and the MediaType enum all read from here. | + | signed_upload_url_ttl_minutes controls the temporary signed POST URL + | issued for api.uploads.store (MCP / direct upload flow). + | */ 'media' => [ @@ -65,6 +68,7 @@ // LinkedIn caps document (PDF carousel) uploads at 100MB. 'document' => (int) env('MEDIA_DOCUMENT_MAX_SIZE_MB', 100), ], + 'signed_upload_url_ttl_minutes' => (int) env('MEDIA_SIGNED_UPLOAD_URL_TTL_MINUTES', 15), ], /*