Initial homepage skill - dynamic dashboard

This commit is contained in:
Azat
2026-02-02 22:57:25 +01:00
commit e3f2326b72
3 changed files with 404 additions and 0 deletions

46
scripts/autorun.sh Normal file
View File

@@ -0,0 +1,46 @@
#!/bin/bash
set -e
SKILLS_DIR="${SKILLS_DIR:-/skills}"
# Install dependencies
install_deps() {
if command -v socat &>/dev/null && command -v jq &>/dev/null; then
return 0
fi
echo "Installing dependencies..."
apt-get update && apt-get install -y socat jq
}
# Configure Caddy if present
configure_caddy() {
local caddy_dir="$SKILLS_DIR/caddy"
local homepage_port="${HOMEPAGE_PORT:-3000}"
local homepage_domain="${HOMEPAGE_DOMAIN:-}"
if [ ! -d "$caddy_dir" ]; then
echo "Caddy not found - Homepage on port $homepage_port"
return 0
fi
echo "Caddy detected - configuring reverse proxy..."
mkdir -p "$caddy_dir/snippets.d"
local snippet="$caddy_dir/snippets.d/homepage.caddy"
if [ -n "$homepage_domain" ]; then
cat > "$snippet" << EOF
# Auto-generated by homepage skill
$homepage_domain {
reverse_proxy localhost:$homepage_port
}
EOF
echo "Caddy config: $homepage_domain -> localhost:$homepage_port"
fi
}
install_deps
configure_caddy
echo "Homepage setup complete"