umbraco / Umbraco.StorageProviders

MIT License
29 stars 21 forks source link

Implement IFileProviderFactory, move shared infrastructure to Umbraco.StorageProviders and support Umbraco 10 #36

Closed ronaldbarendse closed 2 years ago

ronaldbarendse commented 2 years ago

PR https://github.com/umbraco/Umbraco-CMS/pull/11783 added a new IFileProviderFactory interface that an IFileSystem can implement to expose itself to the WebRootFileProvider, that in turn is used by the StaticFileMiddleware to serve the files.

Adding support for this to the AzureBlobFileSystem has the following benefits:

Because the dependency on Umbraco was updated to ~9.3.0 (the version introducing IFileProviderFactory)~ 10.0.0-rc1 and I've moved shared infrastructure code (the CDN media URL provider) to a new Umbraco.StorageProviders project, I've bumped to version to v2.

~I've also included the changes in https://github.com/umbraco/Umbraco.StorageProviders/pull/34, so the build and versioning simplification can/should be reviewed and merged separately first.~ I've reverted the versioning changes (so we can align with the updated versioning in the CMS later), but kept the simplified build, as that doesn't require different release workflows and speeds up the build times significantly.

With this PR is merged, adding additional storage providers (like AWS S3 as requested in https://github.com/umbraco/Umbraco.StorageProviders/issues/28) should be a lot easier, as you basically only have to implement an IFileSystem (so Umbraco can store/retrieve media) and an IFileProvider (so the media can be served and retrieved by ImageSharp) that's exposed by the IFileProviderFactory.