Skip to content

Commit

Permalink
Merge pull request #2 from ivansharamok/master
Browse files Browse the repository at this point in the history
Added readme file with project info
  • Loading branch information
ivansharamok authored Sep 22, 2016
2 parents 5fd9612 + 3887577 commit 051f00f
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 1 deletion.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016 Ivan Sharamok

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
49 changes: 48 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
This is the readme file.
# Sitecore Media Azure Blob Storage provider
This module allows to store Sitecore media library assets in the Azure Blob Storage account.

# Instructions
* Restore nuget packages and build the solution.
* Move ```Sitecore.Media.AzureBlobStorage.dll``` to the ```\bin``` folder of your Sitecore application.
* Move ```App_Config\Include\Sitecore.Media.AzureBlobStorage``` folder to the ```App_Config\Include``` directory of you Sitecore application.
* Adjust settings in the ```App_Config\Include\Sitecore.Media.AzureBlobStorage\Sitecore.Media.AzureBlobStorage.config``` file if necessary.
* Disable ```Media.DisableFileMedia``` setting in your Sitecore application configuration.
* Set ```maxRequestLength``` attribute of ```httpRuntime``` section to set the size limit in KB for large media assets that you want to upload into Sitecore media library.
* Set ```maxAllowedContentLength``` attribute of ```/system.webServer/security/requestFiltering/requestLimits``` section to match the value specified in ```maxRequestLength``` attribute. This value should be in bytes instead of KB.
* Set ```Media.MaxSizeInDatabase``` setting to match size limit specified in ```maxRequestLength``` attribute. This value could be specified in KB, MB or GB.

> There are a few functional tests in the solution that require Azure Storage Emulator to be running.
You can install it as a [standalone application](https://go.microsoft.com/fwlink/?linkid=717179&clcid=0x409) or a part of [Microsoft Azure SDK](https://azure.microsoft.com/downloads/) package.

# Implementation details
This module overrides the following methods from default implementation of SqlServerDataProvider in order to replace underlying blob storage for media assets:
* ```GetBlobStream(Guid, CallContext)```
* ```BlobStreamExists(Guid, CallContext)```
* ```RemoveBlobStream(Guid, CallContext)```
* ```SetBlobStream(Stream, Guid, CallContext)```
* ```CleanupBlobs(CallContext)```

## Pros
The implementation substitutes low-level Data API which makes it possible to minimize amount of changes necessary to plug in alternative blob storage implementation.
Media management actions like _Upload_, _Download_, _Attach_, _Detach_ work seamlessly with this approach and do not require any other changes.

## Cons
Due to the fact that changes are made to SqlServerDataProvider level, there is not enough abstraction to seamlessly replace Sitecore version when needed.
The solution needs to be recompiled with a target version of ```Sitecore.Kernel.dll``` and thoroughly tested before you can upgrade to a desired version of Sitecore platform.
The module forces all media assets to be stored in Azure Blob Storage and does not allow alternative storage.
Thus, the file based media should be completely disabled in your Sitecore solution.
> File based media option is not supported and must be disabled when this module is used.
# Dependencies
* [Windows Azure Storage](https://www.nuget.org/packages/WindowsAzure.Storage/) nuget package.
* Sitecore.Kernel
* [Azure Blob Storage emulator](https://go.microsoft.com/fwlink/?linkid=717179&clcid=0x409) for functional tests.

# License
This module is licensed under the [MIT License](LICENSE).

# Download
Donloads are available via [GitHub Releases](https://github.com/aweber1/Sitecore.Media.AzureBlobStorage/releases).

# Alternative solution
If you find this approach too fragile for your liking, you may consider [@jammykam's solution](https://github.com/jammykam/Sitecore-CloudMediaLibrary/).
1 change: 1 addition & 0 deletions src/Sitecore.Media.AzureBlobStorage.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sitecore.Media.AzureBlobSto
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "content", "content", "{69629A3F-A2A1-444E-99F4-405CD5C31B1C}"
ProjectSection(SolutionItems) = preProject
..\LICENSE = ..\LICENSE
..\README.md = ..\README.md
EndProjectSection
EndProject
Expand Down

0 comments on commit 051f00f

Please sign in to comment.