Enhance configuration and logging for user management commands
- Updated `.env.example` to include new settings for trusted proxies and networks for better security with X-Forwarded headers. - Modified `BlockUserCommandHandler` and `UnblockUserCommandHandler` to include logging for gateway update failures, ensuring better traceability of issues during user blocking/unblocking. - Adjusted tests for command handlers to incorporate logging functionality, improving test coverage and reliability. - Updated frontend configuration to dynamically set the server port based on environment variables.
This commit is contained in:
@@ -47,3 +47,11 @@ Telegram__AdminTelegramUserIds=123456789
|
||||
# ── ASP.NET Core ──────────────────────────────────────────────────────────
|
||||
ASPNETCORE_ENVIRONMENT=Production
|
||||
ASPNETCORE_HTTP_PORTS=8080
|
||||
|
||||
# ── Доверенные прокси (X-Forwarded-For/Proto) ──────────────────────────────
|
||||
# TLS терминируется вне compose внешним прокси/шлюзом. Чтобы клиент не мог подделать свой IP/схему
|
||||
# напрямую (в обход прокси), по умолчанию доверяется только loopback (дефолт ASP.NET Core). Если
|
||||
# прокси стоит не на loopback (отдельный контейнер/хост), перечисли его через запятую — конкретные
|
||||
# IP через KnownProxies и/или сети в формате CIDR через KnownNetworks.
|
||||
# ForwardedHeaders__KnownProxies=203.0.113.10
|
||||
# ForwardedHeaders__KnownNetworks=172.18.0.0/16
|
||||
|
||||
Reference in New Issue
Block a user