mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
update jwt secret
This commit is contained in:
@@ -2643,7 +2643,7 @@ vmail
|
|||||||
def configure_jwt_secret():
|
def configure_jwt_secret():
|
||||||
import secrets
|
import secrets
|
||||||
secret = secrets.token_urlsafe(32)
|
secret = secrets.token_urlsafe(32)
|
||||||
fastapi_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'fastapi_ssh_server.py')
|
fastapi_file = '/usr/local/CyberCP/fastapi_ssh_server.py'
|
||||||
with open(fastapi_file, 'r') as f:
|
with open(fastapi_file, 'r') as f:
|
||||||
lines = f.readlines()
|
lines = f.readlines()
|
||||||
with open(fastapi_file, 'w') as f:
|
with open(fastapi_file, 'w') as f:
|
||||||
|
|||||||
@@ -2021,7 +2021,7 @@ def get_terminal_jwt(request):
|
|||||||
# Read JWT_SECRET from fastapi_ssh_server.py
|
# Read JWT_SECRET from fastapi_ssh_server.py
|
||||||
jwt_secret = None
|
jwt_secret = None
|
||||||
try:
|
try:
|
||||||
with open(os.path.join(os.path.dirname(os.path.dirname(__file__)), '../fastapi_ssh_server.py')) as f:
|
with open('/usr/local/CyberCP/fastapi_ssh_server.py', 'r') as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
m = re.match(r'\s*JWT_SECRET\s*=\s*[\'"](.+)[\'"]', line)
|
m = re.match(r'\s*JWT_SECRET\s*=\s*[\'"](.+)[\'"]', line)
|
||||||
if m and m.group(1) != 'REPLACE_ME_WITH_INSTALLER':
|
if m and m.group(1) != 'REPLACE_ME_WITH_INSTALLER':
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user