fix keys(again)
This commit is contained in:
parent
668dccdb71
commit
adebf02419
|
@ -6,7 +6,7 @@ const base = require('js-base64');
|
||||||
const cookie_parse = require('cookie-parser');
|
const cookie_parse = require('cookie-parser');
|
||||||
const cookie_encrypt = require('cookie-encrypter');
|
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_parse(APP_KEY));
|
||||||
router.use(cookie_encrypt(APP_KEY));
|
router.use(cookie_encrypt(APP_KEY));
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import secrets
|
import random
|
||||||
import base64
|
import base64
|
||||||
|
|
||||||
if (not os.path.exists('.env')):
|
if (not os.path.exists('.env')):
|
||||||
print('No .env file found. Please create a dotenv to proceed.');
|
print('No .env file found. Please create a dotenv to proceed.');
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
||||||
key_bytes = secrets.token_bytes(32);
|
secrets = random.SystemRandom()
|
||||||
|
|
||||||
|
key_bytes = ''.join(secrets.choices(list('abcdef1234567890'), k=32)).encode('ascii');
|
||||||
dotenv_text = '';
|
dotenv_text = '';
|
||||||
|
|
||||||
with open('.env', 'tr', encoding='utf-8') as f:
|
with open('.env', 'tr', encoding='utf-8') as f:
|
||||||
|
|
Loading…
Reference in New Issue