Files
ospab.host/ospabhost/backend/generate-sso-secret.js
2025-11-23 14:35:16 +03:00

29 lines
1.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env node
/**
* Генератор SSO секретного ключа
*
* Использование:
* node generate-sso-secret.js
*/
const crypto = require('crypto');
// Генерируем 64 символьный hex ключ (32 байта)
const ssoSecret = crypto.randomBytes(32).toString('hex');
console.log('\n═══════════════════════════════════════════════════════════════');
console.log(' SSO SECRET KEY');
console.log('═══════════════════════════════════════════════════════════════\n');
console.log('Ваш новый SSO_SECRET_KEY:\n');
console.log(` ${ssoSecret}\n`);
console.log('─────────────────────────────────────────────────────────────── ');
console.log('\n📋 Как использовать:\n');
console.log('1. Скопируйте ключ выше');
console.log('2. Добавьте в ospabhost8.1/backend/.env:');
console.log(` SSO_SECRET_KEY=${ssoSecret}`);
console.log('\n3. Добавьте ЭТОТ ЖЕ ключ в панель управления (ospab-panel/.env):');
console.log(` SSO_SECRET_KEY=${ssoSecret}`);
console.log('\nВАЖНО: Ключ должен быть ОДИНАКОВЫМ на обоих сайтах!');
console.log('═══════════════════════════════════════════════════════════════\n');