refactor(deployment): Remove WireGuard VPN dependency and restore public service access
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.
This commit is contained in:
98
tests/debug/test-simple-svg-generation.php
Normal file
98
tests/debug/test-simple-svg-generation.php
Normal file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||||
|
||||
use App\Framework\QrCode\QrCodeGenerator;
|
||||
use App\Framework\QrCode\QrCodeRenderer;
|
||||
use App\Framework\QrCode\ValueObjects\ErrorCorrectionLevel;
|
||||
use App\Framework\QrCode\ValueObjects\QrCodeConfig;
|
||||
use App\Framework\QrCode\ValueObjects\QrCodeVersion;
|
||||
use App\Framework\QrCode\ValueObjects\EncodingMode;
|
||||
use App\Framework\QrCode\ValueObjects\QrCodeStyle;
|
||||
|
||||
echo "=== Simple SVG Generation Test ===\n\n";
|
||||
|
||||
$config = new QrCodeConfig(
|
||||
version: QrCodeVersion::fromNumber(1),
|
||||
errorCorrectionLevel: ErrorCorrectionLevel::M,
|
||||
encodingMode: EncodingMode::BYTE
|
||||
);
|
||||
|
||||
$matrix = QrCodeGenerator::generate('HELLO', $config);
|
||||
$size = $matrix->getSize();
|
||||
|
||||
echo "Matrix: {$size}x{$size}\n\n";
|
||||
|
||||
// Generate SVG manually to ensure correct structure
|
||||
$moduleSize = 20;
|
||||
$quietZone = 80;
|
||||
$canvasSize = $size * $moduleSize + 2 * $quietZone;
|
||||
|
||||
$svg = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
|
||||
$svg .= "<svg width=\"{$canvasSize}\" height=\"{$canvasSize}\" xmlns=\"http://www.w3.org/2000/svg\">\n";
|
||||
$svg .= " <title>QR Code</title>\n";
|
||||
$svg .= " <desc>QR Code Version 1</desc>\n";
|
||||
$svg .= " <rect x=\"0\" y=\"0\" width=\"{$canvasSize}\" height=\"{$canvasSize}\" fill=\"white\" />\n";
|
||||
|
||||
// Render all dark modules
|
||||
for ($row = 0; $row < $size; $row++) {
|
||||
for ($col = 0; $col < $size; $col++) {
|
||||
if ($matrix->getModuleAt($row, $col)->isDark()) {
|
||||
$x = $quietZone + $col * $moduleSize;
|
||||
$y = $quietZone + $row * $moduleSize;
|
||||
$svg .= " <rect x=\"{$x}\" y=\"{$y}\" width=\"{$moduleSize}\" height=\"{$moduleSize}\" fill=\"black\" />\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$svg .= "</svg>\n";
|
||||
|
||||
// Save
|
||||
$filepath = __DIR__ . '/test-qrcodes/simple-manual.svg';
|
||||
file_put_contents($filepath, $svg);
|
||||
|
||||
echo "✅ Generated simple manual SVG: {$filepath}\n";
|
||||
echo " Canvas: {$canvasSize}x{$canvasSize}\n";
|
||||
echo " Module size: {$moduleSize}px\n";
|
||||
echo " Quiet zone: {$quietZone}px\n\n";
|
||||
|
||||
// Compare with renderer output
|
||||
$style = QrCodeStyle::large();
|
||||
$renderer = new QrCodeRenderer();
|
||||
$rendererSvg = $renderer->renderCustom($matrix, $style, false);
|
||||
|
||||
$rendererPath = __DIR__ . '/test-qrcodes/renderer-output.svg';
|
||||
file_put_contents($rendererPath, $rendererSvg);
|
||||
|
||||
echo "✅ Generated renderer SVG: {$rendererPath}\n\n";
|
||||
|
||||
// Compare structure
|
||||
echo "=== Structure Comparison ===\n";
|
||||
|
||||
// Count rectangles
|
||||
$manualRects = substr_count($svg, '<rect');
|
||||
$rendererRects = substr_count($rendererSvg, '<rect');
|
||||
|
||||
echo "Manual SVG rectangles: {$manualRects}\n";
|
||||
echo "Renderer SVG rectangles: {$rendererRects}\n";
|
||||
|
||||
// Check if renderer uses viewBox or other attributes
|
||||
if (strpos($rendererSvg, 'viewBox') !== false) {
|
||||
echo "Renderer SVG uses viewBox\n";
|
||||
}
|
||||
|
||||
// Check coordinate format
|
||||
if (preg_match('/<rect x="(\d+\.?\d*)" y="(\d+\.?\d*)" width="(\d+\.?\d*)" height="(\d+\.?\d*)" fill="black"/', $rendererSvg, $matches)) {
|
||||
echo "Renderer coordinate format: x={$matches[1]}, y={$matches[2]}, w={$matches[3]}, h={$matches[4]}\n";
|
||||
}
|
||||
|
||||
if (preg_match('/<rect x="(\d+\.?\d*)" y="(\d+\.?\d*)" width="(\d+\.?\d*)" height="(\d+\.?\d*)" fill="black"/', $svg, $matches)) {
|
||||
echo "Manual coordinate format: x={$matches[1]}, y={$matches[2]}, w={$matches[3]}, h={$matches[4]}\n";
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
echo "Try scanning both SVG files to see if one works better.\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user