awcodes / filament-curator

A media picker plugin for Filament Panels.
MIT License
298 stars 79 forks source link

Glide 403 signature exception #500

Closed jaymeh closed 1 week ago

jaymeh commented 2 weeks ago

Filament Version

v3.2.92

Plugin Version

v3.6.2

PHP Version

PHP 8.2.18

Problem description

When viewing the media library none of my thumbnails are being displayed and I have 404 error being shown in the Browser.

CleanShot 2024-06-23 at 16 10 49@2x

It seems that when debugging the show function of the media controller I am getting a 403 error back due to the signature from Glide being invalidated.

CleanShot 2024-06-23 at 16 14 06

Upon checking the request all function, it seems to return back an empty array even though I can see the correct details in the request URI.

CleanShot 2024-06-23 at 16 15 01

CleanShot 2024-06-23 at 16 15 27

I'm using the latest version of Laravel 11 as of right now (v11.11.1).

Expected behavior

When viewing the media library page, I'd expect to see the media library items being generated using Glide.

Steps to reproduce

Setup Laravel Project Using DDEV Install Laravel 11.11.1 Install Filament Panels and setup Setup new theme and follow instructions from guide Setup Curator with default settings, initialise plugin and add cropper etc to theme Upload a file, then visit the main screen to see an image 404'ing in the browser.

Reproduction repository

https://github.com/jaymeh/filament-curator

Relevant log output

No response

awcodes commented 1 week ago

My best guess here is a server misconfiguration. The requestUri looks correct to me.

jaymeh commented 1 week ago

ok, I've been using this environment for a few years and I've not seen issues like this before. I'll try to see if I can replicate this using Laravel Sail.

Thanks

awcodes commented 1 week ago

It could be that the server is trying to serve these directly as images instead of letting it run through the php controller. Some nginx server will serve static assets like this directly based on the file extension. Could be something to do with that.

xalabama commented 1 week ago

I also think it could be a problem with you nginx configuration.

There was already a discussion about that sounds like your problem: https://github.com/awcodes/filament-curator/discussions/333

You can try to add this location configuration inside your nginx config:

location ^~ /curator {
    try_files $uri $uri/ /index.php?$query_string;
}
jaymeh commented 1 week ago

These are really useful points. I was using NGINX with my local environment but switching to Apache has resolved the issue.

Thanks @awcodes @xalabama !