File size: 28,650 Bytes
7c5f772 21821f5 7c5f772 21821f5 7c5f772 21821f5 7c5f772 21821f5 7c5f772 21821f5 7c5f772 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 |
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Matverse FRP Fullstack - Production Ready</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
.gradient-bg {
background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}
.code-block {
font-family: 'Courier New', monospace;
background-color: #1e293b;
color: #f8fafc;
border-radius: 0.5rem;
padding: 1rem;
overflow-x: auto;
}
.feature-card:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.glow {
box-shadow: 0 0 15px rgba(59, 130, 246, 0.5);
}
</style>
</head>
<body class="bg-gray-50">
<!-- Header -->
<header class="gradient-bg text-white">
<div class="container mx-auto px-4 py-12">
<div class="flex flex-col md:flex-row items-center justify-between">
<div class="mb-8 md:mb-0">
<h1 class="text-4xl md:text-5xl font-bold mb-4">Matverse FRP Fullstack</h1>
<p class="text-xl md:text-2xl opacity-90">Solução completa para Factory Reset Protection corporativo</p>
<div class="mt-8">
<a href="sandbox:/mnt/data/matverse_frp_fullstack.zip" class="inline-flex items-center px-6 py-3 bg-white text-blue-800 font-semibold rounded-lg hover:bg-gray-100 transition duration-300 glow">
<i class="fas fa-download mr-2"></i> Baixar o ZIP
</a>
</div>
</div>
<div class="relative w-full md:w-1/3">
<div class="absolute -top-10 -left-10 w-32 h-32 bg-blue-400 rounded-full opacity-20"></div>
<div class="absolute -bottom-10 -right-10 w-32 h-32 bg-blue-400 rounded-full opacity-20"></div>
<div class="relative bg-white p-6 rounded-xl shadow-xl">
<div class="flex items-center mb-4">
<div class="w-3 h-3 bg-red-500 rounded-full mr-2"></div>
<div class="w-3 h-3 bg-yellow-500 rounded-full mr-2"></div>
<div class="w-3 h-3 bg-green-500 rounded-full"></div>
</div>
<div class="code-block">
<span class="text-green-400">$</span> docker compose up -d --build
<br><br>
<span class="text-green-400">$</span> <span class="text-gray-400"># Frontend: https://frp.seu-dominio.com</span>
<br>
<span class="text-green-400">$</span> <span class="text-gray-400"># API: https://frp.seu-dominio.com/api</span>
</div>
</div>
</div>
</div>
</div>
</header>
<!-- Main Content -->
<main class="container mx-auto px-4 py-12">
<!-- Summary Section -->
<section class="mb-16">
<h2 class="text-3xl font-bold mb-8 text-center">Stack de Produção Completo</h2>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<!-- Backend Card -->
<div class="bg-white p-6 rounded-xl shadow-lg feature-card transition duration-300">
<div class="text-blue-600 mb-4">
<i class="fas fa-server text-4xl"></i>
</div>
<h3 class="text-xl font-bold mb-3">Backend (FastAPI)</h3>
<ul class="space-y-2 text-gray-700">
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>FRP corporativo autorizado (AMAPI/Knox mock)</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>Auditoria criptográfica (SHA3 + Merkle)</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>Auth via JWT OIDC (JWKS) ou API Key</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>CORS, rate-limit básico e /healthz</span>
</li>
</ul>
</div>
<!-- Frontend Card -->
<div class="bg-white p-6 rounded-xl shadow-lg feature-card transition duration-300">
<div class="text-blue-600 mb-4">
<i class="fas fa-desktop text-4xl"></i>
</div>
<h3 class="text-xl font-bold mb-3">Frontend (Vite/React)</h3>
<ul class="space-y-2 text-gray-700">
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>SPA leve e performática</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>/api por proxy</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>UI completa para fluxo de FRP</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>Enroll → Verify → Enterprise Reset → Audit</span>
</li>
</ul>
</div>
<!-- Proxy Card -->
<div class="bg-white p-6 rounded-xl shadow-lg feature-card transition duration-300">
<div class="text-blue-600 mb-4">
<i class="fas fa-network-wired text-4xl"></i>
</div>
<h3 class="text-xl font-bold mb-3">Proxy (Caddy)</h3>
<ul class="space-y-2 text-gray-700">
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>TLS automático (Let's Encrypt)</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>Roteamento inteligente</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>/ → frontend</span>
</li>
<li class="flex items-start">
<i class="fas fa-check-circle text-green-500 mt-1 mr-2"></i>
<span>/api → backend</span>
</li>
</ul>
</div>
</div>
</section>
<!-- Probability Model Section -->
<section class="mb-16 bg-white p-8 rounded-xl shadow-lg">
<h2 class="text-3xl font-bold mb-6 text-center">Modelo de Elegibilidade e Risco</h2>
<div class="flex flex-col md:flex-row items-center">
<div class="w-full md:w-1/2 mb-8 md:mb-0">
<div class="code-block text-center">
$$ E=\mathbb{1}\{\text{managed}=1\}\,\mathbb{1}\{|\text{reason}|\ge 5\}\,\mathbb{1}\{|\text{actor}|\ge 3\} $$
</div>
<p class="mt-4 text-gray-700">
Somente <span class="font-bold">E=1</span> permite reset. Reduz <span class="font-bold">falsos positivos</span> e risco jurídico-operacional.
</p>
</div>
<div class="w-full md:w-1/2 md:pl-8">
<div class="bg-blue-50 p-6 rounded-lg">
<h3 class="text-xl font-bold mb-4 text-blue-800">Segurança e Robustez</h3>
<ul class="space-y-3">
<li class="flex items-start">
<div class="bg-blue-100 p-1 rounded-full mr-3">
<i class="fas fa-lock text-blue-600 text-sm"></i>
</div>
<span><strong>JWT OIDC:</strong> Validação por JWKS com cache. P(impersonation) → 0</span>
</li>
<li class="flex items-start">
<div class="bg-blue-100 p-1 rounded-full mr-3">
<i class="fas fa-link text-blue-600 text-sm"></i>
</div>
<span><strong>Auditoria encadeada:</strong> event_hash = SHA3_256(evento), chain_hash = SHA3_256(prev || event_hash || salt)</span>
</li>
<li class="flex items-start">
<div class="bg-blue-100 p-1 rounded-full mr-3">
<i class="fas fa-tachometer-alt text-blue-600 text-sm"></i>
</div>
<span><strong>Rate limiting:</strong> Capacidade C=30 req / W=10s. SLA: E[T] ≤ 150ms</span>
</li>
<li class="flex items-start">
<div class="bg-blue-100 p-1 rounded-full mr-3">
<i class="fas fa-shield-alt text-blue-600 text-sm"></i>
</div>
<span><strong>CORS controlado e TLS com SANs corretos</strong></span>
</li>
</ul>
</div>
</div>
</div>
</section>
<!-- Comparison Section -->
<section class="mb-16">
<h2 class="text-3xl font-bold mb-8 text-center">Comparação e Análise Evolutiva</h2>
<div class="bg-white rounded-xl shadow-lg overflow-hidden">
<div class="grid grid-cols-1 md:grid-cols-2 divide-y md:divide-y-0 md:divide-x divide-gray-200">
<!-- Before -->
<div class="p-8">
<div class="flex items-center mb-6">
<div class="bg-red-100 p-2 rounded-full mr-4">
<i class="fas fa-times-circle text-red-500 text-2xl"></i>
</div>
<h3 class="text-2xl font-bold text-gray-800">Antes</h3>
</div>
<ul class="space-y-4 text-gray-700">
<li class="flex items-start">
<i class="fas fa-exclamation-triangle text-red-500 mt-1 mr-3"></i>
<span>Snippets com chave exposta no front</span>
</li>
<li class="flex items-start">
<i class="fas fa-exclamation-triangle text-red-500 mt-1 mr-3"></i>
<span>Arquitetura acoplada a SaaS externo</span>
</li>
<li class="flex items-start">
<i class="fas fa-exclamation-triangle text-red-500 mt-1 mr-3"></i>
<span>Sem garantia de compliance</span>
</li>
</ul>
</div>
<!-- After -->
<div class="p-8">
<div class="flex items-center mb-6">
<div class="bg-green-100 p-2 rounded-full mr-4">
<i class="fas fa-check-circle text-green-500 text-2xl"></i>
</div>
<h3 class="text-2xl font-bold text-gray-800">Agora (MATVERSE)</h3>
</div>
<ul class="space-y-4 text-gray-700">
<li class="flex items-start">
<i class="fas fa-star text-blue-500 mt-1 mr-3"></i>
<span><strong>Zero vendor lock-in</strong>, infraestrutura OSS (Docker, Caddy, FastAPI, Vite)</span>
</li>
<li class="flex items-start">
<i class="fas fa-star text-blue-500 mt-1 mr-3"></i>
<span><strong>Compliance-first</strong>: somente reset autorizado em ativos gerenciados</span>
</li>
<li class="flex items-start">
<i class="fas fa-star text-blue-500 mt-1 mr-3"></i>
<span><strong>Prod-ready</strong>: TLS automático, CORS, autenticação OIDC, rate-limit, logs JSON</span>
</li>
</ul>
</div>
</div>
</div>
</section>
<!-- Evolution Section -->
<section class="mb-16">
<h2 class="text-3xl font-bold mb-8 text-center">Próximos Incrementos (Custo Zero)</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-5 gap-6">
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition duration-300">
<div class="text-blue-600 mb-3">
<i class="fas fa-user-shield text-3xl"></i>
</div>
<h3 class="font-bold mb-2">RBAC por JWT</h3>
<p class="text-sm text-gray-600">Admin/Auditor/Operador via claims do token</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition duration-300">
<div class="text-blue-600 mb-3">
<i class="fas fa-signature text-3xl"></i>
</div>
<h3 class="font-bold mb-2">ICP-Brasil</h3>
<p class="text-sm text-gray-600">Assinatura digital dos bundles de auditoria</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition duration-300">
<div class="text-blue-600 mb-3">
<i class="fas fa-chart-line text-3xl"></i>
</div>
<h3 class="font-bold mb-2">Prometheus</h3>
<p class="text-sm text-gray-600">Métricas e monitoramento com Grafana</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition duration-300">
<div class="text-blue-600 mb-3">
<i class="fas fa-memory text-3xl"></i>
</div>
<h3 class="font-bold mb-2">Redis Limiter</h3>
<p class="text-sm text-gray-600">Rate limiting distribuído e HA</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition duration-300">
<div class="text-blue-600 mb-3">
<i class="fas fa-chart-bar text-3xl"></i>
</div>
<h3 class="font-bold mb-2">Observabilidade</h3>
<p class="text-sm text-gray-600">Prometheus + Grafana com dashboards FRP</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md hover:shadow-lg transition duration-300">
<div class="text-blue-600 mb-3">
<i class="fas fa-mobile-alt text-3xl"></i>
</div>
<h3 class="font-bold mb-2">Adapters Reais</h3>
<p class="text-sm text-gray-600">Android Management / Samsung Knox</p>
</div>
</div>
</section>
<!-- Deployment Instructions -->
<section class="mb-16">
<h2 class="text-3xl font-bold mb-8 text-center">Como Subir em Produção</h2>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- With Domain -->
<div class="bg-white p-8 rounded-xl shadow-lg">
<div class="flex items-center mb-6">
<div class="bg-blue-100 p-2 rounded-full mr-4">
<i class="fas fa-globe text-blue-500 text-2xl"></i>
</div>
<h3 class="text-2xl font-bold text-gray-800">Com Domínio</h3>
</div>
<ol class="space-y-4 text-gray-700">
<li class="flex items-start">
<span class="bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0">1</span>
<span>Aponte o <strong>DNS</strong> do seu domínio para o servidor</span>
</li>
<li class="flex items-start">
<span class="bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0">2</span>
<span>Copie <code class="bg-gray-100 px-1 rounded">.env.example</code> → <code class="bg-gray-100 px-1 rounded">.env</code> e preencha:</span>
</li>
<li class="pl-9 mb-4">
<div class="code-block text-sm">
DOMAIN=frp.seu-dominio.com<br>
LETSENCRYPT_EMAIL=seu@email.com<br>
API_KEY=troque-isto<br>
CORS_ORIGINS=https://frp.seu-dominio.com<br>
# Para produção, remova volume mounts de código<br>
# (ver compose.yaml) e use imagens otimizadas<br>
# (Opcional) OIDC_ISSUER=https://keycloak.seu-dominio.com/realms/matverse<br>
# (Opcional) OIDC_AUDIENCE=matverse-frp
</div>
</li>
<li class="flex items-start">
<span class="bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0">3</span>
<span>Execute: <code class="bg-gray-100 px-1 rounded">docker compose up -d --build</code></span>
</li>
<li class="flex items-start">
<span class="bg-blue-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0">4</span>
<span>Acesse <strong>https://$DOMAIN</strong> (front) e <strong>https://$DOMAIN/api</strong> (API)</span>
</li>
</ol>
</div>
<!-- Local Testing -->
<div class="bg-white p-8 rounded-xl shadow-lg">
<div class="flex items-center mb-6">
<div class="bg-purple-100 p-2 rounded-full mr-4">
<i class="fas fa-laptop-code text-purple-500 text-2xl"></i>
</div>
<div>
<h3 class="text-2xl font-bold text-gray-800">Teste Local</h3>
<p class="text-sm text-purple-600">Usando perfil 'local' do Docker Compose</p>
</div>
</div>
<ol class="space-y-4 text-gray-700">
<li class="flex items-start">
<span class="bg-purple-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0">1</span>
<span>Execute:</span>
</li>
<li class="pl-9 mb-4">
<div class="code-block text-sm">
docker compose --profile local up -d --build<br><br>
# Frontend: http://localhost:8080<br>
# API: http://localhost:8000 (via proxy /api)
</div>
</li>
<li class="flex items-start">
<span class="bg-purple-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0">2</span>
<span>No front (UI), deixe <code class="bg-gray-100 px-1 rounded">Base URL</code> como <strong>/api</strong> (padrão)</span>
</li>
<li class="flex items-start">
<span class="bg-purple-500 text-white rounded-full w-6 h-6 flex items-center justify-center mr-3 flex-shrink-0">3</span>
<span>Nos requests da API (Postman), inclua <code class="bg-gray-100 px-1 rounded">x-api-key: <API_KEY></code> do seu .env</span>
</li>
</ol>
</div>
</div>
</section>
<!-- Hardening Section -->
<section class="mb-16 bg-white p-8 rounded-xl shadow-lg">
<h2 class="text-3xl font-bold mb-6 text-center">Hardening de Produção</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div>
<h3 class="text-xl font-bold mb-4 text-blue-800">Melhorias de Segurança</h3>
<ul class="space-y-3 text-gray-700">
<li class="flex items-start">
<div class="bg-blue-100 p-1 rounded-full mr-3">
<i class="fas fa-shield-alt text-blue-600 text-sm"></i>
</div>
<span><strong>Read-only FS</strong> + tmpfs para escrita temporária</span>
</li>
<li class="flex items-start">
<div class="bg-blue-100 p-1 rounded-full mr-3">
<i class="fas fa-user-lock text-blue-600 text-sm"></i>
</div>
<span><strong>Usuário não-root</strong> e no-new-privileges</span>
</li>
<li class="flex items-start">
<div class="bg-blue-100 p-1 rounded-full mr-3">
<i class="fas fa-heartbeat text-blue-600 text-sm"></i>
</div>
<span><strong>Healthchecks</strong> com condições de dependência</span>
</li>
<li class="flex items-start">
<div class="bg-blue-100 p-1 rounded-full mr-3">
<i class="fas fa-tachometer-alt text-blue-600 text-sm"></i>
</div>
<span><strong>Limites de recursos</strong> (CPU/memória)</span>
</li>
</ul>
</div>
<div>
<div class="code-block text-sm">
# compose.yaml hardening<br>
services:<br>
backend:<br>
user: "1000:1000"<br>
read_only: true<br>
tmpfs: /tmp<br>
healthcheck:<br>
test: ["CMD", "wget", "-qO-", "http://localhost:8000/metrics"]<br>
deploy:<br>
resources:<br>
limits:<br>
cpus: "2.0"<br>
memory: 1g
</div>
</div>
</div>
</section>
<!-- Final CTA -->
<section class="text-center">
<div class="gradient-bg text-white p-8 rounded-xl shadow-lg">
<h2 class="text-3xl font-bold mb-4">Pronto para Implementar?</h2>
<p class="text-xl opacity-90 mb-8">Baixe agora e tenha uma solução completa de FRP corporativo em minutos</p>
<a href="sandbox:/mnt/data/matverse_frp_fullstack.zip" class="inline-flex items-center px-8 py-4 bg-white text-blue-800 font-bold rounded-lg hover:bg-gray-100 transition duration-300 text-lg glow">
<i class="fas fa-download mr-3"></i> Baixar Matverse FRP Fullstack
</a>
<p class="mt-4 text-blue-100 text-sm">
<i class="fas fa-check-circle mr-2"></i>Pronto para produção: TLS, rate-limiting, auditoria e alta disponibilidade
</p>
</div>
</section>
</main>
<!-- Footer -->
<footer class="bg-gray-800 text-white py-8">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<h3 class="text-xl font-bold">Matverse FRP Fullstack</h3>
<p class="text-gray-400">Solução completa para Factory Reset Protection</p>
</div>
<div class="flex space-x-4">
<a href="#" class="text-gray-400 hover:text-white transition duration-300">
<i class="fab fa-github text-2xl"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition duration-300">
<i class="fab fa-docker text-2xl"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white transition duration-300">
<i class="fas fa-book text-2xl"></i>
</a>
</div>
</div>
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400">
<p>© 2023 Matverse. Todos os direitos reservados.</p>
</div>
</div>
</footer>
<!-- MathJax for equations -->
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=matversedao/matverse-frp-fullstack" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |