Migration: added ASC.Migration.BackgroundTasks
This commit is contained in:
parent
c3ac1ecb54
commit
6e39c8d104
@ -79,7 +79,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.EventBus.RabbitMQ", "co
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.EventBus.Extensions.Logger", "common\ASC.EventBus.Extensions.Logger\ASC.EventBus.Extensions.Logger.csproj", "{ED8CEB38-7C95-43A8-B208-9C9828654AC1}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migration", "common\ASC.Migration\ASC.Migration.csproj", "{05B8FF27-446B-49BF-B508-4A4C096D2BB2}"
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.Migration.Core", "common\ASC.Migration\ASC.Migration.Core.csproj", "{05B8FF27-446B-49BF-B508-4A4C096D2BB2}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.ActiveDirectory", "common\ASC.ActiveDirectory\ASC.ActiveDirectory.csproj", "{9F81862F-303D-467F-8DC9-044BE2CCF329}"
|
||||
EndProject
|
||||
@ -91,6 +91,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.ApiSystem", "common\ser
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ASC.ApiCache", "common\services\ASC.ApiCache\ASC.ApiCache.csproj", "{AD4F5F31-625C-472D-BE2C-AD1FB693E065}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ASC.Migration.BackgroundTasks", "common\ASC.Migration.BackgroundTasks\ASC.Migration.BackgroundTasks.csproj", "{7783D579-5A2F-4536-A387-F6E0E0946C07}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@ -257,6 +259,10 @@ Global
|
||||
{AD4F5F31-625C-472D-BE2C-AD1FB693E065}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{AD4F5F31-625C-472D-BE2C-AD1FB693E065}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{AD4F5F31-625C-472D-BE2C-AD1FB693E065}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7783D579-5A2F-4536-A387-F6E0E0946C07}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7783D579-5A2F-4536-A387-F6E0E0946C07}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7783D579-5A2F-4536-A387-F6E0E0946C07}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7783D579-5A2F-4536-A387-F6E0E0946C07}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
@ -18,6 +18,8 @@
|
||||
"common\\ASC.Feed\\ASC.Feed.csproj",
|
||||
"common\\ASC.IPSecurity\\ASC.IPSecurity.csproj",
|
||||
"common\\ASC.MessagingSystem\\ASC.MessagingSystem.csproj",
|
||||
"common\\ASC.Migration.BackgroundTasks\\ASC.Migration.BackgroundTasks.csproj",
|
||||
"common\\ASC.Migration\\ASC.Migration.Core.csproj",
|
||||
"common\\ASC.Notify.Textile\\ASC.Notify.Textile.csproj",
|
||||
"common\\ASC.Textile\\ASC.Textile.csproj",
|
||||
"common\\ASC.Webhooks.Core\\ASC.Webhooks.Core.csproj",
|
||||
|
@ -0,0 +1,12 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\ASC.Migration\ASC.Migration.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
37
common/ASC.Migration.BackgroundTasks/GlobalUsings.cs
Normal file
37
common/ASC.Migration.BackgroundTasks/GlobalUsings.cs
Normal file
@ -0,0 +1,37 @@
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
global using System.Text;
|
||||
|
||||
global using ASC.Api.Core;
|
||||
global using ASC.Api.Core.Extensions;
|
||||
global using ASC.Migration;
|
||||
|
||||
global using Autofac;
|
||||
|
||||
global using Microsoft.Extensions.Hosting.WindowsServices;
|
||||
|
||||
global using NLog;
|
@ -1,88 +1,85 @@
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
var options = new WebApplicationOptions
|
||||
{
|
||||
Args = args,
|
||||
ContentRootPath = WindowsServiceHelpers.IsWindowsService() ? AppContext.BaseDirectory : default
|
||||
};
|
||||
|
||||
var builder = WebApplication.CreateBuilder(options);
|
||||
|
||||
builder.Configuration.AddDefaultConfiguration(builder.Environment)
|
||||
.AddEnvironmentVariables()
|
||||
.AddCommandLine(args);
|
||||
|
||||
var logger = LogManager.Setup()
|
||||
.SetupExtensions(s =>
|
||||
{
|
||||
s.RegisterLayoutRenderer("application-context", (logevent) => AppName);
|
||||
})
|
||||
.LoadConfiguration(builder.Configuration, builder.Environment)
|
||||
.GetLogger(typeof(Startup).Namespace);
|
||||
|
||||
try
|
||||
{
|
||||
logger.Info("Configuring web host ({applicationContext})...", AppName);
|
||||
builder.Host.ConfigureDefault();
|
||||
builder.WebHost.ConfigureDefaultKestrel();
|
||||
|
||||
var startup = new Startup(builder.Configuration, builder.Environment);
|
||||
|
||||
startup.ConfigureServices(builder.Services);
|
||||
|
||||
builder.Host.ConfigureContainer<ContainerBuilder>(containerBuilder =>
|
||||
{
|
||||
startup.ConfigureContainer(containerBuilder);
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
startup.Configure(app, app.Environment);
|
||||
|
||||
logger.Info("Starting web host ({applicationContext})...", AppName);
|
||||
await app.RunWithTasksAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (logger != null)
|
||||
{
|
||||
logger.Error(ex, "Program terminated unexpectedly ({applicationContext})!", AppName);
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux)
|
||||
LogManager.Shutdown();
|
||||
}
|
||||
|
||||
public partial class Program
|
||||
{
|
||||
public static string Namespace = typeof(Startup).Namespace;
|
||||
public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.') + 1);
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
var options = new WebApplicationOptions
|
||||
{
|
||||
Args = args,
|
||||
ContentRootPath = WindowsServiceHelpers.IsWindowsService() ? AppContext.BaseDirectory : default
|
||||
};
|
||||
|
||||
var builder = WebApplication.CreateBuilder(options);
|
||||
|
||||
builder.Configuration.AddDefaultConfiguration(builder.Environment)
|
||||
.AddEnvironmentVariables()
|
||||
.AddCommandLine(args);
|
||||
|
||||
var logger = LogManager.Setup()
|
||||
.SetupExtensions(s =>
|
||||
{
|
||||
s.RegisterLayoutRenderer("application-context", (logevent) => AppName);
|
||||
})
|
||||
.LoadConfiguration(builder.Configuration, builder.Environment)
|
||||
.GetLogger(typeof(Startup).Namespace);
|
||||
|
||||
try
|
||||
{
|
||||
logger.Info("Configuring web host ({applicationContext})...", AppName);
|
||||
builder.Host.ConfigureDefault();
|
||||
builder.WebHost.ConfigureDefaultKestrel();
|
||||
|
||||
var startup = new Startup(builder.Configuration, builder.Environment);
|
||||
|
||||
startup.ConfigureServices(builder.Services);
|
||||
|
||||
builder.Host.ConfigureContainer<ContainerBuilder>(startup.ConfigureContainer);
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
startup.Configure(app, app.Environment);
|
||||
|
||||
logger.Info("Starting web host ({applicationContext})...", AppName);
|
||||
await app.RunWithTasksAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (logger != null)
|
||||
{
|
||||
logger.Error(ex, "Program terminated unexpectedly ({applicationContext})!", AppName);
|
||||
}
|
||||
|
||||
throw;
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Ensure to flush and stop internal timers/threads before application-exit (Avoid segmentation fault on Linux)
|
||||
LogManager.Shutdown();
|
||||
}
|
||||
|
||||
public partial class Program
|
||||
{
|
||||
public static string Namespace = typeof(Startup).Namespace;
|
||||
public static string AppName = Namespace.Substring(Namespace.LastIndexOf('.') + 1);
|
||||
}
|
@ -1,28 +1,28 @@
|
||||
{
|
||||
"profiles": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../Data",
|
||||
"log__name": "migration",
|
||||
"log__dir": "../../Logs",
|
||||
"ASPNETCORE_URLS": "http://localhost:5034",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"launchUrl": "http://localhost:5034",
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../Data",
|
||||
"log__name": "migration",
|
||||
"log__dir": "../../Logs",
|
||||
"ASPNETCORE_URLS": "http://localhost:5034",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
{
|
||||
"profiles": {
|
||||
"Kestrel WebServer": {
|
||||
"commandName": "Project",
|
||||
"launchBrowser": false,
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../Data",
|
||||
"log__name": "migration",
|
||||
"log__dir": "../../Logs",
|
||||
"ASPNETCORE_URLS": "http://localhost:5034",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
},
|
||||
"WSL 2 : Ubuntu 20.04": {
|
||||
"commandName": "WSL2",
|
||||
"launchBrowser": false,
|
||||
"launchUrl": "http://localhost:5034",
|
||||
"environmentVariables": {
|
||||
"$STORAGE_ROOT": "../../Data",
|
||||
"log__name": "migration",
|
||||
"log__dir": "../../Logs",
|
||||
"ASPNETCORE_URLS": "http://localhost:5034",
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"distributionName": "Ubuntu-20.04"
|
||||
}
|
||||
}
|
||||
}
|
@ -1,45 +1,45 @@
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace ASC.Migration;
|
||||
|
||||
public class Startup : BaseStartup
|
||||
{
|
||||
public Startup(IConfiguration configuration, IHostEnvironment hostEnvironment)
|
||||
: base(configuration, hostEnvironment)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
|
||||
services.AddMemoryCache();
|
||||
|
||||
base.ConfigureServices(services);
|
||||
}
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace ASC.Migration;
|
||||
|
||||
public class Startup : BaseStartup
|
||||
{
|
||||
public Startup(IConfiguration configuration, IHostEnvironment hostEnvironment)
|
||||
: base(configuration, hostEnvironment)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void ConfigureServices(IServiceCollection services)
|
||||
{
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
|
||||
services.AddMemoryCache();
|
||||
|
||||
base.ConfigureServices(services);
|
||||
}
|
||||
}
|
3
common/ASC.Migration.BackgroundTasks/appsettings.json
Normal file
3
common/ASC.Migration.BackgroundTasks/appsettings.json
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"pathToConf": "..\\..\\..\\config"
|
||||
}
|
@ -1,17 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
|
||||
<AssemblyTitle>ASC.Migration</AssemblyTitle>
|
||||
<AssemblyTitle>ASC.Migration.Core</AssemblyTitle>
|
||||
<Company>Ascensio System SIA</Company>
|
||||
<Product>ASC.Migration</Product>
|
||||
<Copyright>(c) Ascensio System SIA. All rights reserved</Copyright>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<RazorCompileOnBuild>false</RazorCompileOnBuild>
|
||||
<GenerateMvcApplicationPartsAssemblyAttributes>false</GenerateMvcApplicationPartsAssemblyAttributes>
|
||||
<DisableImplicitComponentsAnalyzers>true</DisableImplicitComponentsAnalyzers>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
@ -20,15 +17,34 @@
|
||||
<NoWarn>1701;1702;NU1701</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FolkerKinzel.VCards" Version="4.0.0" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
|
||||
<PackageReference Include="Ical.Net" Version="4.2.0" />
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FolkerKinzel.VCards" Version="4.0.0" />
|
||||
<PackageReference Include="HtmlAgilityPack" Version="1.11.46" />
|
||||
<PackageReference Include="Ical.Net" Version="4.2.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\products\ASC.Files\Core\ASC.Files.Core.csproj" />
|
||||
<ProjectReference Include="..\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\products\ASC.Files\Core\ASC.Files.Core.csproj" />
|
||||
<ProjectReference Include="..\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Update="Resources\MigrationResource.Designer.cs">
|
||||
<DesignTime>True</DesignTime>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>MigrationResource.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Update="Resources\MigrationResource.resx">
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>MigrationResource.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
@ -26,36 +26,26 @@
|
||||
|
||||
global using System.IO.Compression;
|
||||
global using System.Reflection;
|
||||
global using System.Runtime.Caching;
|
||||
global using System.Runtime.Serialization;
|
||||
global using System.Text;
|
||||
global using System.Text.Json.Serialization;
|
||||
global using System.Text.RegularExpressions;
|
||||
|
||||
global using ASC.Api.Core;
|
||||
global using ASC.Api.Core.Extensions;
|
||||
global using ASC.Common;
|
||||
global using ASC.Common.Caching;
|
||||
global using ASC.Common.Log;
|
||||
global using ASC.Common.Web;
|
||||
global using ASC.Core;
|
||||
global using ASC.Core.Users;
|
||||
global using ASC.Files.Core;
|
||||
global using ASC.Files.Core.Resources;
|
||||
global using ASC.Files.Core.Security;
|
||||
global using ASC.Migration;
|
||||
global using ASC.Migration.ApiModels.ResponseDto;
|
||||
global using ASC.Migration.Core;
|
||||
global using ASC.Migration.Core.Models;
|
||||
global using ASC.Migration.Core.Models.Api;
|
||||
global using ASC.Migration.Core.Resources;
|
||||
global using ASC.Migration.GoogleWorkspace.Models;
|
||||
global using ASC.Migration.GoogleWorkspace.Models.Parse;
|
||||
global using ASC.Migration.Resources;
|
||||
global using ASC.Web.Api.Routing;
|
||||
global using ASC.Web.Core.Files;
|
||||
global using ASC.Web.Files.Classes;
|
||||
global using ASC.Web.Files.Services.WCFService;
|
||||
global using ASC.Web.Studio.Core.Notify;
|
||||
|
||||
global using Autofac;
|
||||
|
||||
@ -63,11 +53,8 @@ global using HtmlAgilityPack;
|
||||
|
||||
global using Ical.Net;
|
||||
|
||||
global using Microsoft.AspNetCore.Mvc;
|
||||
global using Microsoft.Extensions.Hosting.WindowsServices;
|
||||
global using Microsoft.Extensions.Logging;
|
||||
|
||||
global using MimeKit;
|
||||
|
||||
global using Newtonsoft.Json;
|
||||
|
||||
global using NLog;
|
||||
|
@ -8,7 +8,7 @@
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace ASC.Migration.Resources {
|
||||
namespace ASC.Migration.Core.Resources {
|
||||
using System;
|
||||
|
||||
|
||||
@ -19,10 +19,10 @@ namespace ASC.Migration.Resources {
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class MigrationResource {
|
||||
public class MigrationResource {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
@ -36,10 +36,10 @@ namespace ASC.Migration.Resources {
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
public static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASC.Migration.Resources.MigrationResource", typeof(MigrationResource).Assembly);
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ASC.Migration.Core.Resources.MigrationResource", typeof(MigrationResource).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
@ -51,7 +51,7 @@ namespace ASC.Migration.Resources {
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
public static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
@ -63,7 +63,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Clearing temporary data.
|
||||
/// </summary>
|
||||
internal static string ClearingTemporaryData {
|
||||
public static string ClearingTemporaryData {
|
||||
get {
|
||||
return ResourceManager.GetString("ClearingTemporaryData", resourceCulture);
|
||||
}
|
||||
@ -72,7 +72,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Data processing....
|
||||
/// </summary>
|
||||
internal static string DataProcessing {
|
||||
public static string DataProcessing {
|
||||
get {
|
||||
return ResourceManager.GetString("DataProcessing", resourceCulture);
|
||||
}
|
||||
@ -81,7 +81,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Data processing completed.
|
||||
/// </summary>
|
||||
internal static string DataProcessingCompleted {
|
||||
public static string DataProcessingCompleted {
|
||||
get {
|
||||
return ResourceManager.GetString("DataProcessingCompleted", resourceCulture);
|
||||
}
|
||||
@ -90,7 +90,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Database parsing.
|
||||
/// </summary>
|
||||
internal static string DumpParse {
|
||||
public static string DumpParse {
|
||||
get {
|
||||
return ResourceManager.GetString("DumpParse", resourceCulture);
|
||||
}
|
||||
@ -99,7 +99,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Mail`s Contacts.
|
||||
/// </summary>
|
||||
internal static string GoogleModuleNameContacts {
|
||||
public static string GoogleModuleNameContacts {
|
||||
get {
|
||||
return ResourceManager.GetString("GoogleModuleNameContacts", resourceCulture);
|
||||
}
|
||||
@ -108,7 +108,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Google Drive`s Files.
|
||||
/// </summary>
|
||||
internal static string GoogleModuleNameDocuments {
|
||||
public static string GoogleModuleNameDocuments {
|
||||
get {
|
||||
return ResourceManager.GetString("GoogleModuleNameDocuments", resourceCulture);
|
||||
}
|
||||
@ -117,7 +117,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Group migration {0} ({1}/{2}).
|
||||
/// </summary>
|
||||
internal static string GroupMigration {
|
||||
public static string GroupMigration {
|
||||
get {
|
||||
return ResourceManager.GetString("GroupMigration", resourceCulture);
|
||||
}
|
||||
@ -126,7 +126,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Migrating user contacts {0} ({1}/{2}).
|
||||
/// </summary>
|
||||
internal static string MigratingUserContacts {
|
||||
public static string MigratingUserContacts {
|
||||
get {
|
||||
return ResourceManager.GetString("MigratingUserContacts", resourceCulture);
|
||||
}
|
||||
@ -135,7 +135,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Migrating user files {0} ({1}/{2}).
|
||||
/// </summary>
|
||||
internal static string MigratingUserFiles {
|
||||
public static string MigratingUserFiles {
|
||||
get {
|
||||
return ResourceManager.GetString("MigratingUserFiles", resourceCulture);
|
||||
}
|
||||
@ -144,7 +144,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Migration canceled.
|
||||
/// </summary>
|
||||
internal static string MigrationCanceled {
|
||||
public static string MigrationCanceled {
|
||||
get {
|
||||
return ResourceManager.GetString("MigrationCanceled", resourceCulture);
|
||||
}
|
||||
@ -153,16 +153,61 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Migration completed.
|
||||
/// </summary>
|
||||
internal static string MigrationCompleted {
|
||||
public static string MigrationCompleted {
|
||||
get {
|
||||
return ResourceManager.GetString("MigrationCompleted", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error while initializing {0} migrator.
|
||||
/// </summary>
|
||||
public static string MigrationInitException {
|
||||
get {
|
||||
return ResourceManager.GetString("MigrationInitException", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to No such migration provider.
|
||||
/// </summary>
|
||||
public static string MigrationNotFoundException {
|
||||
get {
|
||||
return ResourceManager.GetString("MigrationNotFoundException", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to No migration is in progress.
|
||||
/// </summary>
|
||||
public static string MigrationProgressException {
|
||||
get {
|
||||
return ResourceManager.GetString("MigrationProgressException", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Parsing is still in progress.
|
||||
/// </summary>
|
||||
public static string MigrationStartException {
|
||||
get {
|
||||
return ResourceManager.GetString("MigrationStartException", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Migration is already in progress.
|
||||
/// </summary>
|
||||
public static string MigrationUploadException {
|
||||
get {
|
||||
return ResourceManager.GetString("MigrationUploadException", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Calendar.
|
||||
/// </summary>
|
||||
internal static string ModuleNameCalendar {
|
||||
public static string ModuleNameCalendar {
|
||||
get {
|
||||
return ResourceManager.GetString("ModuleNameCalendar", resourceCulture);
|
||||
}
|
||||
@ -171,7 +216,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Groups.
|
||||
/// </summary>
|
||||
internal static string ModuleNameGroups {
|
||||
public static string ModuleNameGroups {
|
||||
get {
|
||||
return ResourceManager.GetString("ModuleNameGroups", resourceCulture);
|
||||
}
|
||||
@ -180,7 +225,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Mail.
|
||||
/// </summary>
|
||||
internal static string ModuleNameMail {
|
||||
public static string ModuleNameMail {
|
||||
get {
|
||||
return ResourceManager.GetString("ModuleNameMail", resourceCulture);
|
||||
}
|
||||
@ -189,7 +234,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Users.
|
||||
/// </summary>
|
||||
internal static string ModuleNameUsers {
|
||||
public static string ModuleNameUsers {
|
||||
get {
|
||||
return ResourceManager.GetString("ModuleNameUsers", resourceCulture);
|
||||
}
|
||||
@ -198,7 +243,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Contacts.
|
||||
/// </summary>
|
||||
internal static string NextcloudModuleNameContacts {
|
||||
public static string NextcloudModuleNameContacts {
|
||||
get {
|
||||
return ResourceManager.GetString("NextcloudModuleNameContacts", resourceCulture);
|
||||
}
|
||||
@ -207,7 +252,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to User`s Files.
|
||||
/// </summary>
|
||||
internal static string NextcloudModuleNameDocuments {
|
||||
public static string NextcloudModuleNameDocuments {
|
||||
get {
|
||||
return ResourceManager.GetString("NextcloudModuleNameDocuments", resourceCulture);
|
||||
}
|
||||
@ -216,7 +261,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Calendar.
|
||||
/// </summary>
|
||||
internal static string OnlyofficeModuleNameCalendar {
|
||||
public static string OnlyofficeModuleNameCalendar {
|
||||
get {
|
||||
return ResourceManager.GetString("OnlyofficeModuleNameCalendar", resourceCulture);
|
||||
}
|
||||
@ -225,7 +270,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Documents.
|
||||
/// </summary>
|
||||
internal static string OnlyofficeModuleNameDocuments {
|
||||
public static string OnlyofficeModuleNameDocuments {
|
||||
get {
|
||||
return ResourceManager.GetString("OnlyofficeModuleNameDocuments", resourceCulture);
|
||||
}
|
||||
@ -234,7 +279,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Mail.
|
||||
/// </summary>
|
||||
internal static string OnlyofficeModuleNameMail {
|
||||
public static string OnlyofficeModuleNameMail {
|
||||
get {
|
||||
return ResourceManager.GetString("OnlyofficeModuleNameMail", resourceCulture);
|
||||
}
|
||||
@ -243,7 +288,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to People.
|
||||
/// </summary>
|
||||
internal static string OnlyofficeModuleNamePeople {
|
||||
public static string OnlyofficeModuleNamePeople {
|
||||
get {
|
||||
return ResourceManager.GetString("OnlyofficeModuleNamePeople", resourceCulture);
|
||||
}
|
||||
@ -252,7 +297,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Preparing for migration.
|
||||
/// </summary>
|
||||
internal static string PreparingForMigration {
|
||||
public static string PreparingForMigration {
|
||||
get {
|
||||
return ResourceManager.GetString("PreparingForMigration", resourceCulture);
|
||||
}
|
||||
@ -261,7 +306,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Starting data processing....
|
||||
/// </summary>
|
||||
internal static string StartOfDataProcessing {
|
||||
public static string StartOfDataProcessing {
|
||||
get {
|
||||
return ResourceManager.GetString("StartOfDataProcessing", resourceCulture);
|
||||
}
|
||||
@ -270,7 +315,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unzipping....
|
||||
/// </summary>
|
||||
internal static string Unzipping {
|
||||
public static string Unzipping {
|
||||
get {
|
||||
return ResourceManager.GetString("Unzipping", resourceCulture);
|
||||
}
|
||||
@ -279,7 +324,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Unzipping completed....
|
||||
/// </summary>
|
||||
internal static string UnzippingFinished {
|
||||
public static string UnzippingFinished {
|
||||
get {
|
||||
return ResourceManager.GetString("UnzippingFinished", resourceCulture);
|
||||
}
|
||||
@ -288,7 +333,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to User calendar migration {0} ({1}/{2}).
|
||||
/// </summary>
|
||||
internal static string UserCalendarMigration {
|
||||
public static string UserCalendarMigration {
|
||||
get {
|
||||
return ResourceManager.GetString("UserCalendarMigration", resourceCulture);
|
||||
}
|
||||
@ -297,7 +342,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to User migration {0} ({1}/{2}).
|
||||
/// </summary>
|
||||
internal static string UserMigration {
|
||||
public static string UserMigration {
|
||||
get {
|
||||
return ResourceManager.GetString("UserMigration", resourceCulture);
|
||||
}
|
||||
@ -306,7 +351,7 @@ namespace ASC.Migration.Resources {
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Failed to import user: {0} ({1}/{2}).
|
||||
/// </summary>
|
||||
internal static string UserSkipped {
|
||||
public static string UserSkipped {
|
||||
get {
|
||||
return ResourceManager.GetString("UserSkipped", resourceCulture);
|
||||
}
|
||||
|
@ -150,6 +150,21 @@
|
||||
<data name="MigrationCompleted" xml:space="preserve">
|
||||
<value>Migration completed</value>
|
||||
</data>
|
||||
<data name="MigrationInitException" xml:space="preserve">
|
||||
<value>Error while initializing {0} migrator</value>
|
||||
</data>
|
||||
<data name="MigrationNotFoundException" xml:space="preserve">
|
||||
<value>No such migration provider</value>
|
||||
</data>
|
||||
<data name="MigrationProgressException" xml:space="preserve">
|
||||
<value>No migration is in progress</value>
|
||||
</data>
|
||||
<data name="MigrationStartException" xml:space="preserve">
|
||||
<value>Parsing is still in progress</value>
|
||||
</data>
|
||||
<data name="MigrationUploadException" xml:space="preserve">
|
||||
<value>Migration is already in progress</value>
|
||||
</data>
|
||||
<data name="ModuleNameCalendar" xml:space="preserve">
|
||||
<value>Calendar</value>
|
||||
</data>
|
||||
|
@ -49,6 +49,7 @@
|
||||
<ProjectReference Include="..\..\common\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
<ProjectReference Include="..\..\common\ASC.Data.Backup.Core\ASC.Data.Backup.Core.csproj" />
|
||||
<ProjectReference Include="..\..\common\ASC.Feed\ASC.Feed.csproj" />
|
||||
<ProjectReference Include="..\..\common\ASC.Migration\ASC.Migration.Core.csproj" />
|
||||
<ProjectReference Include="..\..\common\services\ASC.AuditTrail\ASC.AuditTrail.csproj" />
|
||||
<ProjectReference Include="..\ASC.Web.Core\ASC.Web.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
@ -1,61 +1,63 @@
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
using ASC.Migration.Core.Resources;
|
||||
|
||||
namespace ASC.Api.Migration;
|
||||
|
||||
|
||||
[Scope]
|
||||
[DefaultRoute]
|
||||
[ApiController]
|
||||
public class MigrationController : ControllerBase
|
||||
{
|
||||
private const string MigrationCacheKey = "ASC.Migration.Ongoing";
|
||||
private readonly CoreBaseSettings _coreBaseSettings;
|
||||
private readonly UserManager _userManager;
|
||||
private readonly AuthContext _authContext;
|
||||
private readonly TempPath _tempPath;
|
||||
private readonly StudioNotifyService _studioNotifyService;
|
||||
private readonly ICache _cache;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
public MigrationController(
|
||||
CoreBaseSettings coreBaseSettings,
|
||||
UserManager userManager,
|
||||
AuthContext authContext,
|
||||
TempPath tempPath,
|
||||
StudioNotifyService studioNotifyService,
|
||||
ICache cache,
|
||||
{
|
||||
private const string MigrationCacheKey = "ASC.Migration.Ongoing";
|
||||
private readonly CoreBaseSettings _coreBaseSettings;
|
||||
private readonly UserManager _userManager;
|
||||
private readonly AuthContext _authContext;
|
||||
private readonly TempPath _tempPath;
|
||||
private readonly StudioNotifyService _studioNotifyService;
|
||||
private readonly ICache _cache;
|
||||
private readonly IHttpContextAccessor _httpContextAccessor;
|
||||
|
||||
public MigrationController(
|
||||
CoreBaseSettings coreBaseSettings,
|
||||
UserManager userManager,
|
||||
AuthContext authContext,
|
||||
TempPath tempPath,
|
||||
StudioNotifyService studioNotifyService,
|
||||
ICache cache,
|
||||
IHttpContextAccessor httpContextAccessor)
|
||||
{
|
||||
_coreBaseSettings = coreBaseSettings;
|
||||
_userManager = userManager;
|
||||
_authContext = authContext;
|
||||
_tempPath = tempPath;
|
||||
_studioNotifyService = studioNotifyService;
|
||||
_cache = cache;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
{
|
||||
_coreBaseSettings = coreBaseSettings;
|
||||
_userManager = userManager;
|
||||
_authContext = authContext;
|
||||
_tempPath = tempPath;
|
||||
_studioNotifyService = studioNotifyService;
|
||||
_cache = cache;
|
||||
_httpContextAccessor = httpContextAccessor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -65,11 +67,11 @@ public class MigrationController : ControllerBase
|
||||
[HttpGet("backuptmp")]
|
||||
public async Task<string> GetTmpFolderAsync()
|
||||
{
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new System.Security.SecurityException();
|
||||
}
|
||||
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new SecurityException(Resource.ErrorAccessDenied);
|
||||
}
|
||||
|
||||
var tempFolder = Path.Combine(_tempPath.GetTempPath(), "migration", DateTime.Now.ToString("dd.MM.yyyy_HH_mm"));
|
||||
|
||||
if (!Directory.Exists(tempFolder))
|
||||
@ -86,11 +88,11 @@ public class MigrationController : ControllerBase
|
||||
[HttpGet("list")]
|
||||
public async Task<string[]> ListAsync()
|
||||
{
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new System.Security.SecurityException();
|
||||
}
|
||||
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new SecurityException(Resource.ErrorAccessDenied);
|
||||
}
|
||||
|
||||
return MigrationCore.GetAvailableMigrations();
|
||||
}
|
||||
|
||||
@ -102,20 +104,20 @@ public class MigrationController : ControllerBase
|
||||
[HttpPost("init/{migratorName}")]
|
||||
public async Task UploadAndInitAsync(string migratorName, string path)
|
||||
{
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new System.Security.SecurityException();
|
||||
}
|
||||
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new SecurityException(Resource.ErrorAccessDenied);
|
||||
}
|
||||
|
||||
if (GetOngoingMigration() != null)
|
||||
{
|
||||
throw new Exception("Migration is already in progress");
|
||||
throw new Exception(MigrationResource.MigrationUploadException);
|
||||
}
|
||||
|
||||
var migratorMeta = MigrationCore.GetMigrator(migratorName);
|
||||
if (migratorMeta == null)
|
||||
{
|
||||
throw new ItemNotFoundException("No such migration provider");
|
||||
throw new ItemNotFoundException(MigrationResource.MigrationNotFoundException);
|
||||
}
|
||||
var cts = new CancellationTokenSource();
|
||||
var migrator = (IMigration)Activator.CreateInstance(migratorMeta.MigratorType);
|
||||
@ -125,7 +127,7 @@ public class MigrationController : ControllerBase
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw new Exception($"Error while initializing {migratorMeta.MigratorInfo.Name} migrator", ex);
|
||||
throw new Exception(string.Format(MigrationResource.MigrationUploadException, migratorMeta.MigratorInfo.Name), ex);
|
||||
}
|
||||
|
||||
var ongoingMigration = new OngoingMigration { Migration = migrator, CancelTokenSource = cts };
|
||||
@ -141,11 +143,11 @@ public class MigrationController : ControllerBase
|
||||
[HttpGet("status")]
|
||||
public async Task<object> Status()
|
||||
{
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new System.Security.SecurityException();
|
||||
}
|
||||
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new SecurityException(Resource.ErrorAccessDenied);
|
||||
}
|
||||
|
||||
var ongoingMigration = GetOngoingMigration();
|
||||
if (ongoingMigration == null)
|
||||
{
|
||||
@ -175,15 +177,15 @@ public class MigrationController : ControllerBase
|
||||
[HttpPost("cancel")]
|
||||
public async Task CancelAsync()
|
||||
{
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new System.Security.SecurityException();
|
||||
}
|
||||
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new SecurityException(Resource.ErrorAccessDenied);
|
||||
}
|
||||
|
||||
var ongoingMigration = GetOngoingMigration();
|
||||
if (ongoingMigration == null)
|
||||
{
|
||||
throw new Exception("No migration is in progress");
|
||||
throw new Exception(MigrationResource.MigrationProgressException);
|
||||
}
|
||||
ongoingMigration.CancelTokenSource.Cancel();
|
||||
}
|
||||
@ -195,19 +197,19 @@ public class MigrationController : ControllerBase
|
||||
[HttpPost("migrate")]
|
||||
public async Task MigrateAsync(MigrationApiInfo info)
|
||||
{
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new System.Security.SecurityException();
|
||||
}
|
||||
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new SecurityException(Resource.ErrorAccessDenied);
|
||||
}
|
||||
|
||||
var ongoingMigration = GetOngoingMigration();
|
||||
if (ongoingMigration == null)
|
||||
{
|
||||
throw new Exception("No migration is in progress");
|
||||
throw new Exception(MigrationResource.MigrationProgressException);
|
||||
}
|
||||
else if (!ongoingMigration.ParseTask.IsCompleted)
|
||||
{
|
||||
throw new Exception("Parsing is still in progress");
|
||||
throw new Exception(MigrationResource.MigrationStartException);
|
||||
}
|
||||
|
||||
ongoingMigration.MigrationTask = ongoingMigration.Migration.Migrate(info);
|
||||
@ -220,19 +222,19 @@ public class MigrationController : ControllerBase
|
||||
[HttpGet("logs")]
|
||||
public async Task LogsAsync()
|
||||
{
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new System.Security.SecurityException();
|
||||
}
|
||||
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new SecurityException(Resource.ErrorAccessDenied);
|
||||
}
|
||||
|
||||
var ongoingMigration = GetOngoingMigration();
|
||||
if (ongoingMigration == null)
|
||||
{
|
||||
throw new Exception("No migration is in progress");
|
||||
}
|
||||
|
||||
_httpContextAccessor.HttpContext.Response.Headers.Add("Content-Disposition", ContentDispositionUtil.GetHeaderValue("migration.log"));
|
||||
_httpContextAccessor.HttpContext.Response.ContentType = "text/plain; charset=UTF-8";
|
||||
throw new Exception(MigrationResource.MigrationProgressException);
|
||||
}
|
||||
|
||||
_httpContextAccessor.HttpContext.Response.Headers.Add("Content-Disposition", ContentDispositionUtil.GetHeaderValue("migration.log"));
|
||||
_httpContextAccessor.HttpContext.Response.ContentType = "text/plain; charset=UTF-8";
|
||||
await ongoingMigration.Migration.GetLogs().CopyToAsync(_httpContextAccessor.HttpContext.Response.Body);
|
||||
}
|
||||
|
||||
@ -243,17 +245,17 @@ public class MigrationController : ControllerBase
|
||||
[HttpPost("finish")]
|
||||
public async Task FinishAsync(bool isSendWelcomeEmail)
|
||||
{
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new System.Security.SecurityException();
|
||||
}
|
||||
|
||||
if (!_coreBaseSettings.Standalone || !await _userManager.IsDocSpaceAdminAsync(_authContext.CurrentAccount.ID))
|
||||
{
|
||||
throw new SecurityException(Resource.ErrorAccessDenied);
|
||||
}
|
||||
|
||||
if (isSendWelcomeEmail)
|
||||
{
|
||||
var ongoingMigration = GetOngoingMigration();
|
||||
if (ongoingMigration == null)
|
||||
{
|
||||
throw new Exception("No migration is in progress");
|
||||
throw new Exception(MigrationResource.MigrationProgressException);
|
||||
}
|
||||
var guidUsers = ongoingMigration.Migration.GetGuidImportedUsers();
|
||||
foreach (var gu in guidUsers)
|
||||
@ -263,9 +265,9 @@ public class MigrationController : ControllerBase
|
||||
}
|
||||
}
|
||||
ClearCache();
|
||||
}
|
||||
|
||||
// ToDo: Use ASCCache
|
||||
}
|
||||
|
||||
// ToDo: Use ASCCache
|
||||
private void StoreOngoingMigration(OngoingMigration migration)
|
||||
{
|
||||
_cache.Insert(MigrationCacheKey, migration, TimeSpan.FromDays(1));
|
||||
@ -277,7 +279,7 @@ public class MigrationController : ControllerBase
|
||||
}
|
||||
|
||||
private void ClearCache()
|
||||
{
|
||||
{
|
||||
_cache.Remove(MigrationCacheKey);
|
||||
}
|
||||
|
@ -1,30 +1,30 @@
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace ASC.Migration.ApiModels.ResponseDto;
|
||||
// (c) Copyright Ascensio System SIA 2010-2022
|
||||
//
|
||||
// This program is a free software product.
|
||||
// You can redistribute it and/or modify it under the terms
|
||||
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
|
||||
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
|
||||
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
|
||||
// any third-party rights.
|
||||
//
|
||||
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
|
||||
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
|
||||
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
||||
//
|
||||
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
|
||||
//
|
||||
// The interactive user interfaces in modified source and object code versions of the Program must
|
||||
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
|
||||
//
|
||||
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
|
||||
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
|
||||
// trademark law for use of our trademarks.
|
||||
//
|
||||
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
|
||||
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
|
||||
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
||||
|
||||
namespace ASC.Web.Api.ApiModels.ResponseDto;
|
||||
|
||||
public class MigrationStatus
|
||||
{
|
@ -29,6 +29,8 @@ global using System.Globalization;
|
||||
global using System.Net;
|
||||
global using System.Net.Mail;
|
||||
global using System.Net.Sockets;
|
||||
global using System.Reflection;
|
||||
global using System.Runtime.Caching;
|
||||
global using System.Security;
|
||||
global using System.ServiceModel.Security;
|
||||
global using System.Text;
|
||||
@ -56,7 +58,6 @@ global using ASC.AuditTrail.Types;
|
||||
global using ASC.Common;
|
||||
global using ASC.Common.Caching;
|
||||
global using ASC.Common.Log;
|
||||
global using ASC.Web.Core.RemovePortal;
|
||||
global using ASC.Common.Mapping;
|
||||
global using ASC.Common.Radicale;
|
||||
global using ASC.Common.Radicale.Core;
|
||||
@ -96,13 +97,15 @@ global using ASC.Feed.Data;
|
||||
global using ASC.Files.Core.Core;
|
||||
global using ASC.Files.Core.EF;
|
||||
global using ASC.Files.Core.Helpers;
|
||||
global using ASC.Files.Core.VirtualRooms;
|
||||
global using ASC.Files.Core.Security;
|
||||
global using ASC.Files.Core.VirtualRooms;
|
||||
global using ASC.Geolocation;
|
||||
global using ASC.IPSecurity;
|
||||
global using ASC.MessagingSystem;
|
||||
global using ASC.MessagingSystem.Core;
|
||||
global using ASC.MessagingSystem.EF.Model;
|
||||
global using ASC.Migration.Core;
|
||||
global using ASC.Migration.Core.Models.Api;
|
||||
global using ASC.Notify.Cron;
|
||||
global using ASC.Security.Cryptography;
|
||||
global using ASC.Web.Api;
|
||||
@ -116,11 +119,13 @@ global using ASC.Web.Api.Mapping;
|
||||
global using ASC.Web.Api.Models;
|
||||
global using ASC.Web.Api.Routing;
|
||||
global using ASC.Web.Core;
|
||||
global using ASC.Web.Core.Files;
|
||||
global using ASC.Web.Core.Helpers;
|
||||
global using ASC.Web.Core.Mobile;
|
||||
global using ASC.Web.Core.Notify;
|
||||
global using ASC.Web.Core.PublicResources;
|
||||
global using ASC.Web.Core.Quota;
|
||||
global using ASC.Web.Core.RemovePortal;
|
||||
global using ASC.Web.Core.Sms;
|
||||
global using ASC.Web.Core.Users;
|
||||
global using ASC.Web.Core.Utility;
|
||||
|
Loading…
Reference in New Issue
Block a user