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:
74
tests/debug/test-quiet-zone-svg.php
Normal file
74
tests/debug/test-quiet-zone-svg.php
Normal file
@@ -0,0 +1,74 @@
|
||||
<?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 "=== Testing Quiet Zone in SVG ===\n\n";
|
||||
|
||||
$testData = 'HELLO WORLD';
|
||||
$config = new QrCodeConfig(
|
||||
version: QrCodeVersion::fromNumber(1),
|
||||
errorCorrectionLevel: ErrorCorrectionLevel::M,
|
||||
encodingMode: EncodingMode::BYTE
|
||||
);
|
||||
|
||||
$matrix = QrCodeGenerator::generate($testData, $config);
|
||||
$size = $matrix->getSize();
|
||||
|
||||
echo "Matrix size: {$size}x{$size}\n\n";
|
||||
|
||||
// Test different styles
|
||||
$styles = [
|
||||
'default' => QrCodeStyle::default(),
|
||||
'large' => QrCodeStyle::large(),
|
||||
];
|
||||
|
||||
foreach ($styles as $name => $style) {
|
||||
echo "=== Style: {$name} ===\n";
|
||||
echo "Module size: {$style->moduleSize}px\n";
|
||||
echo "Quiet zone size: {$style->quietZoneSize} modules\n";
|
||||
echo "Include quiet zone: " . ($style->includeQuietZone ? 'YES' : 'NO') . "\n";
|
||||
|
||||
$canvasSize = $style->calculateCanvasSize($size);
|
||||
$offset = $style->getQuietZoneOffset();
|
||||
|
||||
echo "Canvas size: {$canvasSize}x{$canvasSize}px\n";
|
||||
echo "Quiet zone offset: {$offset}px\n";
|
||||
echo "QR code area: " . ($size * $style->moduleSize) . "x" . ($size * $style->moduleSize) . "px\n";
|
||||
echo "Quiet zone border: {$offset}px on each side\n\n";
|
||||
|
||||
// Generate SVG
|
||||
$renderer = new QrCodeRenderer();
|
||||
$svg = $renderer->renderSvg($matrix, $style);
|
||||
|
||||
// Check if quiet zone is present in SVG
|
||||
$hasQuietZone = $offset > 0;
|
||||
$quietZoneInSvg = strpos($svg, "width=\"{$canvasSize}\"") !== false;
|
||||
|
||||
echo "SVG has quiet zone: " . ($quietZoneInSvg ? 'YES' : 'NO') . "\n";
|
||||
|
||||
// Save SVG
|
||||
$filename = "/var/www/html/tests/debug/qr-{$name}.svg";
|
||||
file_put_contents($filename, $svg);
|
||||
echo "SVG saved to: {$filename}\n";
|
||||
echo "SVG size: " . strlen($svg) . " bytes\n\n";
|
||||
}
|
||||
|
||||
echo "=== Quiet Zone Requirements ===\n";
|
||||
echo "ISO/IEC 18004 requires:\n";
|
||||
echo "- Minimum 4 modules quiet zone on all sides\n";
|
||||
echo "- Quiet zone must be white/light color\n";
|
||||
echo "- Quiet zone must be free of any markings\n\n";
|
||||
|
||||
echo "✅ Quiet zone should be correct if offset > 0 and background is light color.\n";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user