Merge branch 'develop' into feature/tree-menu-bugfix

This commit is contained in:
Nikita Gopienko 2021-06-16 13:47:56 +03:00
commit 0ff78c5192
27 changed files with 62 additions and 54 deletions

Binary file not shown.

Binary file not shown.

2
build/Jenkinsfile vendored
View File

@ -36,7 +36,7 @@ pipeline {
}
}
stage('Test') {
when { expression { return env.CHANGE_ID; } }
when { expression { return env.CHANGE_ID != null } }
parallel {
stage('Unix') {
agent { label 'net-core' }

View File

@ -42,6 +42,7 @@
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
<PackageReference Include="Microsoft.Windows.Compatibility" Version="5.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<!-- <PackageReference Include="Microsoft.CodeQuality.Analyzers" Version="2.9.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

View File

@ -8,7 +8,6 @@
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
</ItemGroup>
<ItemGroup>

View File

@ -17,7 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AppLimit.CloudComputing.SharpBox" Version="1.1.0.451" />
<PackageReference Include="AppLimit.CloudComputing.SharpBox" Version="1.1.0.453" />
<PackageReference Include="Box.V2.Core" Version="3.24.0" />
<PackageReference Include="DocuSign.eSign.dll" Version="4.4.1" />
<PackageReference Include="Dropbox.Api" Version="4.10.0" />
@ -26,7 +26,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.OneDriveSDK" Version="2.0.7.5" />
<PackageReference Include="Microsoft.OneDriveSDK" Version="2.0.7.6" />
<PackageReference Include="Microsoft.SharePoint.Client" Version="14.0.4762.1000" />
<PackageReference Include="SharpCompress" Version="0.26.0" />
<PackageReference Include="SharpZipLib" Version="1.3.2" />

View File

@ -28,6 +28,7 @@ namespace ASC.Web.Files.Core.Compress
/// <summary>
/// Archives the data stream into the format .tar.gz
/// </summary>
[Scope]
public class CompressToTarGz : ICompress
{
private GZipOutputStream gzoStream;
@ -35,7 +36,7 @@ namespace ASC.Web.Files.Core.Compress
private TarEntry tarEntry;
private TempStream TempStream { get; }
internal CompressToTarGz(TempStream tempStream)
public CompressToTarGz(TempStream tempStream)
{
TempStream = tempStream;
}

View File

@ -26,13 +26,14 @@ namespace ASC.Web.Files.Core.Compress
/// <summary>
/// Archives the data stream into the format .zip
/// </summary>
[Scope]
public class CompressToZip : ICompress
{
private ZipOutputStream zipStream;
private ZipEntry zipEntry;
private TempStream TempStream { get; }
internal CompressToZip(TempStream tempStream)
public CompressToZip(TempStream tempStream)
{
TempStream = tempStream;
}

View File

@ -116,7 +116,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
}
if (root != null)
{
Status += string.Format("folder_{0}{1}", root.ID, SPLIT_CHAR);
Result += string.Format("folder_{0}{1}", root.ID, SPLIT_CHAR);
}
DeleteFiles(Files, scope);

View File

@ -89,8 +89,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
using var scope = ThirdPartyOperation.CreateScope();
var scopeClass = scope.ServiceProvider.GetService<FileDownloadOperationScope>();
var zip = scope.ServiceProvider.GetService<CompressToArchive>();
var (globalStore, filesLinkUtility, _, _, _) = scopeClass;
var (zip, globalStore, filesLinkUtility, _, _, _) = scopeClass;
using var stream = TempStream.Create();
var writerOptions = new ZipWriterOptions(CompressionType.Deflate);
@ -119,7 +118,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
stream,
MimeMapping.GetMimeMapping(path),
"attachment; filename=\"" + fileName + "\"");
Status = string.Format("{0}?{1}=bulk&ext={2}", filesLinkUtility.FileHandlerPath, FilesLinkUtility.Action, zip.ArchiveExtension);
Result = string.Format("{0}?{1}=bulk&ext={2}", filesLinkUtility.FileHandlerPath, FilesLinkUtility.Action, zip.ArchiveExtension);
}
FillDistributedTask();
@ -244,7 +243,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
{
if (entriesPathId == null) return;
var scopeClass = scope.ServiceProvider.GetService<FileDownloadOperationScope>();
var (_, _, _, fileConverter, filesMessageService) = scopeClass;
var (_, _, _, _, fileConverter, filesMessageService) = scopeClass;
var FileDao = scope.ServiceProvider.GetService<IFileDao<T>>();
foreach (var path in entriesPathId.AllKeys)
@ -430,18 +429,27 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
private SetupInfo SetupInfo { get; }
private FileConverter FileConverter { get; }
private FilesMessageService FilesMessageService { get; }
private CompressToArchive CompressToArchive { get; }
public FileDownloadOperationScope(GlobalStore globalStore, FilesLinkUtility filesLinkUtility, SetupInfo setupInfo, FileConverter fileConverter, FilesMessageService filesMessageService)
public FileDownloadOperationScope(
GlobalStore globalStore,
FilesLinkUtility filesLinkUtility,
SetupInfo setupInfo,
FileConverter fileConverter,
FilesMessageService filesMessageService,
CompressToArchive compressToArchive)
{
GlobalStore = globalStore;
FilesLinkUtility = filesLinkUtility;
SetupInfo = setupInfo;
FileConverter = fileConverter;
FilesMessageService = filesMessageService;
CompressToArchive = compressToArchive;
}
public void Deconstruct(out GlobalStore globalStore, out FilesLinkUtility filesLinkUtility, out SetupInfo setupInfo, out FileConverter fileConverter, out FilesMessageService filesMessageService)
public void Deconstruct(out CompressToArchive compressToArchive, out GlobalStore globalStore, out FilesLinkUtility filesLinkUtility, out SetupInfo setupInfo, out FileConverter fileConverter, out FilesMessageService filesMessageService)
{
compressToArchive = CompressToArchive;
globalStore = GlobalStore;
filesLinkUtility = FilesLinkUtility;
setupInfo = SetupInfo;

View File

@ -133,7 +133,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
rootIds.Select(r => new KeyValuePair<int, int>(r, fileMarker.GetRootFoldersIdMarkedAsNew(r)))
.Select(item => string.Format("new_{{\"key\"? \"{0}\", \"value\"? \"{1}\"}}", item.Key, item.Value));
Status += string.Join(SPLIT_CHAR, newrootfolder.ToArray());
Result += string.Join(SPLIT_CHAR, newrootfolder.ToArray());
}
}

View File

@ -138,7 +138,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
var fileMarker = scope.ServiceProvider.GetService<FileMarker>();
var folderDao = scope.ServiceProvider.GetService<IFolderDao<TTo>>();
Status += string.Format("folder_{0}{1}", DaoFolderId, SPLIT_CHAR);
Result += string.Format("folder_{0}{1}", DaoFolderId, SPLIT_CHAR);
//TODO: check on each iteration?
var toFolder = folderDao.GetFolder(tto);
@ -229,7 +229,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
if (ProcessedFolder(folderId))
{
Status += string.Format("folder_{0}{1}", newFolder.ID, SPLIT_CHAR);
Result += string.Format("folder_{0}{1}", newFolder.ID, SPLIT_CHAR);
}
}
@ -249,7 +249,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
FolderDao.DeleteFolder(folder.ID);
if (ProcessedFolder(folderId))
{
Status += string.Format("folder_{0}{1}", newFolder.ID, SPLIT_CHAR);
Result += string.Format("folder_{0}{1}", newFolder.ID, SPLIT_CHAR);
}
}
}
@ -270,7 +270,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
if (ProcessedFolder(folderId))
{
Status += string.Format("folder_{0}{1}", newFolderId, SPLIT_CHAR);
Result += string.Format("folder_{0}{1}", newFolderId, SPLIT_CHAR);
}
}
else if (!FilesSecurity.CanDelete(folder))
@ -302,7 +302,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
if (ProcessedFolder(folderId))
{
Status += string.Format("folder_{0}{1}", newFolderId, SPLIT_CHAR);
Result += string.Format("folder_{0}{1}", newFolderId, SPLIT_CHAR);
}
}
}
@ -339,7 +339,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
if (ProcessedFolder(folderId))
{
Status += string.Format("folder_{0}{1}", newFolderId, SPLIT_CHAR);
Result += string.Format("folder_{0}{1}", newFolderId, SPLIT_CHAR);
}
}
}
@ -418,7 +418,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
if (ProcessedFile(fileId))
{
Status += string.Format("file_{0}{1}", newFile.ID, SPLIT_CHAR);
Result += string.Format("file_{0}{1}", newFile.ID, SPLIT_CHAR);
}
}
catch
@ -466,7 +466,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
if (ProcessedFile(fileId))
{
Status += string.Format("file_{0}{1}", newFileId, SPLIT_CHAR);
Result += string.Format("file_{0}{1}", newFileId, SPLIT_CHAR);
}
}
}
@ -521,7 +521,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
filesMessageService.Send(newFile, toFolder, _headers, MessageAction.FileCopiedWithOverwriting, newFile.Title, parentFolder.Title, toFolder.Title);
if (ProcessedFile(fileId))
{
Status += string.Format("file_{0}{1}", newFile.ID, SPLIT_CHAR);
Result += string.Format("file_{0}{1}", newFile.ID, SPLIT_CHAR);
}
}
else
@ -530,7 +530,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
{
if (ProcessedFile(fileId))
{
Status += string.Format("file_{0}{1}", newFile.ID, SPLIT_CHAR);
Result += string.Format("file_{0}{1}", newFile.ID, SPLIT_CHAR);
}
}
else
@ -554,7 +554,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
if (ProcessedFile(fileId))
{
Status += string.Format("file_{0}{1}", newFile.ID, SPLIT_CHAR);
Result += string.Format("file_{0}{1}", newFile.ID, SPLIT_CHAR);
}
}
}

View File

@ -73,7 +73,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
public virtual FileOperationType OperationType { get; }
public bool HoldResult { get; set; }
public string Status { get; set; }
public string Result { get; set; }
public string Error { get; set; }
@ -101,7 +101,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
TaskInfo.SetProperty(OPERATION_TYPE, OperationType);
TaskInfo.SetProperty(OWNER, ((IAccount)(principal ?? Thread.CurrentPrincipal).Identity).ID);
TaskInfo.SetProperty(PROGRESS, progress < 100 ? progress : 100);
TaskInfo.SetProperty(RESULT, Status);
TaskInfo.SetProperty(RESULT, Result);
TaskInfo.SetProperty(ERROR, Error);
TaskInfo.SetProperty(PROCESSED, successProcessed);
TaskInfo.SetProperty(HOLD, HoldResult);
@ -171,11 +171,11 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
if (!string.IsNullOrEmpty(status1))
{
Status = status1;
Result = status1;
}
else if (!string.IsNullOrEmpty(status2))
{
Status = status2;
Result = status2;
}
var finished1 = thirdpartyTask.GetProperty<bool?>(FINISHED);
@ -372,7 +372,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
successProcessed++;
if (Folders.Contains(folderId))
{
Status += string.Format("folder_{0}{1}", folderId, SPLIT_CHAR);
Result += string.Format("folder_{0}{1}", folderId, SPLIT_CHAR);
return true;
}
return false;
@ -383,7 +383,7 @@ namespace ASC.Web.Files.Services.WCFService.FileOperations
successProcessed++;
if (Files.Contains(fileId))
{
Status += string.Format("file_{0}{1}", fileId, SPLIT_CHAR);
Result += string.Format("file_{0}{1}", fileId, SPLIT_CHAR);
return true;
}
return false;

View File

@ -58,6 +58,7 @@ namespace ASC.Files.Service
.AddJsonFile("notify.json")
.AddJsonFile("kafka.json")
.AddJsonFile($"kafka.{env}.json", true)
.AddJsonFile("elastic.json", true)
.AddEnvironmentVariables()
.AddCommandLine(args);
})

View File

@ -11,7 +11,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AppLimit.CloudComputing.SharpBox" Version="1.1.0.451" />
<PackageReference Include="AppLimit.CloudComputing.SharpBox" Version="1.1.0.453" />
<PackageReference Include="Autofac" Version="6.0.0" />
<PackageReference Include="Autofac.Configuration" Version="6.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
@ -25,8 +25,8 @@
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="5.0.5" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
<PackageReference Include="Microsoft.Graph.Core" Version="1.20.1.4" />
<PackageReference Include="Microsoft.OneDriveSDK" Version="2.0.7.5" />
<PackageReference Include="Microsoft.Graph.Core" Version="1.5.0.2" />
<PackageReference Include="Microsoft.OneDriveSDK" Version="2.0.7.6" />
<PackageReference Include="Microsoft.SharePoint.Client" Version="14.0.4762.1000" />
<PackageReference Include="Moq" Version="4.14.7" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />

View File

@ -80,7 +80,7 @@ namespace ASC.Files.Tests
protected UserOptions UserOptions { get; set; }
protected IServiceScope scope { get; set; }
public const string TestConnection = "Server=localhost;Database=onlyoffice_test;User ID =root;Password=root;Pooling=true;Character Set=utf8;AutoEnlist=false;SSL Mode=none";
public const string TestConnection = "Server=localhost;Database=onlyoffice_test;User ID=root;Password=root;Pooling=true;Character Set=utf8;AutoEnlist=false;SSL Mode=none;AllowPublicKeyRetrieval=True";
public virtual void SetUp()
{
var host = Program.CreateHostBuilder(new string[] {

View File

@ -8,7 +8,6 @@
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
</ItemGroup>
<ItemGroup>

View File

@ -8,7 +8,6 @@
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="7.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Systemd" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
</ItemGroup>
<ItemGroup>

View File

@ -11,10 +11,10 @@
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<WarningsAsErrors></WarningsAsErrors>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.1.0.451</Version>
<Version>1.1.0.453</Version>
<PackageLicenseExpression></PackageLicenseExpression>
<AssemblyVersion>1.1.0.451</AssemblyVersion>
<FileVersion>1.1.0.451</FileVersion>
<AssemblyVersion>1.1.0.453</AssemblyVersion>
<FileVersion>1.1.0.453</FileVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
@ -35,6 +35,5 @@
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net4.8'">
<Reference Include="System.Web" />
<Reference Include="System.Runtime.Serialization" Version="4.1.2.0" />
</ItemGroup>
</Project>

View File

@ -14,8 +14,8 @@
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<RepositoryUrl>https://github.com/microsoftgraph/msgraph-sdk-dotnet</RepositoryUrl>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>1.5.0.1</Version>
<AssemblyVersion>1.5.0.1</AssemblyVersion>
<Version>1.5.0.2</Version>
<AssemblyVersion>1.5.0.2</AssemblyVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />

View File

@ -12,12 +12,12 @@
<PackageProjectUrl>https://github.com/OneDrive/onedrive-sdk-csharp</PackageProjectUrl>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Version>2.0.7.5</Version>
<Version>2.0.7.6</Version>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Graph.Core" Version="1.5.0.1" />
<PackageReference Include="Microsoft.Graph.Core" Version="1.5.0.2" />
</ItemGroup>
</Project>

View File

@ -802,7 +802,7 @@ namespace ASC.Api.Settings
}
[Read("security")]
public IEnumerable<SecurityWrapper> GetWebItemSecurityInfo(IEnumerable<string> ids)
public IEnumerable<SecurityWrapper> GetWebItemSecurityInfo([FromQuery]IEnumerable<string> ids)
{
if (ids == null || !ids.Any())
{

View File

@ -104,8 +104,8 @@ namespace ASC.Api.Settings.Smtp
Configuration = configuration;
//todo
//messageSubject = WebstudioNotifyPatternResource.subject_smtp_test;
//messageBody = WebstudioNotifyPatternResource.pattern_smtp_test;
messageSubject = WebstudioNotifyPatternResource.subject_smtp_test;
messageBody = WebstudioNotifyPatternResource.pattern_smtp_test;
Source = "";
Progress = 0;