- index.html: sustituye grid de bloques por 6 tabs horizontales (Cuentas base / Redes sociales / Mensajería / Streaming / Buscadores / Data brokers) con items como tarjetas en grid responsive - egosurfing.html: dorking expandido de 12 dorks a ~95 organizados en 10 categorías OSINT profesionales (nombre, email, teléfono, alias, data brokers, pastes/brechas, registros oficiales, perfil profesional, geolocalización, archivo histórico) con sistema de tabs dinámico - erase.js: límites de longitud en campos opcionales (nickname 100, phone 30, address 300, extra 500) + type-check explícito en email Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
58 lines
2.1 KiB
JavaScript
58 lines
2.1 KiB
JavaScript
'use strict';
|
|
|
|
require('dotenv').config();
|
|
|
|
const express = require('express');
|
|
const helmet = require('helmet');
|
|
const rateLimit = require('express-rate-limit');
|
|
|
|
const eraseRoute = require('./routes/erase');
|
|
const gmailOAuth = require('./routes/gmail_oauth');
|
|
const egosearch = require('./routes/egosearch');
|
|
|
|
const app = express();
|
|
|
|
app.set('trust proxy', 1); // confía en nginx para obtener la IP real del cliente
|
|
app.disable('x-powered-by');
|
|
app.use(helmet());
|
|
app.use(express.json({ limit: '10kb' }));
|
|
|
|
// Rate limiting general
|
|
app.use(rateLimit({
|
|
windowMs: 15 * 60 * 1000,
|
|
max: 100,
|
|
standardHeaders: true,
|
|
legacyHeaders: false,
|
|
}));
|
|
|
|
// Rate limiting específico para envío de emails (más estricto)
|
|
const emailLimit = rateLimit({
|
|
windowMs: 60 * 60 * 1000, // 1 hora
|
|
max: 10,
|
|
message: { error: 'Demasiadas solicitudes de envío. Espera antes de reintentar.' }
|
|
});
|
|
|
|
// ── Rate limits específicos ───────────────────────────────────────
|
|
const searchLimit = rateLimit({
|
|
windowMs: 60 * 1000, // 1 minuto
|
|
max: 8,
|
|
message: { error: 'Demasiadas búsquedas. Espera un momento.' }
|
|
});
|
|
|
|
// ── Rutas ────────────────────────────────────────────────────────
|
|
app.post('/api/erase', emailLimit, eraseRoute);
|
|
app.get('/api/egosearch', searchLimit, egosearch);
|
|
app.get('/api/gmail/auth', emailLimit, gmailOAuth.authInit);
|
|
app.get('/api/gmail/callback', gmailOAuth.authCallback);
|
|
|
|
// Health check
|
|
app.get('/api/health', (req, res) => res.json({ status: 'ok' }));
|
|
|
|
// ── Arranque ─────────────────────────────────────────────────────
|
|
const PORT = process.env.PORT || 8787;
|
|
app.listen(PORT, '127.0.0.1', () => {
|
|
console.log(`RESETEA backend corriendo en 127.0.0.1:${PORT}`);
|
|
if (!process.env.GOOGLE_CLIENT_ID) {
|
|
console.warn('⚠ GOOGLE_CLIENT_ID no configurado — OAuth Gmail deshabilitado');
|
|
}
|
|
});
|