Repository navigation
Conversation
This was referenced Nov 6, 2026
timkelty
force-pushed
the
feature/craft-6-cloud-disks
branch
4 times, most recently
from
December 5, 2026 16:10
3e8415e to
c743473
Compare
Adds a craft-cloud disk driver (S3 on the project bucket with CDN URLs on Cloud, a local disk in public/uploads elsewhere), a default craft-cloud assets disk, bucket disks for upload session staging and temporary asset uploads on Cloud, and a cloud:disks command that prints disks for 3.x AssetsFs filesystems before upgrading. Amp-Thread-ID: https://ampcode.com/threads/T-79ed60c5-5654-4f30-8dbd-da4b0ecd4fb2 Co-authored-by: Amp <amp@ampcode.com>
Requires a core newer than 6.0.0-alpha.20, and locks 6.x at 8a13417, which has disk-owned asset transformers (craftcms/cms#20542). Packagist hadn't indexed that commit yet, so the lock was pointed at it by hand; core's composer.json is the same as at the indexed commit (cc77dd6). Also checks that Cloud disks share the credentials and endpoint Craft needs to copy staged uploads within S3. Amp-Thread-ID: https://ampcode.com/threads/T-79ed60c5-5654-4f30-8dbd-da4b0ecd4fb2 Co-authored-by: Amp <amp@ampcode.com>
Replaces the craft-cloud driver, its local fallback and subpath option, and
the cloud:disks command. On Craft Cloud, the provider sets the craft-cloud
disk's connection to the bucket's {env}/assets prefix and the CDN, keeping
the project's other options, and adds a craft-cloud-tmp disk in
{env}/storage/tmp for upload sessions and temporary asset uploads.
Elsewhere, the project defines craft-cloud itself, and upgraded filesystem
handles scope it.
Amp-Thread-ID: https://ampcode.com/threads/T-79ed60c5-5654-4f30-8dbd-da4b0ecd4fb2
Co-authored-by: Amp <amp@ampcode.com>
Brings back the craft-cloud driver, without its local fallback: it always builds an S3 disk on the project's bucket, and throws when resolved without the bucket variables, so it works off Cloud against a dev bucket or MinIO but never quietly becomes another disk. Subfolders use Laravel's own prefix option. Drops the default craft-cloud disk, and documents choosing a local disk per environment instead. Amp-Thread-ID: https://ampcode.com/threads/T-79ed60c5-5654-4f30-8dbd-da4b0ecd4fb2 Co-authored-by: Amp <amp@ampcode.com>
Moves Disks to CraftCms\Cloud and stages uploads behind the provider's Lambda check. Uses AssetsConfig's upload disk settings from craftcms/cms 6.0.0-beta.3, ports the tests to Testbench, and restores the README's disk docs. Adds league/flysystem-aws-s3-v3 to the baseline's dependencies. Amp-Thread-ID: https://ampcode.com/threads/T-79ed60c5-5654-4f30-8dbd-da4b0ecd4fb2
Defaults assets.trashDisk to a craft-cloud-trash disk in {env}/storage/trash
when the project leaves it null, so soft-deleted assets can be restored.
Amp-Thread-ID: https://ampcode.com/threads/T-79ed60c5-5654-4f30-8dbd-da4b0ecd4fb2
Drops assertions on Laravel's scoped disks, the SDK's credentials and credential filtering, and the trailing-slash trim Laravel already does on disk URLs. Amp-Thread-ID: https://ampcode.com/threads/T-79ed60c5-5654-4f30-8dbd-da4b0ecd4fb2
timkelty
force-pushed
the
feature/craft-6-cloud-disks
branch
from
December 6, 2026 01:15
c743473 to
a1f01cd
Compare
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.
Summary
Adds a
craft-cloudLaravel disk driver for the project's Craft Cloud bucket. On Craft Cloud (CRAFT_CLOUDset), it also puts upload sessions, temporary asset uploads and soft-deleted assets' files in the bucket.asset_transformerdefault. A disk that wants Cloud transforms sets'asset_transformer' => 'craft-cloud'itself.'{handle}' => ['driver' => 'craft-cloud', 'prefix' => '{old subpath}'].league/flysystem-aws-s3-v3. Core comes from the baseline (Rebuild the 5.x baseline for Craft 6 beta #215),craftcms/cms6.0.0-beta.3.PUTfrom control panel origins, exposeETag{env}/assetsand{env}/storage{env}/storage/tmp/only, not{env}/storage/trash/, which garbage collection cleansAWS_REGIONinstead ofCRAFT_CLOUD_REGIONAWS_*credentials instead ofCRAFT_CLOUD_ACCESS_*CRAFT_CLOUD_CDN_BASE_URLmax-age/visibilityobject metadata.Evidence
tests/Feature/DisksTest.phpon Testbench, against the baseline's provider and then this branch:5 failed, 2 passed.Storage::disk('images')throwsDriver [craft-cloud] is not supported., uploads stay on core's localcraft-tmp, and there's no trash disk.After:
composer cipasses: Pint, PHPStan, and13 passed (58 assertions).Not run on Craft Cloud itself yet.
Related issues
CRAFT_CLOUDdetection), Run Craft Cloud's functions as Bref does #220 (Cloud config defaults)Footnotes
Required:
CRAFT_CLOUD_PROJECT_ID,CRAFT_CLOUD_ENVIRONMENT_ID, andCRAFT_CLOUD_REGIONorAWS_REGION. Optional:CRAFT_CLOUD_ACCESS_KEY/_SECRET/_TOKEN(otherwise the SDK finds credentials, such as the function's role),CRAFT_CLOUD_STORAGE_ENDPOINT(path-style, for MinIO),CRAFT_CLOUD_CDN_BASE_URL. Empty values count as unset. ↩Core redefines
craft-tmpandcraft-asset-tempon boot, which is why this PR changes the settings instead of those disks. Without a trash disk, soft-deleting an asset deletes its file. Project config YAML writes are turned off on Cloud by Run Craft Cloud's functions as Bref does #220, not here. ↩