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

Update Upgrade Process to remove Telerik (Continued from #5099) #5166

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
afa6327
Initial commit.
daguiler Apr 22, 2022
1eb8954
Finished replace module step
daguiler Apr 25, 2022
fe2cb1a
Activated All Rules code analysis
daguiler Apr 25, 2022
4fbc673
Added packaging support files
daguiler Apr 25, 2022
86bd0d1
Implemented SQL step
daguiler Apr 25, 2022
b8d83c3
Added Required attribute to validate step properties
daguiler Apr 25, 2022
1960d8b
Fixed bug in UninstallSummaryItem
daguiler Apr 25, 2022
84d9f69
Implemented the clear cache step
daguiler Apr 25, 2022
c9cd5be
Removed Impl namespace and rearranged files
daguiler Apr 26, 2022
6856122
Renamed internal to shim
daguiler Apr 26, 2022
f966def
Moved exception logging to StepBase
daguiler Apr 26, 2022
c7b8b26
Added remove extension step
daguiler Apr 26, 2022
22ff2f5
added update DataType list step
daguiler Apr 26, 2022
07cabc2
added Quiet property to ClearCacheStep
daguiler Apr 26, 2022
2646ffd
Fixed 2017.1 hotfix package name
daguiler Apr 26, 2022
231f2a4
added records affected to SQL step notes
daguiler Apr 26, 2022
fb8b3c4
added dependency cleanup to RemoveExtensionStep
daguiler Apr 26, 2022
e82a151
Show file names only not paths
daguiler Apr 27, 2022
c1dd988
Fixed RadEditor Manager package name
daguiler Apr 27, 2022
9b4d57a
Simplified step name property
daguiler Apr 27, 2022
4d23c13
Implemented replace text in file step
daguiler Apr 27, 2022
1732dab
Implemented Web.config steps
daguiler Apr 27, 2022
d23747b
Added extension files cleanup step
daguiler Apr 27, 2022
7f59fe8
Removed unused NullStep
daguiler Apr 27, 2022
29ed202
Disabling the submit button after click
daguiler Apr 27, 2022
7484ff3
Showing a spinner now while processing
daguiler Apr 28, 2022
af4d7ad
Hooked Telerik removal to the upgrade process
daguiler Apr 28, 2022
45f15f0
Completed remaining localization
daguiler Apr 29, 2022
6cfd2a4
Showing detected Telerik version number
daguiler Apr 29, 2022
6589b3a
Minor fixes
daguiler Apr 30, 2022
dc54f67
Moved in-line style to CSS file
daguiler Apr 30, 2022
2fbfba2
Updated InstalledAndUsed view to handle DAM case
daguiler May 1, 2022
0557262
Updated UpgradeWizard to latest wording
daguiler May 2, 2022
26ee373
Fixed missing Telerik uninstall option in some views
daguiler May 2, 2022
a09dfdd
text fix and rebuild for artefacts
armaganpekatik Jun 24, 2022
d092fad
Update DNN Platform/Modules/TelerikRemoval/TelerikRemoval.dnn
armaganpekatik Jul 7, 2022
a74bb1b
Update DNN Platform/Website/Providers/DataProviders/SqlDataProvider/0…
armaganpekatik Jul 7, 2022
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
19 changes: 19 additions & 0 deletions DNN Platform/Library/Common/Utilities/ITelerikUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@

namespace DotNetNuke.Common.Internal
{
using System;
using System.Collections.Generic;
using System.IO;

/// <summary>
/// Abstraction of Telerik related utilities.
Expand All @@ -16,6 +18,12 @@ public interface ITelerikUtils
/// </summary>
string BinPath { get; }

/// <summary>
/// Checks whether the Digital Asset Management extension is installed on this site.
/// </summary>
/// <returns><c>True</c> if Digital Asset Management is found, or <c>False</c> otherwise.</returns>
bool DigitalAssetsIsInstalled();

/// <summary>
/// Gets an <see cref="IEnumerable{T}"/> containing all assemblies that depend on Telerik.
/// </summary>
Expand All @@ -27,5 +35,16 @@ public interface ITelerikUtils
/// </summary>
/// <returns><c>True</c> if Telerik is found in this site, or <c>False</c> otherwise.</returns>
bool TelerikIsInstalled();

/// <summary>
/// Loads the Telerik assembly and returns its version number.
/// </summary>
/// <returns>The Telerik version number.</returns>
/// <exception cref="IOException">
/// An error occurred while loading the Telerik assembly.
/// The file may not exist, or it may be locked by another process.
/// The <see cref="Exception.InnerException"/> property contains the cause of the error.
/// </exception>
Version GetTelerikVersion();
}
}
30 changes: 30 additions & 0 deletions DNN Platform/Library/Common/Utilities/TelerikUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public class TelerikUtils : ITelerikUtils
/// </summary>
public static readonly string TelerikWebUIFileName = "Telerik.Web.UI.dll";

/// <summary>
/// The file name of the Digital Asset Management assembly.
/// </summary>
public static readonly string DigitalAssetsFileName = "DotNetNuke.Modules.DigitalAssets.dll";

private static readonly string[] Vendors = new[]
{
"Microsoft",
Expand Down Expand Up @@ -60,6 +65,12 @@ internal TelerikUtils(IApplicationStatusInfo applicationStatusInfo)
/// <inheritdoc />
public string BinPath => Path.Combine(this.applicationStatusInfo.ApplicationMapPath, "bin");

/// <inheritdoc/>
public bool DigitalAssetsIsInstalled()
{
return this.FileExists(Path.Combine(this.BinPath, DigitalAssetsFileName));
}

/// <inheritdoc/>
public IEnumerable<string> GetAssembliesThatDependOnTelerik()
{
Expand All @@ -84,6 +95,25 @@ public bool TelerikIsInstalled()
return this.FileExists(Path.Combine(this.BinPath, TelerikWebUIFileName));
}

/// <inheritdoc />
public Version GetTelerikVersion()
{
var domain = AppDomain.CreateDomain(nameof(TelerikUtils));
try
{
var path = Path.Combine(this.BinPath, TelerikWebUIFileName);
return domain.Load(File.ReadAllBytes(path)).GetName().Version;
}
catch (Exception ex)
{
throw new IOException("Could not get Telerik version number.", ex);
}
finally
{
AppDomain.Unload(domain);
}
}

private bool AssemblyDependsOnTelerik(string path, AppDomain domain)
{
return this.GetReferencedAssemblyNames(path, domain)
Expand Down
261 changes: 261 additions & 0 deletions DNN Platform/Modules/TelerikRemoval/App_LocalResources/View.ascx.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,261 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema

Version 2.0

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>

There are any number of "resheader" rows that contain simple
name/value pairs.

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="TelerikInstalledAndUsedDamPresentInfo.Text" xml:space="preserve">
<value>Your installation is utilizing Telerik in the following assemblies (including the &lt;strong&gt;Digital Asset Management&lt;/strong&gt; module):</value>
</data>
<data name="TelerikInstalledAndUsedDamRemovedInfo.Text" xml:space="preserve">
<value>Your installation is utilizing Telerik in the following assemblies:</value>
</data>
<data name="TelerikInstalledAndUsedDamPresentWarning.Text" xml:space="preserve">
<value>There are known security issues with the DNN Distributed version of Telerik and the usage of Telerik by DNN modules, such as &lt;strong&gt;Digital Asset Management&lt;/strong&gt;. If you have otherwise complied with Telerik security patching via other means, you should at a minimum uninstall Digital Asset Management and replace it with the newer &lt;strong&gt;Resource Manager&lt;/strong&gt; module. However, if you have not made any security adjustments, the modules listed above should be updated/replaced and then Telerik removed to ensure proper security of your installation.</value>
</data>
<data name="TelerikInstalledAndUsedDamRemovedWarning.Text" xml:space="preserve">
<value>It appears that you have removed a portion of the DNN Platform extensions that depended on Telerik, but we are unable to remove the dependencies listed above for you. However, please ensure that you have in fact properly patched Telerik and removed all DNN Platform distributed Telerik components per the guidance found &lt;a href="https://docs.dnncommunity.org/content/getting-started/setup/telerik-removal/index.html" target="_blank"&gt;here&lt;/a&gt;.</value>
</data>
<data name="TelerikInstalledButNotUsedInfo.Text" xml:space="preserve">
<value>Since your installation does NOT appear to be utilizing any of these components, you should remove them now to improve the security of your application.</value>
</data>
<data name="TelerikInstalledHeading.Text" xml:space="preserve">
<value>Security Alert</value>
</data>
<data name="TelerikInstalledDetected.Text" xml:space="preserve">
<value>We have detected the presence of the previously distributed Telerik developer components. Detected Telerik version is:</value>
</data>
<data name="TelerikInstalledBulletin.Text" xml:space="preserve">
<value>A Security Bulletin was released in August of 2021 that recommends immediate removal of this component due to the high-level security vulnerabilities present. You can read more about this on the &lt;a href="https://dnncommunity.org/security" target="_blank"&gt;DNN Security Center&lt;/a&gt;.</value>
</data>
<data name="TelerikNotInstalledHeading.Text" xml:space="preserve">
<value>Ready for Future Upgrades</value>
</data>
<data name="TelerikNotInstalledInfo.Text" xml:space="preserve">
<value>We have confirmed that you have removed Telerik, which makes your site ready for DNN 10.0.0.</value>
</data>
<data name="TelerikUninstallInfo.Text" xml:space="preserve">
<value>Please note that selecting "Yes" from below will complete &lt;a href="https://docs.dnncommunity.org/content/getting-started/setup/telerik-removal/index.html" target="_blank"&gt;these steps&lt;/a&gt; for you automatically.</value>
</data>
<data name="TelerikUninstallNo.Text" xml:space="preserve">
<value>No, Leave my Site Insecure</value>
</data>
<data name="TelerikUninstallYes.Text" xml:space="preserve">
<value>Yes, Improve my Security &amp; Remove Telerik Now</value>
</data>
<data name="TelerikInvalidAntiForgeryToken.Text" xml:space="preserve">
<value>Invalid Telerik anti-forgery token.</value>
</data>
<data name="SuperUserRequiredHeading.Text" xml:space="preserve">
<value>Super User Required</value>
</data>
<data name="SuperUserRequiredInfo.Text" xml:space="preserve">
<value>This operation requires super-user access level.</value>
</data>
<data name="BackupConfirmation.Text" xml:space="preserve">
<value>I confirm I've taken a backup of my website files and database.</value>
</data>
<data name="UninstallReportHeading.Text" xml:space="preserve">
<value>Telerik Uninstallation Report</value>
</data>
<data name="RemoveTelerik.Text" xml:space="preserve">
<value>Remove Telerik Now</value>
</data>
<data name="UninstallReportNotesColumn.Text" xml:space="preserve">
<value>Notes</value>
</data>
<data name="UninstallReportResultColumn.Text" xml:space="preserve">
<value>Result</value>
</data>
<data name="UninstallReportStepColumn.Text" xml:space="preserve">
<value>Step</value>
</data>
<data name="UninstallStepCleanupExtensionFilesFormat.Text" xml:space="preserve">
<value>Delete files '{0}'</value>
</data>
<data name="UninstallStepUpdateDataTypeListFormat.Text" xml:space="preserve">
<value>Update provider for '{0}' in DataType list</value>
</data>
<data name="UninstallStepUpdateWebConfigFormat.Text" xml:space="preserve">
<value>Web.config: Remove Telerik from {0}</value>
</data>
<data name="UninstallStepCleanupDependencyRecords.Text" xml:space="preserve">
<value>Clean up dependency records for package '{0}'</value>
</data>
<data name="UninstallStepClearCache.Text" xml:space="preserve">
<value>Clear cache</value>
</data>
<data name="UninstallStepCountOfFilesDeleted.Text" xml:space="preserve">
<value>{0} files deleted.</value>
</data>
<data name="UninstallStepCountOfMatchesFound.Text" xml:space="preserve">
<value>{0} matches found.</value>
</data>
<data name="UninstallStepCountOfRecordsAffected.Text" xml:space="preserve">
<value>{0} records affected.</value>
</data>
<data name="UninstallStepInstallPackage.Text" xml:space="preserve">
<value>Install package '{0}'</value>
</data>
<data name="UninstallStepInternalError.Text" xml:space="preserve">
<value>Internal error.</value>
</data>
<data name="UninstallStepModuleNotFoundInPage.Text" xml:space="preserve">
<value>'{0}' module not found in '{1}' page.</value>
</data>
<data name="UninstallStepNoMatchesFound.Text" xml:space="preserve">
<value>No matches found.</value>
</data>
<data name="UninstallStepPackageAlreadyInstalled.Text" xml:space="preserve">
<value>Package '{0}' was already installed.</value>
</data>
<data name="UninstallStepPackageAlreadyUninstalled.Text" xml:space="preserve">
<value>Package '{0}' was already uninstalled.</value>
</data>
<data name="UninstallStepPackageNotFound.Text" xml:space="preserve">
<value>Package file '{0}' was not found.</value>
</data>
<data name="UninstallStepPageNotFoundInPortal.Text" xml:space="preserve">
<value>Page '{0}' not found in portal '{1}'.</value>
</data>
<data name="UninstallStepRemoveBindingRedirects.Text" xml:space="preserve">
<value>Remove Telerik assembly binding redirects</value>
</data>
<data name="UninstallStepRemoveExtension.Text" xml:space="preserve">
<value>Remove extension '{0}'</value>
</data>
<data name="UninstallStepRemoveRewriteRules.Text" xml:space="preserve">
<value>Remove Telerik URL rewrite rules</value>
</data>
<data name="UninstallStepRemoveSystemAttribute.Text" xml:space="preserve">
<value>Remove the 'System' attribute from package '{0}'</value>
</data>
<data name="UninstallStepReplacePageModule.Text" xml:space="preserve">
<value>Replace '{0}' with '{1}' in page '{2}'</value>
</data>
<data name="UninstallStepReplacePortalPageModule.Text" xml:space="preserve">
<value>Replace '{0}' with '{1}' in page '{2}', portal ID '{3}'</value>
</data>
<data name="UninstallStepRequiredPropertiesNotSet.Text" xml:space="preserve">
<value>Following required properties are not set: {0}</value>
</data>
<data name="UninstallStepSectionNotFound.Text" xml:space="preserve">
<value>{0} section not found.</value>
</data>
<data name="UninstallStepUninstallExtension.Text" xml:space="preserve">
<value>Uninstall the '{0}' extension</value>
</data>
</root>
Loading