85 lines
2.2 KiB
Bash
85 lines
2.2 KiB
Bash
|
|
#!/bin/bash
|
||
|
|
|
||
|
|
# Dashy Setup Script
|
||
|
|
# This script automates the setup of Dashy for homelab dashboard
|
||
|
|
|
||
|
|
echo "Setting up Dashy dashboard for homelab services..."
|
||
|
|
|
||
|
|
# Create Dashy directory structure
|
||
|
|
mkdir -p /opt/dashy/config
|
||
|
|
mkdir -p /opt/dashy/public
|
||
|
|
|
||
|
|
# Create sample Dashy configuration
|
||
|
|
cat > /opt/dashy/config/config.yml << 'EOF'
|
||
|
|
# Dashy Configuration
|
||
|
|
title: "My Homelab Dashboard"
|
||
|
|
subtitle: "Home Network Services"
|
||
|
|
theme: "default"
|
||
|
|
favicon: "/public/favicon.ico"
|
||
|
|
backgroundImage: "/public/background.jpg"
|
||
|
|
showStats: true
|
||
|
|
showSearch: true
|
||
|
|
sections:
|
||
|
|
- name: "Network Infrastructure"
|
||
|
|
items:
|
||
|
|
- title: "Router"
|
||
|
|
description: "Main network router"
|
||
|
|
url: "http://192.168.1.1"
|
||
|
|
icon: "router"
|
||
|
|
category: "network"
|
||
|
|
- title: "Firewall"
|
||
|
|
description: "Network security"
|
||
|
|
url: "http://192.168.1.254"
|
||
|
|
icon: "shield"
|
||
|
|
category: "network"
|
||
|
|
- title: "NAS"
|
||
|
|
description: "Network attached storage"
|
||
|
|
url: "http://192.168.1.10"
|
||
|
|
icon: "server"
|
||
|
|
category: "storage"
|
||
|
|
- name: "Media Services"
|
||
|
|
items:
|
||
|
|
- title: "Media Server"
|
||
|
|
description: "Home media streaming"
|
||
|
|
url: "http://192.168.1.20"
|
||
|
|
icon: "tv"
|
||
|
|
category: "media"
|
||
|
|
- title: "Smart TV"
|
||
|
|
description: "4K streaming device"
|
||
|
|
url: "http://192.168.1.104"
|
||
|
|
icon: "smart-tv"
|
||
|
|
category: "media"
|
||
|
|
- name: "Home Automation"
|
||
|
|
items:
|
||
|
|
- title: "Home Hub"
|
||
|
|
description: "Home automation control"
|
||
|
|
url: "http://192.168.1.30"
|
||
|
|
icon: "home"
|
||
|
|
category: "automation"
|
||
|
|
- title: "IoT Devices"
|
||
|
|
description: "Internet of Things"
|
||
|
|
url: "http://192.168.1.150"
|
||
|
|
icon: "devices"
|
||
|
|
category: "automation"
|
||
|
|
EOF
|
||
|
|
|
||
|
|
# Create systemd service file for Dashy
|
||
|
|
cat > /etc/systemd/system/dashy.service << 'EOF'
|
||
|
|
[Unit]
|
||
|
|
Description=Dashy Homelab Dashboard
|
||
|
|
After=network.target
|
||
|
|
|
||
|
|
[Service]
|
||
|
|
Type=simple
|
||
|
|
User=dashy
|
||
|
|
Group=dashy
|
||
|
|
WorkingDirectory=/opt/dashy
|
||
|
|
ExecStart=/usr/local/bin/dashy --config /opt/dashy/config/config.yml
|
||
|
|
Restart=always
|
||
|
|
RestartSec=10
|
||
|
|
|
||
|
|
[Install]
|
||
|
|
WantedBy=multi-user.target
|
||
|
|
EOF
|
||
|
|
|
||
|
|
echo "Dashy setup complete. You can now run: sudo systemctl start dashy"
|