diff --git a/backend/src/PnvPanel.Api/Program.cs b/backend/src/PnvPanel.Api/Program.cs index c0f341e..5ebc504 100644 --- a/backend/src/PnvPanel.Api/Program.cs +++ b/backend/src/PnvPanel.Api/Program.cs @@ -100,8 +100,8 @@ var app = builder.Build(); if (string.IsNullOrWhiteSpace(builder.Configuration["DataProtection:KeyRingPath"])) { app.Logger.LogWarning( - "DataProtection:KeyRingPath не задан — ключи шифрования секретов нод не персистентны " + - "и будут потеряны при пересоздании контейнера. В проде обязательно смонтируй том и укажи путь."); + "DataProtection:KeyRingPath is not set — node secret encryption keys are not persistent " + + "and will be lost when the container is recreated. Mount a volume and set the path in production."); } // Авто-применение миграций и идемпотентный сидинг (роли + админ из env) на старте. diff --git a/backend/src/PnvPanel.Api/Telegram/PnvBotUpdateHandler.cs b/backend/src/PnvPanel.Api/Telegram/PnvBotUpdateHandler.cs index 09ef446..270623b 100644 --- a/backend/src/PnvPanel.Api/Telegram/PnvBotUpdateHandler.cs +++ b/backend/src/PnvPanel.Api/Telegram/PnvBotUpdateHandler.cs @@ -36,13 +36,13 @@ public sealed class PnvBotUpdateHandler( } catch (Exception ex) { - logger.LogError(ex, "Ошибка обработки Telegram-апдейта {UpdateId}", update.Id); + logger.LogError(ex, "Failed to process Telegram update {UpdateId}", update.Id); } } public Task HandleErrorAsync(ITelegramBotClient botClient, Exception exception, HandleErrorSource source, CancellationToken cancellationToken) { - logger.LogError(exception, "Ошибка Telegram-бота (источник {Source})", source); + logger.LogError(exception, "Telegram bot error (source {Source})", source); return Task.CompletedTask; } diff --git a/backend/src/PnvPanel.Api/Telegram/TelegramBotHostedService.cs b/backend/src/PnvPanel.Api/Telegram/TelegramBotHostedService.cs index 18499b8..2c52479 100644 --- a/backend/src/PnvPanel.Api/Telegram/TelegramBotHostedService.cs +++ b/backend/src/PnvPanel.Api/Telegram/TelegramBotHostedService.cs @@ -21,7 +21,7 @@ public sealed class TelegramBotHostedService( { if (string.IsNullOrWhiteSpace(options.Value.BotToken)) { - logger.LogWarning("Telegram__BotToken не задан — бот не стартует."); + logger.LogWarning("Telegram__BotToken is not set — bot will not start."); return; } @@ -31,7 +31,7 @@ public sealed class TelegramBotHostedService( DropPendingUpdates = true, }; - logger.LogInformation("Telegram-бот запускается (long polling)..."); + logger.LogInformation("Telegram bot starting (long polling)..."); try { diff --git a/backend/src/PnvPanel.Application/Admin/Users/BlockUserCommandHandler.cs b/backend/src/PnvPanel.Application/Admin/Users/BlockUserCommandHandler.cs index 33160f3..3a753bc 100644 --- a/backend/src/PnvPanel.Application/Admin/Users/BlockUserCommandHandler.cs +++ b/backend/src/PnvPanel.Application/Admin/Users/BlockUserCommandHandler.cs @@ -44,7 +44,7 @@ public sealed class BlockUserCommandHandler( // с реальным состоянием клиента в 3x-ui (пользователь решит, что VPN погашен, а он жив). // Конфиг останется Active и будет подхвачен повторным BlockUserCommand (идемпотентен). logger.LogWarning( - "Не удалось отключить клиента конфига {ConfigId} на ноде {NodeId} при блокировке пользователя {UserId}: {Error}", + "Failed to disable client for config {ConfigId} on node {NodeId} while blocking user {UserId}: {Error}", config.Id, node.Id, command.UserId, updateResult.Error); continue; } diff --git a/backend/src/PnvPanel.Application/Admin/Users/UnblockUserCommandHandler.cs b/backend/src/PnvPanel.Application/Admin/Users/UnblockUserCommandHandler.cs index 19ec59a..987eeeb 100644 --- a/backend/src/PnvPanel.Application/Admin/Users/UnblockUserCommandHandler.cs +++ b/backend/src/PnvPanel.Application/Admin/Users/UnblockUserCommandHandler.cs @@ -43,7 +43,7 @@ public sealed class UnblockUserCommandHandler( // с реальным состоянием клиента в 3x-ui. Конфиг останется Disabled и будет подхвачен // повторным UnblockUserCommand (идемпотентен). logger.LogWarning( - "Не удалось включить клиента конфига {ConfigId} на ноде {NodeId} при разблокировке пользователя {UserId}: {Error}", + "Failed to enable client for config {ConfigId} on node {NodeId} while unblocking user {UserId}: {Error}", config.Id, node.Id, command.UserId, updateResult.Error); continue; } diff --git a/backend/src/PnvPanel.Application/Common/Behaviors/LoggingBehavior.cs b/backend/src/PnvPanel.Application/Common/Behaviors/LoggingBehavior.cs index 7cb8660..344662f 100644 --- a/backend/src/PnvPanel.Application/Common/Behaviors/LoggingBehavior.cs +++ b/backend/src/PnvPanel.Application/Common/Behaviors/LoggingBehavior.cs @@ -10,11 +10,11 @@ public sealed class LoggingBehavior(ILogger Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) { var requestName = typeof(TRequest).Name; - logger.LogInformation("Обработка {RequestName}", requestName); + logger.LogInformation("Handling {RequestName}", requestName); var response = await next(); - logger.LogInformation("Обработан {RequestName}", requestName); + logger.LogInformation("Handled {RequestName}", requestName); return response; } } diff --git a/backend/src/PnvPanel.Infrastructure/BackgroundJobs/NodeHealthCheckService.cs b/backend/src/PnvPanel.Infrastructure/BackgroundJobs/NodeHealthCheckService.cs index a91087a..af10d14 100644 --- a/backend/src/PnvPanel.Infrastructure/BackgroundJobs/NodeHealthCheckService.cs +++ b/backend/src/PnvPanel.Infrastructure/BackgroundJobs/NodeHealthCheckService.cs @@ -23,7 +23,7 @@ public sealed class NodeHealthCheckService(IServiceScopeFactory scopeFactory, IL } catch (Exception ex) { - logger.LogError(ex, "Ошибка health-check нод"); + logger.LogError(ex, "Node health-check failed"); } } while (await timer.WaitForNextTickAsync(stoppingToken)); diff --git a/backend/src/PnvPanel.Infrastructure/BackgroundJobs/TrafficRetentionService.cs b/backend/src/PnvPanel.Infrastructure/BackgroundJobs/TrafficRetentionService.cs index 7707cc1..19428df 100644 --- a/backend/src/PnvPanel.Infrastructure/BackgroundJobs/TrafficRetentionService.cs +++ b/backend/src/PnvPanel.Infrastructure/BackgroundJobs/TrafficRetentionService.cs @@ -25,7 +25,7 @@ public sealed class TrafficRetentionService( } catch (Exception ex) { - logger.LogError(ex, "Ошибка ретеншна истории трафика"); + logger.LogError(ex, "Traffic history retention failed"); } } while (await timer.WaitForNextTickAsync(stoppingToken)); @@ -40,6 +40,6 @@ public sealed class TrafficRetentionService( var deleted = await dbContext.TrafficSamples.Where(s => s.Timestamp < cutoff).ExecuteDeleteAsync(cancellationToken); if (deleted > 0) - logger.LogInformation("Удалено {Count} устаревших записей истории трафика", deleted); + logger.LogInformation("Deleted {Count} expired traffic history records", deleted); } } diff --git a/backend/src/PnvPanel.Infrastructure/BackgroundJobs/TrafficSyncService.cs b/backend/src/PnvPanel.Infrastructure/BackgroundJobs/TrafficSyncService.cs index 1de9581..0784d34 100644 --- a/backend/src/PnvPanel.Infrastructure/BackgroundJobs/TrafficSyncService.cs +++ b/backend/src/PnvPanel.Infrastructure/BackgroundJobs/TrafficSyncService.cs @@ -28,7 +28,7 @@ public sealed class TrafficSyncService(IServiceScopeFactory scopeFactory, ILogge } catch (Exception ex) { - logger.LogError(ex, "Ошибка синхронизации трафика"); + logger.LogError(ex, "Traffic sync failed"); } } while (await timer.WaitForNextTickAsync(stoppingToken)); diff --git a/backend/src/PnvPanel.Infrastructure/Identity/DbInitializer.cs b/backend/src/PnvPanel.Infrastructure/Identity/DbInitializer.cs index 1ca3e38..970158d 100644 --- a/backend/src/PnvPanel.Infrastructure/Identity/DbInitializer.cs +++ b/backend/src/PnvPanel.Infrastructure/Identity/DbInitializer.cs @@ -38,10 +38,10 @@ public sealed class DbInitializer( if (!result.Succeeded) { throw new InvalidOperationException( - $"Не удалось создать роль '{name}': {string.Join(", ", result.Errors.Select(e => e.Description))}"); + $"Failed to create role '{name}': {string.Join(", ", result.Errors.Select(e => e.Description))}"); } - logger.LogInformation("Создана системная роль {RoleName}", name); + logger.LogInformation("Created system role {RoleName}", name); } private async Task SeedAdminAsync() @@ -49,7 +49,7 @@ public sealed class DbInitializer( var options = adminSeedOptions.Value; if (string.IsNullOrWhiteSpace(options.Username) || string.IsNullOrWhiteSpace(options.Password)) { - logger.LogWarning("AdminSeed__Username/AdminSeed__Password не заданы — учётка администратора не создана"); + logger.LogWarning("AdminSeed__Username/AdminSeed__Password not set — admin account not created"); return; } @@ -68,11 +68,11 @@ public sealed class DbInitializer( if (!createResult.Succeeded) { throw new InvalidOperationException( - $"Не удалось создать администратора: {string.Join(", ", createResult.Errors.Select(e => e.Description))}"); + $"Failed to create admin account: {string.Join(", ", createResult.Errors.Select(e => e.Description))}"); } await userManager.AddToRoleAsync(admin, RoleNames.Admin); - logger.LogInformation("Создана учётка администратора {Username}", options.Username); + logger.LogInformation("Created admin account {Username}", options.Username); } private async Task SeedClientAppsAsync(CancellationToken cancellationToken) @@ -83,7 +83,7 @@ public sealed class DbInitializer( var path = Path.Combine(AppContext.BaseDirectory, "seed", "client-apps.json"); if (!File.Exists(path)) { - logger.LogWarning("Файл сида каталога приложений не найден: {Path}", path); + logger.LogWarning("Client app catalog seed file not found: {Path}", path); return; } @@ -94,7 +94,7 @@ public sealed class DbInitializer( { if (!Enum.TryParse(entry.OperatingSystem, ignoreCase: true, out var os)) { - logger.LogWarning("Неизвестная ОС '{Os}' в сиде каталога приложений — пропущено", entry.OperatingSystem); + logger.LogWarning("Unknown OS '{Os}' in client app catalog seed — skipped", entry.OperatingSystem); continue; } @@ -104,7 +104,7 @@ public sealed class DbInitializer( } await dbContext.SaveChangesAsync(cancellationToken); - logger.LogInformation("Засеян каталог приложений: {Count} записей", entries.Count); + logger.LogInformation("Seeded client app catalog: {Count} entries", entries.Count); } private sealed record ClientAppSeedEntry(