Remove WireGuard integration from production deployment to simplify infrastructure: - Remove docker-compose-direct-access.yml (VPN-bound services) - Remove VPN-only middlewares from Grafana, Prometheus, Portainer - Remove WireGuard middleware definitions from Traefik - Remove WireGuard IPs (10.8.0.0/24) from Traefik forwarded headers All monitoring services now publicly accessible via subdomains: - grafana.michaelschiemer.de (with Grafana native auth) - prometheus.michaelschiemer.de (with Basic Auth) - portainer.michaelschiemer.de (with Portainer native auth) All services use Let's Encrypt SSL certificates via Traefik.
56 lines
1.7 KiB
PHP
56 lines
1.7 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Framework\ExceptionHandling;
|
|
|
|
use App\Framework\ExceptionHandling\Context\ExceptionContextProvider;
|
|
use App\Framework\ExceptionHandling\Renderers\ResponseErrorRenderer;
|
|
use App\Framework\ExceptionHandling\Reporter\LogReporter;
|
|
use App\Framework\Http\Response;
|
|
use Throwable;
|
|
|
|
final readonly class ErrorKernel
|
|
{
|
|
public function __construct(
|
|
private ErrorRendererFactory $rendererFactory = new ErrorRendererFactory,
|
|
) {}
|
|
public function handle(Throwable $e, array $context = []): mixed
|
|
{
|
|
|
|
$log = new LogReporter();
|
|
$log->report($e);
|
|
|
|
var_dump((string)$e);
|
|
|
|
$this->rendererFactory->getRenderer()->render();
|
|
|
|
exit();
|
|
|
|
return null;
|
|
}
|
|
|
|
/**
|
|
* Create HTTP Response from exception without terminating execution
|
|
*
|
|
* This method enables middleware recovery patterns by returning a Response
|
|
* object instead of terminating the application.
|
|
*
|
|
* @param Throwable $exception Exception to render
|
|
* @param ExceptionContextProvider|null $contextProvider Optional WeakMap context provider
|
|
* @param bool $isDebugMode Enable debug information in response
|
|
* @return Response HTTP Response object (JSON for API, HTML for web)
|
|
*/
|
|
public function createHttpResponse(
|
|
Throwable $exception,
|
|
?ExceptionContextProvider $contextProvider = null,
|
|
bool $isDebugMode = false
|
|
): Response {
|
|
// Create ResponseErrorRenderer with debug mode setting
|
|
$renderer = new ResponseErrorRenderer($isDebugMode);
|
|
|
|
// Generate and return Response object
|
|
return $renderer->createResponse($exception, $contextProvider);
|
|
}
|
|
}
|
|
|