feat: add cloud-init script support for Hetzner server creation

This commit adds the ability to use cloud-init scripts when creating Hetzner servers through the integration. Users can write custom scripts that will be executed during server initialization, and optionally save these scripts at the team level for future reuse.

Key features:
- Textarea field for entering cloud-init scripts (bash or cloud-config YAML)
- Checkbox to save scripts for later use at team level
- Dropdown to load previously saved scripts
- Scripts are encrypted in the database
- Full validation and authorization checks
- Comprehensive unit and feature tests

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Andras BacsaiandClaude committed 2025-10-10 19:37:16 +02:00
1 parent 2cf4058b4b
commit 7061eacfa5
7 files changed
+389

No files matched your search

@@ -156,6 +156,39 @@
</div>
</div>
<div class="flex flex-col gap-2">
<div class="flex justify-between items-center">
<label class="text-sm font-medium">Cloud-Init Script (Optional)</label>
@if ($saved_cloud_init_scripts->count() > 0)
<x-forms.select id="load_script" wire:change="loadCloudInitScript($event.target.value)"
label="" helper="">
<option value="">Load saved script...</option>
@foreach ($saved_cloud_init_scripts as $script)
<option value="{{ $script->id }}">{{ $script->name }}</option>
@endforeach
</x-forms.select>
@endif
</div>
<x-forms.textarea id="cloud_init_script" label=""
helper="Add a cloud-init script to run when the server is created. See Hetzner's documentation for details."
rows="8" />
@if (!empty($cloud_init_script))
<div class="flex flex-col gap-2 p-3 border border-neutral-200 dark:border-neutral-700 rounded">
<x-forms.checkbox id="save_cloud_init_script" label="Save this script for later use"
helper="Save this cloud-init script to your team's library for reuse" />
@if ($save_cloud_init_script)
<div class="flex flex-col gap-2 ml-6">
<x-forms.input id="cloud_init_script_name" label="Script Name" required />
<x-forms.textarea id="cloud_init_script_description" label="Description (Optional)"
rows="2" />
</div>
@endif
</div>
@endif
</div>
<div class="flex gap-2 justify-between">
<x-forms.button type="button" wire:click="previousStep">
Back