Update roxy.py

pull/410/head
Nijat 2024-12-24 17:15:34 +04:00 committed by GitHub
parent cd4d54611c
commit 32313928eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -100,6 +100,8 @@ def action_service(action: str, service: str) -> str:
'stop': 'disable --now',
'restart': 'restart',
}
if not re.match(r'^[a-zA-Z0-9\.\-]+$', service):
return f"Invalid service name: {service}. Only alphanumeric characters, dots, and hyphens are allowed."
cmd = f"sudo systemctl {actions[action]} {service}"
if not roxy_sql.select_user_status():
return 'warning: The service is disabled because you are not subscribed. Read <a href="https://roxy-wi.org/pricing" ' \