Merge branch 'release/1.0.0' of github.com:ONLYOFFICE/AppServer into release/1.0.0
This commit is contained in:
commit
205a9af165
@ -16,12 +16,12 @@
|
||||
<PackageReference Include="AspNetCore.HealthChecks.NpgSql" Version="5.0.2" />
|
||||
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />
|
||||
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.1.1" />
|
||||
<PackageReference Include="NLog" Version="4.7.10" />
|
||||
<PackageReference Include="NLog.Web.AspNetCore" Version="4.13.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\web\ASC.Web.Core\ASC.Web.Core.csproj" />
|
||||
<ProjectReference Include="..\ASC.Common\ASC.Common.csproj" />
|
||||
<ProjectReference Include="..\ASC.Core.Common\ASC.Core.Common.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -8,7 +8,9 @@ using ASC.Api.Core.Middleware;
|
||||
using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.Mapping;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac;
|
||||
|
||||
@ -27,6 +29,9 @@ using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
using NLog;
|
||||
using NLog.Extensions.Logging;
|
||||
|
||||
namespace ASC.Api.Core
|
||||
{
|
||||
public abstract class BaseStartup
|
||||
@ -164,4 +169,16 @@ namespace ASC.Api.Core
|
||||
builder.Register(Configuration, LoadProducts, LoadConsumers);
|
||||
}
|
||||
}
|
||||
|
||||
public static class LogNLogConfigureExtenstion
|
||||
{
|
||||
public static IHostBuilder ConfigureNLogLogging(this IHostBuilder hostBuilder)
|
||||
{
|
||||
return hostBuilder.ConfigureLogging((hostBuildexContext, r) =>
|
||||
{
|
||||
_ = new ConfigureLogNLog(hostBuildexContext.Configuration, new ConfigurationExtension(hostBuildexContext.Configuration));
|
||||
r.AddNLog(LogManager.Configuration);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
@ -52,7 +52,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference> -->
|
||||
<PackageReference Include="NLog" Version="4.7.5" />
|
||||
<PackageReference Include="NLog" Version="4.7.10" />
|
||||
<PackageReference Include="NVelocity" Version="1.2.0" />
|
||||
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
@ -247,6 +247,8 @@ namespace ASC.Core.Caching
|
||||
|
||||
public UserInfo GetUser(int tenant, Guid id)
|
||||
{
|
||||
if (id.Equals(Guid.Empty)) return null;
|
||||
|
||||
if (CoreBaseSettings.Personal)
|
||||
{
|
||||
return GetUserForPersonal(tenant, id);
|
||||
|
@ -288,36 +288,6 @@ namespace ASC.Core
|
||||
return findUsers.ToArray();
|
||||
}
|
||||
|
||||
public UserInfo SaveUserInfo(UserInfo u)
|
||||
{
|
||||
if (IsSystemUser(u.ID)) return SystemUsers[u.ID];
|
||||
if (u.ID == Guid.Empty) PermissionContext.DemandPermissions(Constants.Action_AddRemoveUser);
|
||||
else PermissionContext.DemandPermissions(new UserSecurityProvider(u.ID), Constants.Action_EditUser);
|
||||
|
||||
if (Constants.MaxEveryoneCount <= GetUsersByGroup(Constants.GroupEveryone.ID).Length)
|
||||
{
|
||||
throw new TenantQuotaException("Maximum number of users exceeded");
|
||||
}
|
||||
|
||||
if (u.Status == EmployeeStatus.Active)
|
||||
{
|
||||
var q = TenantManager.GetTenantQuota(Tenant.TenantId);
|
||||
if (q.ActiveUsers < GetUsersByGroup(Constants.GroupUser.ID).Length)
|
||||
{
|
||||
throw new TenantQuotaException(string.Format("Exceeds the maximum active users ({0})", q.ActiveUsers));
|
||||
}
|
||||
}
|
||||
|
||||
if (u.Status == EmployeeStatus.Terminated && u.ID == TenantManager.GetCurrentTenant().OwnerId)
|
||||
{
|
||||
throw new InvalidOperationException("Can not disable tenant owner.");
|
||||
}
|
||||
|
||||
var newUser = UserService.SaveUser(Tenant.TenantId, u);
|
||||
|
||||
return newUser;
|
||||
}
|
||||
|
||||
public UserInfo SaveUserInfo(UserInfo u, bool isVisitor = false)
|
||||
{
|
||||
if (IsSystemUser(u.ID)) return SystemUsers[u.ID];
|
||||
|
@ -30,6 +30,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
@ -100,6 +101,7 @@ namespace ASC.ApiSystem
|
||||
{"pathToConf", path}
|
||||
});
|
||||
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.DependencyInjection;
|
||||
@ -89,6 +90,7 @@ namespace ASC.Thumbnails.Svc
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, false, false);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
@ -75,7 +76,8 @@ namespace ASC.Data.Backup
|
||||
{"pathToConf", path }
|
||||
}
|
||||
);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
@ -98,6 +99,7 @@ namespace ASC.Data.Storage.Encryption
|
||||
.AddJsonFile("kafka.json")
|
||||
.AddJsonFile($"kafka.{env}.json", true)
|
||||
.AddEnvironmentVariables();
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -73,6 +73,7 @@ namespace ASC.Data.Storage.Migration
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -82,6 +82,7 @@ namespace ASC.Notify
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -24,9 +24,15 @@
|
||||
*/
|
||||
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.Logging;
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
@ -35,12 +41,6 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
namespace ASC.Radicale
|
||||
{
|
||||
@ -98,6 +98,7 @@ namespace ASC.Radicale
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, false, false);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -99,7 +99,8 @@ namespace ASC.Socket.IO.Svc
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, false, false);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,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="NLog" Version="4.7.5" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -100,7 +100,8 @@ namespace ASC.Socket.IO.Svc
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, false, false);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,6 +76,7 @@ namespace ASC.Studio.Notify
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
@ -98,6 +99,7 @@ namespace ASC.TelegramService
|
||||
.AddJsonFile("kafka.json")
|
||||
.AddJsonFile($"kafka.{env}.json", true)
|
||||
.AddEnvironmentVariables();
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -98,6 +98,7 @@ namespace ASC.Thumbnails.Svc
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, false, false);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -99,6 +99,7 @@ namespace ASC.UrlShortener.Svc
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, false, false);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -14,12 +14,12 @@
|
||||
<default-target-parameters type="SelfCleaning" encoding="utf-8" archiveNumbering="DateAndSequence" archiveEvery="Day" enableArchiveFileCompression="true" archiveAboveSize="52428800" keepFileOpen="true" archiveDateFormat="MM-dd" layout="${date:format=yyyy-MM-dd HH\:mm\:ss,fff} ${level:uppercase=true} [${threadid}] ${logger} - ${message} ${exception:format=ToString}"/>
|
||||
<target name="web" type="SelfCleaning" fileName="${var:dir}${var:name}.log" />
|
||||
<target name="sql" type="SelfCleaning" fileName="${var:dir}${var:name}.sql.log" layout="${date:universalTime=true:format=yyyy-MM-dd HH\:mm\:ss,fff}|${threadid}|${event-properties:item=duration}|${message}|${event-properties:item=sql}|${event-properties:item=sqlParams}"/>
|
||||
<target name="ownFile-web" type="File" fileName="${var:dir}web.asp.log" layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}" />
|
||||
<target name="ownFile-web" type="File" fileName="${var:dir}${var:name}.asp.log" layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}" />
|
||||
</targets>
|
||||
|
||||
<rules>
|
||||
<logger name="ASC.SQL" minlevel="Debug" writeTo="sql" final ="true" />
|
||||
<logger name="ASC*" minlevel="Debug" writeTo="web" />
|
||||
<logger name="Microsoft.*" maxlevel="Debug" writeTo="web" final="true" />
|
||||
<logger name="Microsoft.*" minlevel="Debug" writeTo="ownFile-web" final="true" />
|
||||
</rules>
|
||||
</nlog>
|
@ -2,6 +2,7 @@
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common;
|
||||
using ASC.Common.Caching;
|
||||
using ASC.Common.DependencyInjection;
|
||||
@ -83,6 +84,7 @@ namespace ASC.CRM.BackgroundTasks
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, true, false, "search.json");
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -3,10 +3,9 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using ASC.Common.DependencyInjection;
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac;
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -74,6 +73,7 @@ namespace ASC.CRM
|
||||
{
|
||||
{"pathToConf", path}
|
||||
});
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -48,6 +50,7 @@ namespace ASC.Calendar
|
||||
.AddJsonFile($"kafka.{hostingContext.HostingEnvironment.EnvironmentName}.json", true)
|
||||
.AddEnvironmentVariables()
|
||||
.AddCommandLine(args);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
@ -73,6 +74,7 @@ namespace ASC.Files
|
||||
{
|
||||
{"pathToConf", path}
|
||||
});
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,7 @@ namespace ASC.Files.Service
|
||||
.ConfigureContainer<ContainerBuilder>((context, builder) =>
|
||||
{
|
||||
builder.Register(context.Configuration, true, false, "search.json", "feed.json");
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -51,6 +53,7 @@ namespace ASC.Mail
|
||||
{
|
||||
{"pathToConf", path}
|
||||
});
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
@ -75,7 +76,8 @@ namespace ASC.People
|
||||
{"pathToConf", path }
|
||||
}
|
||||
);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
}
|
@ -5,6 +5,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
@ -74,6 +75,7 @@ namespace ASC.Projects
|
||||
{
|
||||
{"pathToConf", path}
|
||||
});
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
@ -12,7 +13,6 @@ using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
|
||||
namespace ASC.Web.Api
|
||||
{
|
||||
public class Program
|
||||
@ -75,6 +75,7 @@ namespace ASC.Web.Api
|
||||
{"pathToConf", path }
|
||||
}
|
||||
);
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using ASC.Api.Core;
|
||||
using ASC.Common.Utils;
|
||||
|
||||
using Autofac.Extensions.DependencyInjection;
|
||||
@ -75,6 +76,7 @@ namespace ASC.Web.Studio
|
||||
}
|
||||
);
|
||||
|
||||
});
|
||||
})
|
||||
.ConfigureNLogLogging();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user