You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
senzapaura_es/despliegue/comprobar-entornos.mjs

13 lines
694 B

import { readFile } from 'node:fs/promises';
import { parseEnv } from 'node:util';
import { join } from 'node:path';
const raiz = process.argv[2];
if (!raiz) throw new Error('Indica la raíz de la instalación.');
const sitio = parseEnv(await readFile(join(raiz, '.env'), 'utf8'));
const panel = parseEnv(await readFile(join(raiz, '.env.panel'), 'utf8'));
if (!sitio.DATABASE_URL || sitio.DATABASE_URL !== panel.DATABASE_URL)
throw new Error('La web y el panel deben apuntar a la misma base PostgreSQL.');
if (!sitio.ORIGIN || !panel.ORIGIN || sitio.ORIGIN === panel.ORIGIN)
throw new Error('Configura los dos ORIGIN, uno por dominio.');
console.log('Entornos de sitio y panel coherentes.');

Powered by TurnKey Linux.