fix keys(again)

This commit is contained in:
b1ek 2023-03-19 19:18:14 +10:00
parent 668dccdb71
commit adebf02419
Signed by: blek
GPG Key ID: 14546221E3595D0C
2 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,7 @@ const base = require('js-base64');
const cookie_parse = require('cookie-parser');
const cookie_encrypt = require('cookie-encrypter');
const APP_KEY = Buffer.from(process.env.APP_KEY, 'base64');
const APP_KEY = Buffer.from(process.env.APP_KEY, 'base64').toString('ascii');
router.use(cookie_parse(APP_KEY));
router.use(cookie_encrypt(APP_KEY));

View File

@ -1,14 +1,16 @@
#!/usr/bin/env python3
import os
import secrets
import random
import base64
if (not os.path.exists('.env')):
print('No .env file found. Please create a dotenv to proceed.');
exit(-1);
key_bytes = secrets.token_bytes(32);
secrets = random.SystemRandom()
key_bytes = ''.join(secrets.choices(list('abcdef1234567890'), k=32)).encode('ascii');
dotenv_text = '';
with open('.env', 'tr', encoding='utf-8') as f: