mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 13:25:51 +01:00
update jwt secret
This commit is contained in:
@@ -2643,7 +2643,7 @@ vmail
|
||||
def configure_jwt_secret():
|
||||
import secrets
|
||||
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:
|
||||
lines = f.readlines()
|
||||
with open(fastapi_file, 'w') as f:
|
||||
|
||||
@@ -2021,7 +2021,7 @@ def get_terminal_jwt(request):
|
||||
# Read JWT_SECRET from fastapi_ssh_server.py
|
||||
jwt_secret = None
|
||||
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:
|
||||
m = re.match(r'\s*JWT_SECRET\s*=\s*[\'"](.+)[\'"]', line)
|
||||
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