ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.
Python astracloudflarecontrol-panelcyberpaneldnsfablehosting-control-panelhosting-panelkimi-k3server-managementserverkitubuntu-web-panelwebserver
fix: Template validation now handles list-format variables
Juan Denis22d5074834dd
diff --git a/backend/app/services/template_service.py b/backend/app/services/template_service.pyindex 688400f1..86896120 100644--- a/backend/app/services/template_service.py+++ b/backend/app/services/template_service.py@@ -92,11 +92,21 @@ class TemplateService:if 'services' not in compose:errors.append("Compose section must have 'services'")- # Validate variables+ # Validate variables (support both list and dict formats)if 'variables' in template:- for var_name, var_config in template['variables'].items():- if not isinstance(var_config, dict):- errors.append(f"Variable {var_name} must be a dictionary")+ variables = template['variables']+ if isinstance(variables, list):+ # List format: [{name: 'PORT', type: 'port', ...}, ...]+ for var in variables:+ if not isinstance(var, dict):+ errors.append("Each variable in list must be a dictionary")+ elif 'name' not in var:+ errors.append("Each variable must have a 'name' field")+ elif isinstance(variables, dict):+ # Dict format: {PORT: {type: 'port', ...}, ...}+ for var_name, var_config in variables.items():+ if not isinstance(var_config, dict):+ errors.append(f"Variable {var_name} must be a dictionary")if errors:return {'valid': False, 'errors': errors}