Initial caddy skill

This commit is contained in:
Azat
2026-02-02 22:11:35 +01:00
commit 4821a20380
4 changed files with 107 additions and 0 deletions

4
Caddyfile Normal file
View File

@@ -0,0 +1,4 @@
# Default Caddyfile - customize as needed
:80 {
respond "VibeStack Agent - Caddy is running!"
}

54
SKILL.md Normal file
View File

@@ -0,0 +1,54 @@
---
name: caddy
description: Caddy web server with automatic HTTPS
metadata:
version: "1.0.0"
vibestack:
main: false
---
# Caddy Skill
Installs and configures [Caddy](https://caddyserver.com/) web server with automatic HTTPS.
## Features
- Automatic HTTPS with Let's Encrypt
- Reverse proxy support
- Static file serving
- Zero-downtime reloads
## Configuration
Create a `Caddyfile` in your skill's directory or set `CADDYFILE_PATH` environment variable.
### Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `CADDYFILE_PATH` | Path to Caddyfile | `/skills/caddy/Caddyfile` |
| `CADDY_DATA_DIR` | Caddy data directory | `/data/caddy` |
## Example Caddyfile
```caddyfile
:80 {
respond "Hello from Caddy!"
}
# Reverse proxy example
# api.example.com {
# reverse_proxy localhost:8080
# }
```
## Usage
This skill is typically used as a dependency by other skills that need a web server:
```yaml
metadata:
vibestack:
requires:
- caddy
```

36
scripts/autorun.sh Normal file
View File

@@ -0,0 +1,36 @@
#!/bin/bash
set -e
# Idempotent Caddy installation
install_caddy() {
if command -v caddy &>/dev/null; then
echo "caddy already installed: $(caddy version)"
return 0
fi
echo "Installing Caddy..."
# Install dependencies
apt-get update
apt-get install -y debian-keyring debian-archive-keyring apt-transport-https curl
# Add Caddy GPG key and repository
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | tee /etc/apt/sources.list.d/caddy-stable.list
# Install Caddy
apt-get update
apt-get install -y caddy
echo "Caddy installed: $(caddy version)"
}
# Create data directory
setup_dirs() {
local data_dir="${CADDY_DATA_DIR:-/data/caddy}"
mkdir -p "$data_dir"
echo "Caddy data directory: $data_dir"
}
install_caddy
setup_dirs

13
scripts/run.sh Normal file
View File

@@ -0,0 +1,13 @@
#!/bin/bash
set -e
CADDYFILE_PATH="${CADDYFILE_PATH:-/skills/caddy/Caddyfile}"
CADDY_DATA_DIR="${CADDY_DATA_DIR:-/data/caddy}"
if [ ! -f "$CADDYFILE_PATH" ]; then
echo "Error: Caddyfile not found at $CADDYFILE_PATH"
exit 1
fi
echo "Starting Caddy with config: $CADDYFILE_PATH"
exec caddy run --config "$CADDYFILE_PATH" --adapter caddyfile