-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev_generate_secrets.py
26 lines (23 loc) · 1.05 KB
/
dev_generate_secrets.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Bep Marketplace ELE
# Copyright (c) 2016-2022 Kolibri Solutions
# License: See LICENSE file or https://github.com/KolibriSolutions/BepMarketplace/blob/master/LICENSE
#
#
import binascii
import os.path
# secrets file with passwords.
if os.path.isfile("BepMarketplace/secret.py"):
print("secret file already exists!")
else:
key = binascii.hexlify(os.urandom(24)).decode()
with open("BepMarketplace/secret.py", "w") as stream:
stream.write(
"PYLTI_CONFIG = {{}}\nSECRET_KEY_IMPORT = '{}'\nSHEN_RING_CLIENT_ID=\"\"\nSHEN_RING_CLIENT_SECRET=\"\"\nDATABASE_PASSWORD_IMPORT = 'banaan'\n".format(
key))
print("secret file generated")
# 01-marketplace settings file with application specific information
if os.path.isfile("BepMarketplace/config/common/01-marketplace.py"):
print("marketplace settings file already exists!")
else:
os.rename('BepMarketplace/config/common/01-marketplace.py.example', 'BepMarketplace/config/common/01-marketplace.py')
print("example marketplace settings file 01-marketplace.py moved.")