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.
89 lines
2.3 KiB
PHP
89 lines
2.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
require_once __DIR__ . '/../../vendor/autoload.php';
|
|
|
|
use App\Framework\QrCode\QrCodeGenerator;
|
|
use App\Framework\QrCode\ValueObjects\ErrorCorrectionLevel;
|
|
use App\Framework\QrCode\ValueObjects\QrCodeConfig;
|
|
use App\Framework\QrCode\ValueObjects\QrCodeVersion;
|
|
use App\Framework\QrCode\ValueObjects\EncodingMode;
|
|
|
|
echo "=== Finder Pattern Validation ===\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: {$size}x{$size}\n\n";
|
|
|
|
// Expected finder pattern (7x7)
|
|
// 1 1 1 1 1 1 1
|
|
// 1 0 0 0 0 0 1
|
|
// 1 0 1 1 1 0 1
|
|
// 1 0 1 1 1 0 1
|
|
// 1 0 1 1 1 0 1
|
|
// 1 0 0 0 0 0 1
|
|
// 1 1 1 1 1 1 1
|
|
|
|
$expectedFinder = [
|
|
[1, 1, 1, 1, 1, 1, 1],
|
|
[1, 0, 0, 0, 0, 0, 1],
|
|
[1, 0, 1, 1, 1, 0, 1],
|
|
[1, 0, 1, 1, 1, 0, 1],
|
|
[1, 0, 1, 1, 1, 0, 1],
|
|
[1, 0, 0, 0, 0, 0, 1],
|
|
[1, 1, 1, 1, 1, 1, 1],
|
|
];
|
|
|
|
$finderPositions = [
|
|
['name' => 'Top-Left', 'row' => 0, 'col' => 0],
|
|
['name' => 'Top-Right', 'row' => 0, 'col' => $size - 7],
|
|
['name' => 'Bottom-Left', 'row' => $size - 7, 'col' => 0],
|
|
];
|
|
|
|
foreach ($finderPositions as $finder) {
|
|
echo "=== {$finder['name']} Finder Pattern ===\n";
|
|
$errors = 0;
|
|
|
|
for ($r = 0; $r < 7; $r++) {
|
|
$row = $finder['row'] + $r;
|
|
$bits = '';
|
|
$expectedBits = '';
|
|
|
|
for ($c = 0; $c < 7; $c++) {
|
|
$col = $finder['col'] + $c;
|
|
$isDark = $matrix->getModuleAt($row, $col)->isDark();
|
|
$expectedDark = $expectedFinder[$r][$c] === 1;
|
|
|
|
$bits .= $isDark ? '1' : '0';
|
|
$expectedBits .= $expectedDark ? '1' : '0';
|
|
|
|
if ($isDark !== $expectedDark) {
|
|
$errors++;
|
|
}
|
|
}
|
|
|
|
echo "Row {$r}: {$bits} (expected: {$expectedBits})";
|
|
if ($bits === $expectedBits) {
|
|
echo " ✅\n";
|
|
} else {
|
|
echo " ❌\n";
|
|
}
|
|
}
|
|
|
|
if ($errors === 0) {
|
|
echo "✅ {$finder['name']} finder pattern is CORRECT\n\n";
|
|
} else {
|
|
echo "❌ {$finder['name']} finder pattern has {$errors} errors\n\n";
|
|
}
|
|
}
|
|
|
|
|