Skip to content

Commit

Permalink
Merge hotfix/v3.0.1into master
Browse files Browse the repository at this point in the history
  • Loading branch information
agolybev committed Dec 17, 2024
2 parents e94b432 + 9015199 commit 8b79e6c
Show file tree
Hide file tree
Showing 150 changed files with 12,328 additions and 360 deletions.
4 changes: 2 additions & 2 deletions common/ASC.Api.Core/ASC.Api.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
<PackageReference Include="StackExchange.Redis.Extensions.AspNetCore" Version="10.2.0" />
<PackageReference Include="StackExchange.Redis.Extensions.Newtonsoft" Version="10.2.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="7.1.0" />

<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.9.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public static async Task<IConnectionMultiplexer> GetRedisConnectionMultiplexerAs
}

var configurationOption = redisConfiguration.ConfigurationOptions;

configurationOption.DefaultDatabase = redisConfiguration.Database;
configurationOption.ClientName = clientName;

var redisConnection = await RedisPersistentConnection.InitializeAsync(configurationOption);
Expand Down
3 changes: 3 additions & 0 deletions common/ASC.Api.Core/Log/CustomExceptionHandlerLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,7 @@ internal static partial class CustomExceptionHandlerLogger
{
[LoggerMessage(LogLevel.Critical, "error during executing {RequestMethod}: {PathValue}")]
public static partial void CriticalError(this ILogger<CustomExceptionHandler> logger, string RequestMethod, string PathValue, Exception exception);

[LoggerMessage(LogLevel.Information, "error during executing {RequestMethod}: {PathValue} {ExceptionMessage} {InnerExceptionMessage}")]
public static partial void InformationError(this ILogger<CustomExceptionHandler> logger, string RequestMethod, string PathValue, string ExceptionMessage, string InnerExceptionMessage);
}
11 changes: 10 additions & 1 deletion common/ASC.Api.Core/Middleware/ResponseWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public async ValueTask<bool> TryHandleAsync(HttpContext context, Exception excep
}

var withStackTrace = true;
var criticalException = true;

switch (exception)
{
Expand All @@ -64,6 +65,7 @@ public async ValueTask<bool> TryHandleAsync(HttpContext context, Exception excep
case AuthenticationException:
status = HttpStatusCode.Unauthorized;
withStackTrace = false;
criticalException = false;
break;
case InvalidOperationException:
status = HttpStatusCode.Forbidden;
Expand All @@ -82,7 +84,14 @@ public async ValueTask<bool> TryHandleAsync(HttpContext context, Exception excep
break;
}

logger.CriticalError(context.Request.Method, context.Request.Path.Value, exception);
if (criticalException)
{
logger.CriticalError(context.Request.Method, context.Request.Path.Value, exception);
}
else
{
logger.InformationError(context.Request.Method, context.Request.Path.Value, exception.Message, exception.InnerException?.Message);
}

var result = new ErrorApiResponse(status, exception, message, withStackTrace);

Expand Down
4 changes: 2 additions & 2 deletions common/ASC.Common/ASC.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
<PackageReference Include="RabbitMQ.Client" Version="7.0.0" />
<PackageReference Include="StackExchange.Redis" Version="2.8.16" />
<PackageReference Include="StackExchange.Redis.Extensions.Core" Version="10.2.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.9.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.7.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="7.1.0" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="7.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ASC.EventBus\ASC.EventBus.csproj" />
Expand Down
7 changes: 5 additions & 2 deletions common/ASC.Common/Utils/SwaggerCustomFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,14 @@ private OpenApiSchema UpdateSchema(Type checkType, OpenApiSchema result)
result.Example = array;
}

if(arraySchema.OneOf != null)
if(arraySchema.OneOf.Count != 0)
{
result.Items = new OpenApiSchema { AnyOf = arraySchema.OneOf };
}
else if(checkType == typeof(object))
{
result.Items = new OpenApiSchema { Type = "object" };
}

}
else if(checkType == typeof(JsonElement))
Expand Down Expand Up @@ -261,7 +265,6 @@ private OpenApiSchema UpdateSchema(Type checkType, OpenApiSchema result)

return result;
}

private IOpenApiAny GetExample(object exampleValue)
{
return exampleValue switch
Expand Down
5 changes: 5 additions & 0 deletions common/ASC.Core.Common/Billing/License/License.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ public class License
[JsonPropertyName("signature")]
public string Signature { get; set; }

/// <summary>Indicates whether the license is a developer license or not</summary>
/// <type>System.Boolean, System</type>
[JsonPropertyName("docspace_dev")]
public bool Developer { get; set; }

public static License Parse(string licenseString)
{
if (string.IsNullOrEmpty(licenseString))
Expand Down
2 changes: 1 addition & 1 deletion common/ASC.Core.Common/Billing/License/LicenseReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private static async Task SaveLicenseAsync(Stream licenseStream, string path)

private DateTime Validate(License license)
{
var invalidLicenseType = _licenseType == LicenseType.Enterprise ? license.Customization : !license.Customization;
var invalidLicenseType = _licenseType == LicenseType.Enterprise ? license.Developer : !license.Developer;

if (string.IsNullOrEmpty(license.CustomerId)
|| string.IsNullOrEmpty(license.Signature)
Expand Down
4 changes: 2 additions & 2 deletions common/ASC.Core.Common/EF/Queries/LoginEventsQueries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Microsoft.EntityFrameworkCore. EF.CompileAsyncQuery((MessagesContext ctx, int te
x.reference.EntryType == entryType &&
(fromDate == null || x.@event.Date >= fromDate) &&
(toDate == null || x.@event.Date <= toDate))
.OrderByDescending(x => x.@event.Date)
.OrderByDescending(x => x.@event.Id)
.Skip(offset)
.Take(count)
.Select(x => x.@event));
Expand All @@ -166,7 +166,7 @@ Microsoft.EntityFrameworkCore. EF.CompileAsyncQuery((MessagesContext ctx, int te
(files.Contains(x.reference.EntryId) && filterFileActions.Contains(x.@event.Action ?? 0) && x.reference.EntryType == 2)) &&
(fromDate == null || x.@event.Date >= fromDate) &&
(toDate == null || x.@event.Date <= toDate))
.OrderByDescending(x => x.@event.Date)
.OrderByDescending(x => x.@event.Id)
.GroupBy(x => x.@event.Id)
.Where(g => g.Count() > 1)
.Skip(offset)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@
&lt;/td&gt;
&lt;tr border="0" cellspacing="0" cellpadding="0"&gt;
&lt;td class="fol" style="color: #666666; font-family: 'Open Sans', Helvetica, Arial, Tahoma, sans-serif; font-size: 13px; line-height: 20px; margin: 0; padding: 0; vertical-align: top;"&gt;
In caso di problemi tecnici contatta il nostro &lt;a style="color: #FF6F3D; text -decorazione: sottolineatura;" target="_blank" href="%SUPPORTURL%"&gt;team di supporto&lt;/a&gt;.
In caso di problemi tecnici contatta il nostro &lt;a style="color: #FF6F3D; text-decoration: underline;" target="_blank" href="%SUPPORTURL%"&gt;team di supporto&lt;/a&gt;.
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr border="0" cellspacing="0" cellpadding="0"&gt;
&lt;td class="fol" style="font-family: 'Open Sans', Helvetica, Arial, Tahoma, sans-serif; font-size: 13px; line-height: 20px; margin: 0; padding: 8px 0 0; vertical-align: top;"&gt;
&lt;a href="{1}" style=" colore: #FF6F3D; decorazione del testo: sottolineato; spazio bianco: nowrap;" target="_blank"&gt;Clicca qui per annullare l'iscrizione&lt;/a&gt;
&lt;a href="{1}" style="color: #FF6F3D; text-decoration: underline; white-space: nowrap;" target="_blank"&gt;Clicca qui per annullare l'iscrizione&lt;/a&gt;
&lt;/td&gt;
&lt;/tr&gt;</value>
</data>
Expand Down
2 changes: 1 addition & 1 deletion common/ASC.Data.Storage/S3/S3Storage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ public override async Task DeleteDirectoryAsync(string domain, string path)
}
public override async Task DeleteDirectoryAsync(string domain, string path, Guid ownerId)
{
await DeleteFilesAsync(domain, path, "*", true);
await DeleteFilesAsync(domain, path, "*", true, ownerId);
}

public override async Task<long> GetFileSizeAsync(string domain, string path)
Expand Down
3 changes: 2 additions & 1 deletion common/ASC.MessagingSystem/Data/MessagesRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ public class MessagesRepository(
MessageAction.UserSentPasswordChangeInstructions,
MessageAction.SendJoinInvite,
MessageAction.RoomRemoveUser,
MessageAction.PortalRenamed
MessageAction.PortalRenamed,
MessageAction.RoomCreated
];

public async Task<int> AddAsync(EventMessage message)
Expand Down
2 changes: 1 addition & 1 deletion common/ASC.Migration/ASC.Migration.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageReference Include="FolkerKinzel.VCards" Version="7.2.2" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.67" />
<PackageReference Include="Ical.Net" Version="4.2.0" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.5" />
<PackageReference Include="SixLabors.ImageSharp" Version="3.1.6" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion common/ASC.Socket.IO/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function getAndSaveAppsettings(){
if(redis != null)
{
redis.connect_timeout = redis.ConnectTimeout;
redis.db = redis.Database;
redis.database = redis.Database;
redis.username = redis.User;
redis.password = redis.Password;
redis.socket = {
Expand Down
8 changes: 6 additions & 2 deletions common/ASC.SsoAuth/app/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ module.exports = function (app, config) {
return res.redirect(request.context);
}
}
function getValueByKeyIgnoreCase(obj, key) {
const entry = Object.entries(obj).find(([k]) => k.toLowerCase() === key.toLowerCase());
return entry ? entry[1] : undefined;
}

const createAuthnTemplateCallback = (_idp, _sp, method) => (template) => {
const metadata = { idp: _idp.entityMeta, sp: _sp.entityMeta };
Expand Down Expand Up @@ -567,8 +571,8 @@ module.exports = function (app, config) {

//const logoutUser = new LogoutModel(userData.NameId, userData.SessionId);
const user = {
logoutNameID: userData.NameId,
sessionIndex: userData.SessionId,
logoutNameID: getValueByKeyIgnoreCase(userData, "NameId"),
sessionIndex: getValueByKeyIgnoreCase(userData, "SessionId")
};

const data = sp.createLogoutRequest(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

using YamlDotNet.Serialization.NamingConventions;
using YamlDotNet.Serialization;
using System.Text.Encodings.Web;

public class Programm
{
Expand Down Expand Up @@ -137,7 +138,13 @@ private static string ModifyJsonDocumentation(JsonObject jsonObject)
}
}
}
return jsonObject.ToJsonString(new JsonSerializerOptions { WriteIndented = true });
var options = new JsonSerializerOptions
{
WriteIndented = true,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};

return jsonObject.ToJsonString(options);
}

private static string ModifyYamlDocumentation(string yamlData)
Expand Down
63 changes: 63 additions & 0 deletions common/services/ASC.AuditTrail/AuditReportResource.ar-SA.resx
Original file line number Diff line number Diff line change
Expand Up @@ -867,4 +867,67 @@
<data name="RoomInviteResend" xml:space="preserve">
<value>تم إرسال الدعوات مرة أخرى: {0}</value>
</data>
<data name="OAuthModule" xml:space="preserve">
<value>OAuth</value>
</data>
<data name="ChangeClientActivation" xml:space="preserve">
<value>تم تغيير تنشيط {0} للعميل</value>
</data>
<data name="ChangeClientVisibility" xml:space="preserve">
<value>تم تغيير رؤية العميل {0}</value>
</data>
<data name="CreateClient" xml:space="preserve">
<value>تم إنشاء العميل</value>
</data>
<data name="DeleteClient" xml:space="preserve">
<value>تم حذف العميل {0}</value>
</data>
<data name="FileIndexChanged" xml:space="preserve">
<value>الملف: {0}. تم تغيير الفهرس من {1} إلى {2}</value>
</data>
<data name="FolderIndexChanged" xml:space="preserve">
<value>المجلد: {0}. تم تغيير الفهرس من {1} إلى {2}</value>
</data>
<data name="FolderIndexReordered" xml:space="preserve">
<value>المجلد: {0}. تم إعادة ترتيب الفهارس</value>
</data>
<data name="GenerateAuthorizationCodeToken" xml:space="preserve">
<value>رمز التفويض الذي تم إنشاؤه للعميل {0}</value>
</data>
<data name="GeneratePersonalAccessToken" xml:space="preserve">
<value>تم إنشاء رمز وصول شخصي للعميل {0}</value>
</data>
<data name="RegenerateSecret" xml:space="preserve">
<value>تمت إعادة إنشاء سر {0} الخاص بالعميل</value>
</data>
<data name="RevokeUserClient" xml:space="preserve">
<value>تم إبطال وصول العميل {0}</value>
</data>
<data name="RoomDenyDownloadDisabled" xml:space="preserve">
<value>الغرفة: {0}. رفض التحميل معطل</value>
</data>
<data name="RoomDenyDownloadEnabled" xml:space="preserve">
<value>الغرفة: {0}. تم تمكين رفض التنزيل</value>
</data>
<data name="RoomIndexingDisabled" xml:space="preserve">
<value>تم تعطيل فهرسة الغرفة</value>
</data>
<data name="RoomIndexingEnabled" xml:space="preserve">
<value>تم تمكين فهرسة الغرفة</value>
</data>
<data name="RoomLifeTimeDisabled" xml:space="preserve">
<value>تم تعطيل مدى الحياة</value>
</data>
<data name="RoomLifeTimeSet" xml:space="preserve">
<value>تم ضبط وقت الحياة. القيمة: {0}. الفترة: {1}. الحذف نهائيًا: {2}</value>
</data>
<data name="RoomWatermarkDisabled" xml:space="preserve">
<value>الغرفة: {0}. تم تعطيل العلامة المائية</value>
</data>
<data name="RoomWatermarkSet" xml:space="preserve">
<value>الغرفة: {0}. تم تمكين العلامة المائية</value>
</data>
<data name="UpdateClient" xml:space="preserve">
<value>تم تحديث العميل {0}</value>
</data>
</root>
63 changes: 63 additions & 0 deletions common/services/ASC.AuditTrail/AuditReportResource.az.resx
Original file line number Diff line number Diff line change
Expand Up @@ -808,4 +808,67 @@
<data name="RoomInviteResend" xml:space="preserve">
<value>Dəvətlər yenidən göndərildi: {0}</value>
</data>
<data name="OAuthModule" xml:space="preserve">
<value>OAuth</value>
</data>
<data name="ChangeClientActivation" xml:space="preserve">
<value>Müştərinin {0} aktivləşdirilməsi dəyişdirildi</value>
</data>
<data name="ChangeClientVisibility" xml:space="preserve">
<value>Müştərinin {0} görünürlüyü dəyişdi</value>
</data>
<data name="CreateClient" xml:space="preserve">
<value>Müştəri yaradıldı</value>
</data>
<data name="DeleteClient" xml:space="preserve">
<value>Müştəri {0} silindi</value>
</data>
<data name="FileIndexChanged" xml:space="preserve">
<value>Fayl: {0}. İndeks {1}-dən {2}-ə dəyişdirildi</value>
</data>
<data name="FolderIndexChanged" xml:space="preserve">
<value>Qovluq: {0}. İndeks {1}-dən {2}-ə dəyişdirildi</value>
</data>
<data name="FolderIndexReordered" xml:space="preserve">
<value>Qovluq: {0}. Kataloqlar yenidən sıralandı</value>
</data>
<data name="GenerateAuthorizationCodeToken" xml:space="preserve">
<value>{0} müştəri üçün avtorizasiya kodu yaradıldı</value>
</data>
<data name="GeneratePersonalAccessToken" xml:space="preserve">
<value>{0} müştərisi üçün şəxsi giriş nişanı yaradıldı</value>
</data>
<data name="RegenerateSecret" xml:space="preserve">
<value>Müştəri {0} sirri yenidən yaradıldı</value>
</data>
<data name="RevokeUserClient" xml:space="preserve">
<value>Müştəri {0} girişi ləğv edildi</value>
</data>
<data name="RoomDenyDownloadDisabled" xml:space="preserve">
<value>Otaq: {0}. Endirmədən imtina deaktivdir</value>
</data>
<data name="RoomDenyDownloadEnabled" xml:space="preserve">
<value>Otaq: {0}. Endirmədən imtina aktivdir</value>
</data>
<data name="RoomIndexingDisabled" xml:space="preserve">
<value>Otağın indeksləşdirilməsi deaktiv edilib</value>
</data>
<data name="RoomIndexingEnabled" xml:space="preserve">
<value>Otağın indeksləşdirilməsi aktivləşdirilib</value>
</data>
<data name="RoomLifeTimeDisabled" xml:space="preserve">
<value>İstifadə müddəti deaktiv edilib</value>
</data>
<data name="RoomLifeTimeSet" xml:space="preserve">
<value>İstifadə müddəti müəyyən edilmişdir. Dəyər: {0}. Dövr: {1}. Həmişəlik Silin: {2}</value>
</data>
<data name="RoomWatermarkDisabled" xml:space="preserve">
<value>Otaq: {0}. Su nişanı deaktiv edilib</value>
</data>
<data name="RoomWatermarkSet" xml:space="preserve">
<value>Otaq: {0}. Su nişanı aktiv edilib</value>
</data>
<data name="UpdateClient" xml:space="preserve">
<value>{0} müştəri yeniləndi</value>
</data>
</root>
Loading

0 comments on commit 8b79e6c

Please sign in to comment.