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.
69 lines
2.3 KiB
PHP
69 lines
2.3 KiB
PHP
<?php
|
||
|
||
declare(strict_types=1);
|
||
|
||
require_once __DIR__ . '/../../vendor/autoload.php';
|
||
|
||
use App\Framework\QrCode\ErrorCorrection\ReedSolomonEncoder;
|
||
|
||
echo "=== Generator Polynomial Verification ===\n\n";
|
||
|
||
$rs = new ReedSolomonEncoder();
|
||
$reflection = new ReflectionClass($rs);
|
||
|
||
// Get generator polynomial for 10 EC codewords
|
||
$getGeneratorMethod = $reflection->getMethod('getGeneratorPolynomial');
|
||
$getGeneratorMethod->setAccessible(true);
|
||
$generator = $getGeneratorMethod->invoke($rs, 10);
|
||
|
||
echo "Current generator polynomial (10 EC codewords):\n";
|
||
echo " [" . implode(', ', $generator) . "]\n\n";
|
||
|
||
// Expected from QR code specification
|
||
$expected = [0, 251, 67, 46, 61, 118, 70, 64, 94, 32, 45];
|
||
|
||
echo "Expected generator polynomial:\n";
|
||
echo " [" . implode(', ', $expected) . "]\n\n";
|
||
|
||
if ($generator === $expected) {
|
||
echo "✅ Generator polynomial matches!\n\n";
|
||
} else {
|
||
echo "❌ Generator polynomial doesn't match!\n";
|
||
echo "Differences:\n";
|
||
for ($i = 0; $i < min(count($generator), count($expected)); $i++) {
|
||
if ($generator[$i] !== $expected[$i]) {
|
||
echo " Coefficient {$i}: got {$generator[$i]}, expected {$expected[$i]}\n";
|
||
}
|
||
}
|
||
echo "\n";
|
||
}
|
||
|
||
// Test: Generate polynomial dynamically
|
||
echo "=== Testing Dynamic Generation ===\n";
|
||
$generateMethod = $reflection->getMethod('generateGeneratorPolynomial');
|
||
$generateMethod->setAccessible(true);
|
||
$generated = $generateMethod->invoke($rs, 10);
|
||
|
||
echo "Dynamically generated:\n";
|
||
echo " [" . implode(', ', $generated) . "]\n\n";
|
||
|
||
if ($generated === $expected) {
|
||
echo "✅ Dynamic generation matches expected!\n";
|
||
} else {
|
||
echo "❌ Dynamic generation doesn't match!\n";
|
||
echo "This might be the problem - the generator polynomial is wrong.\n";
|
||
}
|
||
|
||
// Check if the issue is with the leading coefficient
|
||
// In QR codes, the generator polynomial should be monic (leading coefficient = 1)
|
||
// But our polynomials start with 0
|
||
echo "\n=== Generator Polynomial Format ===\n";
|
||
echo "Note: In our implementation, generator polynomials start with [0, ...]\n";
|
||
echo "This might be correct if we're using a different representation.\n";
|
||
echo "But let's check if the actual polynomial is correct.\n\n";
|
||
|
||
// The generator polynomial should be: g(x) = (x - α^0)(x - α^1)...(x - α^9)
|
||
// When expanded, this should give us the expected coefficients
|
||
|
||
|