mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-06-16 20:52:27 +02:00
Merge remote-tracking branch 'origin/v2.4.0' into v2.4.0-dev
This commit is contained in:
@@ -1953,6 +1953,8 @@ class BackupManager:
|
||||
for items in not_allowed_characters:
|
||||
userName = userName.replace(items, '')
|
||||
|
||||
import plogical.randomPassword as randomPassword
|
||||
|
||||
backup_plan = OneClickBackups(
|
||||
owner=user,
|
||||
planName=plan_name,
|
||||
@@ -1960,7 +1962,7 @@ class BackupManager:
|
||||
price=price,
|
||||
customer=customer,
|
||||
subscription=subscription,
|
||||
sftpUser=f'{userName}{str(randint(1000, 9999))}',
|
||||
sftpUser=f'{userName}_{randomPassword.generate_pass(8)}'.lower(),
|
||||
)
|
||||
backup_plan.save()
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import string
|
||||
import random
|
||||
import secrets
|
||||
|
||||
def generate_pass(length=14):
|
||||
chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
|
||||
size = length
|
||||
return ''.join(random.choice(chars) for x in range(size))
|
||||
chars = string.ascii_uppercase + string.ascii_lowercase + string.digits
|
||||
return ''.join(secrets.choice(chars) for _ in range(length))
|
||||
Reference in New Issue
Block a user