Skip to content

Commit f792983

Browse files
committed
Merge branch 'develop-umbraco-version-8' into master-umbraco-version-8
2 parents 13ff963 + 3393e6c commit f792983

File tree

52 files changed

+1049
-830
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1049
-830
lines changed

README.md

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,64 @@
11
# UmbracoFileSystemProviders.Azure v2
22

3-
**This version is for Umbraco v8 only**. For the v1 package for **Umbraco v7** please visit the [main branch](https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure)
3+
**This version is for Umbraco v8 only**. For the v1 package for **Umbraco v7** please visit the [main branch](https://github.com/umbraco-community/UmbracoFileSystemProviders.Azure)
44

55
![Image Alt](build/assets/logo/azure-logo-256.png)
66

7-
[![Build status](https://ci.appveyor.com/api/projects/status/mn5hxj5ijurwih7q?svg=true)](https://ci.appveyor.com/project/JamesSouth/umbracofilesystemproviders-azure)
7+
[![Build status](https://ci.appveyor.com/api/projects/status/oicfg95tvptrhntn/branch/develop-umbraco-version-8?svg=true)](https://ci.appveyor.com/project/Umbraco-Community/umbracofilesystemproviders-azure/branch/develop-umbraco-version-8)
88

99
An [Azure Blob Storage](http://azure.microsoft.com/en-gb/develop/net/) IFileSystem provider for [Umbraco](https://umbraco.com)
1010
Used to offload static files in the media section to the cloud.
1111

1212
This package allows the storage and retrieval of media items using Azure Blob Storage while retaining the relative paths to the files expected in the back office.
1313

14-
**v2 requires Umbraco v8.0.1+**
14+
**v2 requires Umbraco v8.1.0+**
1515

1616
## Installation
1717

1818
Both NuGet and Umbraco packages are available. If you use NuGet but would like the benefit of the Umbraco configuration wizard you can install the Umbraco package first, use the wizard, then install the NuGet package, the configuration will be maintained.
1919

20+
From **v2.0.0-alpha3** onwards this package was split into 2 NuGet packages and an additional one was added to support Umbraco Forms. When using NuGet install the `UmbracoFileSystemProviders.Azure.Media` package to swap Media storage to Blobs.
21+
22+
**If upgrading from v2.0.0-alpha1 or v2.0.0-alpha2 to v2.0.0-alpha3 you will need to install `UmbracoFileSystemProviders.Azure.Media`**
23+
2024
|NuGet Packages |Version |
2125
|:-----------------|:-----------------|
2226
|**Pre-Release**|[![NuGet download](http://img.shields.io/nuget/vpre/UmbracoFileSystemProviders.Azure.svg)](https://www.nuget.org/packages/UmbracoFileSystemProviders.Azure/)|[![NuGet count](https://img.shields.io/nuget/dt/UmbracoFileSystemProviders.Azure.svg)](https://www.nuget.org/packages/UmbracoFileSystemProviders.Azure/)|
23-
|**Bleeding edge v2**|[![MyGet download](https://img.shields.io/myget/umbraco-packages/vpre/UmbracoFileSystemProviders.Azure.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/UmbracoFileSystemProviders.Azure)|[![MyGet count](https://img.shields.io/myget/umbraco-packages/dt/UmbracoFileSystemProviders.Azure.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/UmbracoFileSystemProviders.Azure)|
27+
|**Bleeding edge Core**|[![MyGet download](https://img.shields.io/myget/umbraco-packages/vpre/UmbracoFileSystemProviders.Azure.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/UmbracoFileSystemProviders.Azure)|[![MyGet count](https://img.shields.io/myget/umbraco-packages/dt/UmbracoFileSystemProviders.Azure.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/UmbracoFileSystemProviders.Azure)|
28+
|**Bleeding edge Media**|[![MyGet download](https://img.shields.io/myget/umbraco-packages/vpre/UmbracoFileSystemProviders.Azure.Media.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/UmbracoFileSystemProviders.Azure.Media)|[![MyGet count](https://img.shields.io/myget/umbraco-packages/dt/UmbracoFileSystemProviders.Azure.Media.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/UmbracoFileSystemProviders.Azure.Media)|
29+
|**Bleeding edge Forms**|[![MyGet download](https://img.shields.io/myget/umbraco-packages/vpre/UmbracoFileSystemProviders.Azure.Forms.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/UmbracoFileSystemProviders.Azure.Forms)|[![MyGet count](https://img.shields.io/myget/umbraco-packages/dt/UmbracoFileSystemProviders.Azure.Forms.svg)](https://www.myget.org/feed/umbraco-packages/package/nuget/UmbracoFileSystemProviders.Azure.Forms)|
2430

2531
|Umbraco Packages | |
2632
|:-----------------|:-----------------|
2733
|**Release**|[![Our Umbraco project page](https://img.shields.io/badge/our-umbraco-orange.svg)](https://our.umbraco.org/projects/collaboration/umbracofilesystemprovidersazure/)
28-
|**Pre-release**| [![AppVeyor Artifacts](https://img.shields.io/badge/appveyor-umbraco-orange.svg)](https://ci.appveyor.com/project/JamesSouth/umbracofilesystemproviders-azure/build/artifacts)
34+
|**Pre-release**| [![AppVeyor Artifacts](https://img.shields.io/badge/appveyor-umbraco-orange.svg)](https://ci.appveyor.com/project/Umbraco-Community/umbracofilesystemproviders-azure/build/artifacts)
2935

3036
## Manual build
3137

3238
If you prefer, you can compile UmbracoFileSystemProviders.Azure yourself, you'll need:
3339

34-
* Visual Studio 2017 (or above)
40+
* Visual Studio 2019 (or above)
3541

3642
To clone it locally click the "Clone in Windows" button above or run the following git commands.
3743

3844
```bash
39-
git clone https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure
45+
git clone https://github.com/umbraco-community/UmbracoFileSystemProviders.Azure
4046
cd UmbracoFileSystemProviders.Azure
4147
.\build.cmd
4248
```
4349

4450
In the interim code reviews and pull requests would be most welcome!
4551

52+
## Media
53+
4654
### Configuration via Web.Config
4755

4856
In `Web.config` create the new application keys
4957

5058
```xml
5159
<add key="AzureBlobFileSystem.ConnectionString:media" value="DefaultEndpointsProtocol=https;AccountName=[myAccountName];AccountKey=[myAccountKey]" />
5260
<add key="AzureBlobFileSystem.ContainerName:media" value="media" />
53-
<add key="AzureBlobFileSystem.RootUrl:media" value="http://[myAccountName].blob.core.windows.net/" />
61+
<add key="AzureBlobFileSystem.RootUrl:media" value="https://[myAccountName].blob.core.windows.net/" />
5462
<add key="AzureBlobFileSystem.MaxDays:media" value="365" />
5563
<add key="AzureBlobFileSystem.UseDefaultRoute:media" value="true" />
5664
<add key="AzureBlobFileSystem.UsePrivateContainer:media" value="false" />
@@ -72,10 +80,10 @@ Additionally the provider can be further configured with the following applicati
7280
</configuration>
7381
```
7482

75-
## Virtual Path Provider
76-
By default the plugin will serve files transparently from your domain or serve media directly from Azure. This is made possible by using a custom [Virtual Path Provider](https://msdn.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider%28v=vs.110%29.aspx) included and automatically initialised upon application startup. This can be disable by adding the configuration setting noted above.
83+
### Virtual Path Provider
84+
By default the plugin will serve files transparently from your domain or serve media directly from Azure. This is made possible by using a custom [Virtual Path Provider](https://msdn.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider%28v=vs.110%29.aspx) included and automatically initialised upon application startup. This can be disabled by adding the configuration setting noted above.
7785

78-
**Note:** Virtual Path Providers may affect performance/caching depending on your setup as the process differs from IIS's [unmanaged handler](http://www.paraesthesia.com/archive/2011/05/02/when-staticfilehandler-is-not-staticfilehandler.aspx/). Virtual files sent via the provider though are correctly cached in the browser so this shouldn't be an issue. VVP providers also **don't work** with **Precompiled sites** or when used in a **virtual directory/application**.
86+
**Note:** Virtual Path Providers may affect performance/caching depending on your setup as the process differs from IIS's [unmanaged handler](http://www.paraesthesia.com/archive/2011/05/02/when-staticfilehandler-is-not-staticfilehandler.aspx/). Virtual files sent via the provider though are correctly cached in the browser so this shouldn't be an issue. VPP providers also **don't work** with **Precompiled sites** or when used in a **virtual directory/application**.
7987

8088
The following configuration is required in your `web.config` to enable static file mapping in IIS Express.
8189

@@ -108,7 +116,7 @@ Also add this configuration to the `web.config` inside the `Media` folder
108116
</configuration>
109117
```
110118

111-
## Combining with ImageProcessor
119+
### Combining with ImageProcessor
112120

113121
ImageProcessor.Web contains a [`IImageService`](http://imageprocessor.org/imageprocessor-web/extending/#iimageservice) called `CloudImageService`, to enable that service and pull images directly from
114122
the cloud replace the `CloudImageService`setting with the following:
@@ -123,17 +131,33 @@ the cloud replace the `CloudImageService`setting with the following:
123131
<setting key="Container" value="media"/>
124132
<setting key="MaxBytes" value="8194304"/>
125133
<setting key="Timeout" value="30000"/>
126-
<setting key="Host" value="http://[myAccountName].blob.core.windows.net/media"/>
134+
<setting key="Host" value="https://[myAccountName].blob.core.windows.net/media"/>
127135
</settings>
128136
</service>
129137
</services>
130138
</security>
131139
```
132-
**Note** The `CloudImageService`is not compatible with the FileSystemProvider when using private storage. You will have to build your own `IImageService` implementation.
133-
140+
**Note** The `CloudImageService`is not compatible with the FileSystemProvider when using private storage. You can instead use the `AzureImageService` which is included with the [AzureBlobCache](http://imageprocessor.org/imageprocessor-web/plugins/azure-blob-cache/) package
134141

135142
Optionally install the [AzureBlobCache](http://imageprocessor.org/imageprocessor-web/plugins/azure-blob-cache/) plugin to get the most out of the package.
136143

144+
## Umbraco Forms
145+
146+
Currently this package is available only via NuGet
147+
148+
Install-Package UmbracoFileSystemProviders.Azure.Forms -pre
149+
150+
### Configuration via Web.Config
151+
152+
In `Web.config` update the new application keys with the required credentials
153+
154+
```xml
155+
<add key="AzureBlobFileSystem.ContainerName:forms" value="forms-data" />
156+
<add key="AzureBlobFileSystem.RootUrl:forms" value="https://[myAccountName].blob.core.windows.net/" />
157+
<add key="AzureBlobFileSystem.ConnectionString:forms" value="DefaultEndpointsProtocol=https;AccountName=[myAccountName];AccountKey=[myAccountKey]" />
158+
<add key="AzureBlobFileSystem.UsePrivateContainer:forms" value="false" />
159+
```
160+
137161
## Authors
138162

139163
- James Jackson-South

appveyor.yml

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,47 @@
1-
os: Visual Studio 2017
2-
3-
# Version format
41
version: 2.0.0.{build}
52

3+
os: Visual Studio 2019
4+
65
cache:
76
- src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
87

9-
# UMBRACO_PACKAGE_PRERELEASE_SUFFIX if a rtm release build this should be blank, otherwise if empty will default to alpha
10-
# example UMBRACO_PACKAGE_PRERELEASE_SUFFIX=beta
11-
init:
12-
- set UMBRACO_PACKAGE_PRERELEASE_SUFFIX=alpha2
8+
configuration: Release
9+
10+
environment:
11+
# Version Suffix
12+
version_suffix: alpha3
1313

1414
install:
15+
- ps: .\build\appveyor-semver.ps1
16+
- ps: .\build\check-release-version.ps1
17+
- ps: Update-AppveyorBuild -Version $Env:appveyor_version
18+
- cmd: >-
19+
cd build
20+
21+
npm install
22+
23+
node appveyor-nuspec-patch.js
24+
25+
cd..
1526
- ps: >-
1627
$msiPath = "$($env:USERPROFILE)\MicrosoftAzureStorageEmulator.msi"
1728
1829
(New-Object Net.WebClient).DownloadFile('https://download.microsoft.com/download/F/3/8/F3857A38-D344-43B4-8E5B-2D03489909B9/MicrosoftAzureStorageEmulator.msi', $msiPath)
1930
2031
cmd /c start /wait msiexec /i $msiPath /quiet
2132
33+
assembly_info:
34+
patch: true
35+
file: 'src\UmbracoFileSystemProviders.Azure**\AssemblyInfo.*'
36+
assembly_version: '$(appveyor_file_version)'
37+
assembly_file_version: '$(appveyor_file_version)'
38+
assembly_informational_version: '$(mssemver)'
39+
2240
build_script:
23-
- build-appveyor.cmd
41+
- cmd: >-
42+
build-appveyor.cmd
43+
44+
cd..
2445
2546
before_test:
2647
- cmd: '"%programfiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe" start'
@@ -47,15 +68,15 @@ deploy:
4768
server: https://www.myget.org/F/umbraco-packages/api/v2/package
4869
symbol_server: https://www.myget.org/F/umbraco-packages/symbols/api/v2/package
4970
api_key:
50-
secure: 9ggA53hO2o0/bXcLQoa+f9Kv9dduaStqg9Scxxq4nCbDK5ibg6rLUaTyf51Kl1aF
71+
secure: yvlnQEq6tmxGOdbtTuKyAhcdY1GCD98/sG9+Qo7y7SNb89GAbjLXxueOMspkjvUh
5172
artifact: /.*\.nupkg/
5273
on:
5374
branch: develop-umbraco-version-8
5475

5576
# GitHub Deployment for releases
5677
- provider: GitHub
5778
auth_token:
58-
secure: gnJNHw3btYiQ7G0GexIGpSyA3moAz/GuJvgGZvJmz63/+YVLFC+qew/xlniRLDSk
79+
secure: Kucu1gQQf8bjRlkR72fyZUiUtmkz7rtZEIgK/RMT1pMnq700m5sSQTiFHOSQUdR5
5980
artifact: /.*\.zip/ # upload all Zip packages to release assets
6081
draft: false
6182
prerelease: false
@@ -67,7 +88,7 @@ deploy:
6788
- provider: NuGet
6889
server:
6990
api_key:
70-
secure: kHataLiMb9nmJEdwBE4BTXvA4nOpoD3Fw14zVeDP6Vs0ZXpL7c8qeegMv/jMZECP
91+
secure: TtE4dizVNNLoy4gfrJDGRH1/vfNMTXiAxuMW0va1bcO1ZPXCw0qy12PUfIB+h9O3
7192
artifact: /.*\.nupkg/
7293
on:
7394
branch: master
@@ -76,7 +97,7 @@ deploy:
7697
# GitHub Deployment for releases
7798
- provider: GitHub
7899
auth_token:
79-
secure: gnJNHw3btYiQ7G0GexIGpSyA3moAz/GuJvgGZvJmz63/+YVLFC+qew/xlniRLDSk
100+
secure: Kucu1gQQf8bjRlkR72fyZUiUtmkz7rtZEIgK/RMT1pMnq700m5sSQTiFHOSQUdR5
80101
artifact: /.*\.zip/ # upload all Zip packages to release assets
81102
draft: false
82103
prerelease: false
@@ -88,7 +109,7 @@ deploy:
88109
- provider: NuGet
89110
server:
90111
api_key:
91-
secure: kHataLiMb9nmJEdwBE4BTXvA4nOpoD3Fw14zVeDP6Vs0ZXpL7c8qeegMv/jMZECP
112+
secure: TtE4dizVNNLoy4gfrJDGRH1/vfNMTXiAxuMW0va1bcO1ZPXCw0qy12PUfIB+h9O3
92113
artifact: /.*\.nupkg/
93114
on:
94115
branch: master-umbraco-version-8

build-appveyor.cmd

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ ECHO APPVEYOR_REPO_BRANCH: %APPVEYOR_REPO_BRANCH%
22
ECHO APPVEYOR_REPO_TAG: %APPVEYOR_REPO_TAG%
33
ECHO APPVEYOR_BUILD_NUMBER : %APPVEYOR_BUILD_NUMBER%
44
ECHO APPVEYOR_BUILD_VERSION : %APPVEYOR_BUILD_VERSION%
5+
ECHO CONFIGURATION : %CONFIGURATION%
56

67
CALL NuGet.exe restore src\UmbracoFileSystemProviders.Azure.sln
78

@@ -14,24 +15,28 @@ IF NOT EXIST "%toolsFolder%" (
1415

1516
IF NOT EXIST "%toolsFolder%vswhere.exe" (
1617
ECHO vswhere not found - fetching now
17-
tools\nuget.exe install vswhere -Version 2.5.9 -Source nuget.org -OutputDirectory tools
18+
nuget install vswhere -Version 2.7.1 -Source nuget.org -OutputDirectory tools
1819
)
1920

2021
FOR /f "delims=" %%A in ('dir "%toolsFolder%vswhere.*" /b') DO SET "vswhereExePath=%toolsFolder%%%A\"
2122
MOVE "%vswhereExePath%tools\vswhere.exe" "%toolsFolder%vswhere.exe"
2223

23-
for /f "usebackq tokens=1* delims=: " %%i in (`"%CD%\tools\vswhere.exe" -latest -requires Microsoft.Component.MSBuild`) do (
24-
if /i "%%i"=="installationPath" set InstallDir=%%j
25-
)
24+
SETLOCAL EnableDelayedExpansion
25+
26+
:: This string specifies vs 2019
27+
:: set vswherestr=^"!%CD%\tools\vswhere.exe^" -version [16.0,17.0^^) -latest -prerelease -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
2628

27-
SET VSWherePath="%InstallDir%\MSBuild"
29+
set vswherestr=^"!%CD%\tools\vswhere.exe^" -latest -prerelease -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe
30+
for /f "usebackq tokens=*" %%i in (`!vswherestr!`) do (
31+
set MsBuildDir=%%i
32+
)
2833

2934
ECHO.
30-
ECHO Visual Studio is installed in: %InstallDir%
35+
ECHO MsBuild is installed in: %MsBuildDir%
3136

32-
CALL "%InstallDir%\MSBuild\15.0\Bin\amd64\MsBuild.exe" package.proj %~1
37+
CALL "%MsBuildDir%" package.proj %~1
3338

3439
@IF %ERRORLEVEL% NEQ 0 GOTO err
3540
@EXIT /B 0
3641
:err
37-
@EXIT /B 1
42+
@EXIT /B 1

build.cmd

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ ECHO off
22

33
SET /P APPVEYOR_BUILD_NUMBER=Please enter a build number (e.g. 134):
44
SET /P PACKAGE_VERISON=Please enter your package version (e.g. 1.0.5):
5-
SET /P UMBRACO_PACKAGE_PRERELEASE_SUFFIX=Please enter your package release suffix or leave empty (e.g. beta):
5+
SET /P version_suffix=Please enter your package release suffix or leave empty (e.g. beta):
66

77
SET /P APPVEYOR_REPO_TAG=If you want to simulate a GitHub tag for a release (e.g. true):
88

@@ -13,10 +13,19 @@ if "%PACKAGE_VERISON%" == "" (
1313
SET PACKAGE_VERISON=0.1.0
1414
)
1515

16-
SET APPVEYOR_BUILD_VERSION=%PACKAGE_VERISON%.%APPVEYOR_BUILD_NUMBER%
16+
SET mssemver=%PACKAGE_VERISON%-beta-%APPVEYOR_BUILD_NUMBER%
17+
18+
SET CONFIGURATION=Debug
19+
20+
cd build
21+
call npm install
22+
call node appveyor-nuspec-patch.js
23+
cd..
1724

1825
build-appveyor.cmd
1926

27+
cd..
28+
2029
@IF %ERRORLEVEL% NEQ 0 GOTO err
2130
@EXIT /B 0
2231
:err
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
3+
<metadata>
4+
<id/>
5+
<version>0.0.0</version>
6+
<title/>
7+
<authors/>
8+
<owners/>
9+
<projectUrl/>
10+
<iconUrl/>
11+
<requireLicenseAcceptance/>
12+
<description/>
13+
<summary/>
14+
<copyright/>
15+
<licenseUrl/>
16+
<language/>
17+
<tags/>
18+
<dependencies>
19+
<dependency id="UmbracoFileSystemProviders.Azure" version="0.0.0"/>
20+
<dependency id="UmbracoCms.Core" version="0.0.0"/>
21+
<dependency id="UmbracoCms.Web" version="0.0.0"/>
22+
<dependency id="UmbracoForms.Core" version="8.1.1"/>
23+
</dependencies>
24+
</metadata>
25+
</package>

0 commit comments

Comments
 (0)