coolify/app/Rules
Andras Bacsai d93a13eeee feat: add YAML validation for cloud-init scripts
Add ValidCloudInitYaml validation rule to ensure cloud-init scripts
are properly formatted before saving. The validator supports:
- Cloud-config YAML (with or without #cloud-config header)
- Bash scripts (starting with #!)
- Empty/null values (optional field)

Uses Symfony YAML parser to validate YAML syntax and provides
detailed error messages when validation fails.

Added comprehensive unit tests covering:
- Valid cloud-config with/without header
- Valid bash scripts
- Invalid YAML syntax detection
- Complex multi-section cloud-config

Applied validation to:
- ByHetzner component (server creation)
- CloudInitScriptForm component (script management)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-11 13:56:55 +02:00
..
DockerImageFormat.php feat(docker): enhance Docker image handling with new validation and parsing logic 2025-10-03 11:31:00 +02:00
ValidCloudInitYaml.php feat: add YAML validation for cloud-init scripts 2025-10-11 13:56:55 +02:00
ValidGitBranch.php feat(validation): add custom validation rules for Git repository URLs and branches 2025-08-22 14:38:21 +02:00
ValidGitRepositoryUrl.php fix(validation): update git:// URL validation to support port numbers and tilde characters in paths 2025-09-29 12:21:15 +02:00
ValidHostname.php feat: implement ValidHostname validation rule and integrate it into server creation process 2025-10-10 11:03:13 +02:00
ValidIpOrCidr.php feat(validation): add ValidIpOrCidr rule for validating IP addresses and CIDR notations; update API access settings UI and add comprehensive tests 2025-08-26 10:27:38 +02:00