forked from deqrocks/deq
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·141 lines (123 loc) · 3.64 KB
/
install.sh
File metadata and controls
executable file
·141 lines (123 loc) · 3.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#!/bin/bash
#
# DeQ - Installation Script
#
set -e
echo "================================================================"
echo " DeQ - Homelab Dashboard Installer "
echo "================================================================"
echo ""
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "[ERROR] Please run as root (sudo ./install.sh)"
exit 1
fi
# Get server IP
DEFAULT_IP=$(hostname -I | awk '{print $1}')
echo "Your server IP addresses: $(hostname -I)"
read -p "Server IP for remote access [$DEFAULT_IP]: " SERVER_IP
SERVER_IP=${SERVER_IP:-$DEFAULT_IP}
# Get port
read -p "Port [5050]: " PORT
PORT=${PORT:-5050}
echo ""
echo "Installing to /opt/deq..."
# Create directories
mkdir -p /opt/deq/fonts
mkdir -p /opt/deq/history
# Copy files
cp server.py /opt/deq/
chmod +x /opt/deq/server.py
# Copy fonts if present
if [ -d "fonts" ] && [ "$(ls -A fonts 2>/dev/null)" ]; then
cp fonts/* /opt/deq/fonts/
echo "[OK] Fonts installed"
else
echo "[INFO] No fonts found. Download JetBrains Mono manually:"
echo " https://github.com/JetBrains/JetBrainsMono/releases"
echo " Extract .woff2 files to /opt/deq/fonts/"
fi
# Install systemd service
cat > /etc/systemd/system/deq.service << EOF
[Unit]
Description=DeQ - Homelab Dashboard
After=network.target docker.service
[Service]
Type=simple
ExecStart=/usr/bin/python3 /opt/deq/server.py --port $PORT
WorkingDirectory=/opt/deq
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl daemon-reload
systemctl enable deq
# Create initial config with correct host IP (if no config exists)
if [ ! -f "/opt/deq/config.json" ]; then
cat > /opt/deq/config.json << EOFCONFIG
{
"settings": {"theme": "dark", "text_color": "#e0e0e0", "accent_color": "#2ed573"},
"links": [],
"devices": [
{
"id": "host",
"name": "DeQ Host",
"ip": "$SERVER_IP",
"icon": "server",
"is_host": true
}
],
"tasks": []
}
EOFCONFIG
echo "[OK] Initial config created with host IP: $SERVER_IP"
fi
systemctl start deq
# Wait for service to start
sleep 2
echo ""
echo "================================================================"
echo " Installation complete! "
echo "================================================================"
echo ""
echo " Access URL:"
echo " http://$SERVER_IP:$PORT/"
echo ""
echo " Important! Use Tailscale or another VPN for secure remote access."
echo ""
echo " Configure everything through the web interface:"
echo " 1. Open the URL"
echo " 2. Click the pencil icon to enter edit mode"
echo " 3. Add links, devices and tasks"
echo ""
echo "================================================================"
echo ""
echo "Commands:"
echo " systemctl status deq # Check status"
echo " systemctl restart deq # Restart"
echo " journalctl -u deq -f # View logs"
echo ""
echo "Configuration is stored in:"
echo " /opt/deq/config.json"
echo ""
# SSH hint
echo "================================================================"
echo " For SSH features (stats, shutdown)"
echo "================================================================"
echo ""
echo " 1. Generate SSH key (if needed):"
echo " ssh-keygen -t ed25519"
echo ""
echo " 2. Copy to target devices:"
echo " ssh-copy-id user@device-ip"
echo ""
echo " 3. Copy key to root (DeQ runs as root):"
echo " sudo mkdir -p /root/.ssh"
echo " sudo cp ~/.ssh/id_ed25519* /root/.ssh/"
echo " sudo chmod 600 /root/.ssh/id_ed25519"
echo ""
echo " 4. Test as root:"
echo " sudo ssh user@device-ip 'echo OK'"
echo ""
echo "================================================================"