Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Initial help/work to get this working for V8.0.0 #135

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
5f5abfb
Adds in Nuget.config so we can get the V8 UmbracoCore nightly feed in…
Jan 1, 2019
6a7627a
Make StyleCop happy
Jan 1, 2019
b881a81
Update all projects to target .NET 4.7.2 to ensure it will work with …
Jan 1, 2019
45fdfae
Update UmbracoCms.Core to 8.0.0-alpha.52.1449 - WILL BREAK BUILD
Jan 1, 2019
052b951
Adds in Umbraco.Web V8 Nuget reference needed for WebAPI stuff
Jan 2, 2019
daba3ae
Updates the ApplicationEventHandler to be a user definied component
Jan 2, 2019
be7df06
The test project needs a reference to UmbracoCms.Web nupkg
Jan 2, 2019
d2eefa5
Uses Current.Logger & updated namespaces
Jan 2, 2019
33f3f9d
Uses Current.Logger & updated namespaces
Jan 2, 2019
c71571a
Updates the underlying filesystem to use the new methods added - Stil…
Jan 2, 2019
870aa07
Remove the logwrapper for now, it can be added back in if really needed
Jan 2, 2019
d78231b
Added .editorconfig
Jeavon Oct 10, 2018
ed98ba1
The change made in Umbraco 7.5.15 to relative paths is now permanent …
Jeavon Jan 2, 2019
a07625a
Updating version to v2 and min Umbraco dependency to v8
Jeavon Jan 2, 2019
4809d3e
chore: trying to get the umbraco dependency pre-release to work
Jeavon Jan 2, 2019
425b26c
Update gitignore for .vs folder
Jan 2, 2019
7b00e6a
Implement GetSize in provider
Jan 2, 2019
6658900
Move the methods around before private to please StyleCop
Jan 3, 2019
eabe853
Update Umbraco Nuget Refs to the new DI version - WILL BREAK BUILD
Jan 7, 2019
8b6e7da
Update latest nuget packages for V8 again
Jan 8, 2019
b3b9e37
Update build to use local nuget and update vswhere and nuget
Jeavon Jan 8, 2019
61ff215
Merge branch 'develop8' of https://github.com/warrenbuckley/UmbracoFi…
Jeavon Jan 8, 2019
7aa3395
Yet another V8 nuget package update :)
Jan 8, 2019
19df711
Merge branch 'develop8' of https://github.com/warrenbuckley/UmbracoFi…
Jan 8, 2019
65437cf
Right lets update again..
Jan 8, 2019
af83f89
Adds in composer & component & does some fixes for underlyingfilesyst…
Jan 8, 2019
6084727
More detailed error message for Boot Fail YSOD to indicate which AppS…
Jan 8, 2019
f9ec37e
Injected the wrong thing from DI
Jan 8, 2019
323d3b0
Update Umbraco nupkg - that includes the recent Core V8 FileSystem ch…
Jan 15, 2019
7173490
Comment out in-accessible code that no longer public in V8 - the inst…
Jan 15, 2019
5e9e2b3
Implements new changes to work for V8 File Systems
Jan 15, 2019
493cafb
Update build script to depend on Umbraco 8 build that contains the FS…
Jan 15, 2019
a121412
Refactor based from Lars comment
Jan 15, 2019
d4ded1c
Fix csproj
Jeavon Jan 15, 2019
a2229b5
Forgot to commit config file
Jan 16, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# top-most EditorConfig file
root = true

[*.cs]
indent_style = space
indent_size = 4
csharp_style_var_for_built_in_types = false:warning
csharp_style_var_elsewhere = false:warning
csharp_style_var_when_type_is_apparent = true:warning
end_of_line = crlf
dotnet_sort_system_directives_first = true
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = true:warning
dotnet_style_qualification_for_field = true:warning
dotnet_style_qualification_for_method = true:warning
dotnet_style_qualification_for_property = true:warning
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#VS 2015 hidden folder
src/.vs/*

build/tools/vswhere.2.0.2
build/tools/vswhere*
build/tools/vswhere.exe

artifacts/*
Expand Down Expand Up @@ -237,3 +237,4 @@ $RECYCLE.BIN/

# Windows shortcuts
*.lnk
.vs/
12 changes: 12 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!--
this is Umbraco's NuGet configuration,
content of this file is merged with the system-wide configuration,
at %APPDATA%\NuGet\NuGet.config
-->
<packageSources>
<add key="UmbracoCoreMyGet" value="https://www.myget.org/F/umbracocore/api/v3/index.json" />
<add key="ExamineAppVeyor" value="https://ci.appveyor.com/nuget/examine-f73l6qv0oqfh/" />
</packageSources>
</configuration>
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
os: Visual Studio 2017

# Version format
version: 1.0.3.{build}
version: 2.0.0.{build}

cache:
- src\packages -> **\packages.config # preserve "packages" directory in the root of build folder but will reset it if packages.config is modified
Expand Down
2 changes: 1 addition & 1 deletion build-appveyor.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ IF NOT EXIST "%toolsFolder%" (

IF NOT EXIST "%toolsFolder%vswhere.exe" (
ECHO vswhere not found - fetching now
nuget install vswhere -Version 2.0.2 -Source nuget.org -OutputDirectory tools
tools\nuget.exe install vswhere -Version 2.5.9 -Source nuget.org -OutputDirectory tools
)

FOR /f "delims=" %%A in ('dir "%toolsFolder%vswhere.*" /b') DO SET "vswhereExePath=%toolsFolder%%%A\"
Expand Down
2 changes: 1 addition & 1 deletion build/UmbracoFileSystemProviders.Azure.proj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<!-- SHARED PROPERTIES -->
<PropertyGroup>
<PackageName>UmbracoFileSystemProviders.Azure</PackageName>
<MinUmbracoVersion>7.1.9</MinUmbracoVersion>
<MinUmbracoVersion>8.0.0-alpha.58.1580</MinUmbracoVersion>
<Readme>An Azure Blob Storage IFileSystem provider for Umbraco.</Readme>
<AuthorName>James Jackson-South, Dirk Seefeld, Lars-Erik Aabech, Jeavon Leopold</AuthorName>
<AuthorUrl>https://github.com/JimBobSquarePants/UmbracoFileSystemProviders.Azure/graphs/contributors</AuthorUrl>
Expand Down
Binary file modified build/tools/NuGet.exe
Binary file not shown.
119 changes: 61 additions & 58 deletions src/UmbracoFileSystemProviders.Azure.Installer/InstallerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ namespace Our.Umbraco.FileSystemProviders.Azure.Installer
using System.Xml;
using Enums;
using global::Umbraco.Core;
using global::Umbraco.Core.Composing;
using global::Umbraco.Core.Logging;
using global::Umbraco.Core.Xml;
using global::Umbraco.Web._Legacy.PackageActions;
using global::Umbraco.Web.Mvc;
using global::Umbraco.Web.WebApi;
using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Blob;

using Models;
using umbraco.cms.businesslogic.packager.standardPackageActions;

/// <summary>
/// The installer controller for managing installer logic.
Expand Down Expand Up @@ -191,8 +192,7 @@ internal static bool SaveParametersToFileSystemProvidersXdt(string xdtPath, ILis
catch (Exception e)
{
// Log error message
string message = "Error saving XDT Parameters: " + e.Message;
LogHelper.Error(typeof(InstallerController), message, e);
Current.Logger.Error<InstallerController>(e, "Error saving XDT Parameters");
}

return result;
Expand Down Expand Up @@ -230,8 +230,7 @@ internal static bool SaveContainerNameToWebConfigXdt(string xdtPath, string cont
catch (Exception e)
{
// Log error message
string message = "Error saving XDT Parameters: " + e.Message;
LogHelper.Error(typeof(InstallerController), message, e);
Current.Logger.Error<InstallerController>(e, "Error saving XDT Parameters");
}

return result;
Expand Down Expand Up @@ -292,8 +291,7 @@ internal static bool SaveBlobPathToImageProcessorSecurityXdt(string xdtPath, str
catch (Exception e)
{
// Log error message
string message = "Error saving XDT Settings: " + e.Message;
LogHelper.Error(typeof(InstallerController), message, e);
Current.Logger.Error<InstallerController>(e, "Error saving XDT Parameters");
}

return result;
Expand Down Expand Up @@ -361,46 +359,49 @@ internal static IEnumerable<Parameter> GetParametersFromXml(string xmlPath)
/// <returns>True if the transform is successful, otherwise false.</returns>
private static bool ExecuteFileSystemConfigTransform()
{
XmlNode transFormConfigAction =
helper.parseStringToXmlNode("<Action runat=\"install\" "
+ "undo=\"true\" "
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
+ "file=\"~/Config/FileSystemProviders.config\" "
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/FileSystemProviders.config\">"
+ "</Action>").FirstChild;

PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
//XmlNode transFormConfigAction =
// PackageHelper.ParseStringToXmlNode("<Action runat=\"install\" "
// + "undo=\"true\" "
// + "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
// + "file=\"~/Config/FileSystemProviders.config\" "
// + "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/FileSystemProviders.config\">"
// + "</Action>").FirstChild;

//PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
//return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
return true;
}

private static bool ExecuteWebConfigTransform()
{
XmlNode transFormConfigAction =
helper.parseStringToXmlNode("<Action runat=\"install\" "
+ "undo=\"true\" "
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
+ "file=\"~/web.config\" "
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/web.config\">"
+ "</Action>").FirstChild;

PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
//XmlNode transFormConfigAction =
// PackageHelper.ParseStringToXmlNode("<Action runat=\"install\" "
// + "undo=\"true\" "
// + "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
// + "file=\"~/web.config\" "
// + "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/web.config\">"
// + "</Action>").FirstChild;

//PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
//return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
return true;
}

private static bool ExecuteMediaWebConfigTransform()
{
if (File.Exists(HttpContext.Current.Server.MapPath("~/Media/web.config")))
{
XmlNode transFormConfigAction =
helper.parseStringToXmlNode("<Action runat=\"install\" "
+ "undo=\"true\" "
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
+ "file=\"~/Media/web.config\" "
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/media-web.config\">"
+ "</Action>").FirstChild;

PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
//XmlNode transFormConfigAction =
// PackageHelper.ParseStringToXmlNode("<Action runat=\"install\" "
// + "undo=\"true\" "
// + "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
// + "file=\"~/Media/web.config\" "
// + "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/media-web.config\">"
// + "</Action>").FirstChild;

//PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
//return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
return true;
}

return true;
Expand All @@ -419,30 +420,32 @@ private static bool ExecuteImageProcessorSecurityConfigTransform()
File.Copy(ImageProcessorSecurityDefaultConfigPath, ImageProcessorSecurityConfigPath);
}

XmlNode transFormConfigAction =
helper.parseStringToXmlNode("<Action runat=\"install\" "
+ "undo=\"false\" "
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
+ "file=\"~/config/imageprocessor/security.config\" "
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/security.config\">"
+ "</Action>").FirstChild;
//XmlNode transFormConfigAction =
// PackageHelper.ParseStringToXmlNode("<Action runat=\"install\" "
// + "undo=\"false\" "
// + "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
// + "file=\"~/config/imageprocessor/security.config\" "
// + "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/security.config\">"
// + "</Action>").FirstChild;

PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
//PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
//return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
return true;
}

private static bool ExecuteImageProcessorWebConfigTransform()
{
XmlNode transFormConfigAction =
helper.parseStringToXmlNode("<Action runat=\"install\" "
+ "undo=\"false\" "
+ "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
+ "file=\"~/web.config\" "
+ "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/imageprocessor.web.config\">"
+ "</Action>").FirstChild;

PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
//XmlNode transFormConfigAction =
// PackageHelper.ParseStringToXmlNode("<Action runat=\"install\" "
// + "undo=\"false\" "
// + "alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
// + "file=\"~/web.config\" "
// + "xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/imageprocessor.web.config\">"
// + "</Action>").FirstChild;

//PackageActions.TransformConfig transformConfig = new PackageActions.TransformConfig();
//return transformConfig.Execute("UmbracoFileSystemProviders.Azure", transFormConfigAction);
return true;
}

private static bool TestAzureCredentials(string connectionString, string containerName)
Expand All @@ -463,7 +466,7 @@ private static bool TestAzureCredentials(string connectionString, string contain
}
catch (Exception e)
{
LogHelper.Error<InstallerController>($"Error validating Azure storage connection: {e.Message}", e);
Current.Logger.Error<InstallerController>(e, "Error validating Azure storage connection");
return false;
}
}
Expand Down
12 changes: 6 additions & 6 deletions src/UmbracoFileSystemProviders.Azure.Installer/PackageActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace Our.Umbraco.FileSystemProviders.Azure.Installer
using System;
using System.Web;
using System.Xml;

using global::Umbraco.Core._Legacy.PackageActions;
using global::Umbraco.Core.Composing;
using global::Umbraco.Core.Logging;
using global::Umbraco.Web._Legacy.PackageActions;
using Microsoft.Web.XmlTransform;
using umbraco.cms.businesslogic.packager.standardPackageActions;
using umbraco.interfaces;

/// <summary>
/// Handles installer package actions.
Expand Down Expand Up @@ -42,7 +42,8 @@ public XmlNode SampleXml()
+ "undo=\"true\" alias=\"UmbracoFileSystemProviders.Azure.TransformConfig\" "
+ "file=\"~/web.config\" xdtfile=\"~/app_plugins/UmbracoFileSystemProviders/Azure/install/web.config\">"
+ "</Action>";
return helper.parseStringToXmlNode(xml);
//return PackageHelper.ParseStringToXmlNode(xml);
return null;
}

/// <inheritdoc/>
Expand Down Expand Up @@ -97,8 +98,7 @@ private bool Transform(string packageName, XmlNode xmlData, bool uninstall = fal
catch (Exception e)
{
// Log error message
string message = "Error executing TransformConfig package action (check file write permissions): " + e.Message;
LogHelper.Error(typeof(TransformConfig), message, e);
Current.Logger.Error<TransformConfig>(e, "Error executing TransformConfig package action (check file write permissions)");
return false;
}
}
Expand Down
Loading