Repository navigation
fix: switch the filesystem disk to s3 when RustFS is wired - #98
Merged
Merged
Conversation
Adding RustFS to a Laravel site wired the AWS keys but left FILESYSTEM_DISK on local, so uploads kept landing on the local disk and the bucket sat unused. Laravel's rustfs mapping now writes the disk key as well, FILESYSTEM_DISK on 9 and later and FILESYSTEM_DRIVER on 6 to 8, which is the key those versions read, and the detect rule on 6 to 8 follows the same key. Statamic, Winter and Lumen run on Laravel and read the same AWS keys, but they had no rustfs mapping and only got the preset's keys through the fallback. They now map it the same way, with the disk key matching the Laravel version each one runs on. Statamic 3 spans Laravel 6 to 10, so it writes both keys.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Picking RustFS for a Laravel site, from setup or from the suggested service card on the dashboard, wired the AWS keys into .env but left FILESYSTEM_DISK on local. The app kept writing to the local disk and the bucket lerd had just created stayed empty. The preset does carry FILESYSTEM_DISK=s3, but a framework that maps a service gets only its own vars, and Laravel's mapping never listed the disk.
Laravel's rustfs mapping now writes the disk key too. Laravel 9 and later read FILESYSTEM_DISK, 6 to 8 read FILESYSTEM_DRIVER, so each version gets the key it actually reads, and the detect rule on 6 to 8 now looks at that key as well.
Statamic, Winter and Lumen run on Laravel and read the same AWS keys, yet they had no rustfs mapping at all and only got the preset's keys through the fallback. They now map it the same way, with the disk key matched to the Laravel version underneath. Statamic 3 spans Laravel 6 to 10, so it writes both keys. Winter 1.1 hardcodes the local disk, so only 1.2 actually switches.
Symfony stays as it is. S3 there goes through a bundle whose env names the app chooses, so there is no standard key to map.