Skip to content

Commit 95c2fe4

Browse files
committed
Making simpler to create necessary env.file
Signed-off-by: Cédric Foellmi <cedric@onekiloparsec.dev>
1 parent 0b4c167 commit 95c2fe4

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

dot_env_template

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
SECRET_KEY=<use generate_keys.py to get the keys>
2+
FIELD_ENCRYPTION_KEY=<use generate_keys.py to get the keys>
3+
SHARED_DATA_PATH=<put here the folder path where data and backups will be stored>
4+

generate_keys.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python3
2+
3+
import base64
4+
import os
5+
import secrets
6+
7+
length = 50
8+
chars = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
9+
10+
secret_key = ''.join(secrets.choice(chars) for i in range(length))
11+
print(f"SECRET_KEY={secret_key}")
12+
13+
new_key = base64.urlsafe_b64encode(os.urandom(32))
14+
print(f"FIELD_ENCRYPTION_KEY={new_key.decode('UTF8')}")

0 commit comments

Comments
 (0)