Wachato CRM: versión marca blanca configurable por entorno

CRM de WhatsApp, Instagram, Messenger y TikTok de Wachato, basado en Vocero
CRM (MIT), listo para desplegar un negocio por instancia:

- Marca blanca: nombre, color, moneda y giro del negocio desde el .env
  (BRAND_NAME, BRAND_ACCENT, BRAND_CURRENCY, BUSINESS_DESCRIPTION); se
  aplican una vez y luego manda Ajustes → Marca.
- Superadmin sembrado al arrancar (SUPERADMIN_*), idempotente.
- Servicios y precios, campos personalizados, exportación a Excel/PDF,
  respaldos, agenda, atribución de anuncios y transcripción de notas de voz.
- Diseño con contraste AAA, tema claro y oscuro.
- Despliegue: docker compose (Caddy opcional), plantillas para paneles con
  reverse proxy (deploy/aapanel), imagen publicada en GHCR por la CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Andres Corazon Santana AquinoandClaude Opus 5.5 committed 2026-12-04 15:54:58 -04:00
commit 6edc6020d5
1316 files changed
+308543

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
import { beforeAll, describe, expect, it } from "vitest";
beforeAll(() => {
process.env.APP_BASE_URL = "http://localhost:3000";
process.env.DATABASE_URL = "postgresql://test:test@localhost:5432/test";
process.env.BETTER_AUTH_SECRET = "secret-de-test-suficiente";
process.env.ENCRYPTION_KEY = Buffer.alloc(32, 7).toString("base64");
process.env.META_WEBHOOK_VERIFY_TOKEN = "verify-token-test";
});
describe("crypto AES-256-GCM", () => {
it("cifra y descifra (roundtrip)", async () => {
const { encryptSecret, decryptSecret } = await import("@/lib/crypto");
const value = encryptSecret("EAAG-token-super-secreto");
expect(value.cipher).not.toContain("token");
expect(Buffer.from(value.iv, "base64")).toHaveLength(12);
expect(decryptSecret(value)).toBe("EAAG-token-super-secreto");
});
it("dos cifrados del mismo texto producen ciphertexts distintos (IV aleatorio)", async () => {
const { encryptSecret } = await import("@/lib/crypto");
const a = encryptSecret("mismo-texto");
const b = encryptSecret("mismo-texto");
expect(a.cipher).not.toBe(b.cipher);
expect(a.iv).not.toBe(b.iv);
});
it("tag manipulado lanza (integridad GCM)", async () => {
const { encryptSecret, decryptSecret } = await import("@/lib/crypto");
const value = encryptSecret("dato");
const tampered = {
...value,
tag: Buffer.alloc(16, 1).toString("base64"),
};
expect(() => decryptSecret(tampered)).toThrow();
});
});