Merge pull request #410 from 0xs1ash/master

Update roxy.py
master
Pavel Loginov 2024-12-26 14:04:53 +03:00 committed by GitHub
commit 6ba2567bdd
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" ' \