-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
79 lines (64 loc) · 1.96 KB
/
deploy.sh
File metadata and controls
79 lines (64 loc) · 1.96 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
#!/bin/bash
set -e
RED='\033[0;31m'
GREEN='\033[0;32m'
BLUE='\033[0;34m'
NC='\033[0m'
INSTALL_DIR="$HOME/slipstream-panel"
DATA_DIR="$HOME/.slipstream-panel"
echo -e "${BLUE}Slipstream Panel Installer${NC}"
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ARCH="amd64" ;;
aarch64) ARCH="arm64" ;;
esac
echo -e "${GREEN}✓${NC} Detected: $ARCH"
mkdir -p "$INSTALL_DIR" "$DATA_DIR"
read -p "Admin username [admin]: " ADMIN_USER
ADMIN_USER="${ADMIN_USER:-admin}"
read -s -p "Admin password: " ADMIN_PASS
echo ""
read -p "Panel port [8080]: " PORT
PORT="${PORT:-8080}"
cat > "$DATA_DIR/.env" << EOF
HOST=0.0.0.0
PANEL_PORT=$PORT
DATABASE_URL=sqlite:$DATA_DIR/panel.db
ADMIN_USERNAME=$ADMIN_USER
ADMIN_PASSWORD=$ADMIN_PASS
ENCRYPTION_KEY=$(openssl rand -base64 32)
EOF
# Build the binary from source (requires Rust toolchain)
if command -v cargo &>/dev/null; then
echo -e "${BLUE}Building slipstream-panel from source...${NC}"
if ! cargo build --release --manifest-path "$(dirname "$0")/Cargo.toml" \
2>&1 | tee /tmp/slipstream-build.log; then
echo -e "${RED}Build failed. See /tmp/slipstream-build.log for details.${NC}"
exit 1
fi
cp "$(dirname "$0")/target/release/slipstream-panel" "$INSTALL_DIR/slipstream-panel"
echo -e "${GREEN}✓${NC} Binary built and installed"
else
echo -e "${RED}Error: Rust toolchain (cargo) not found.${NC}"
echo "Install Rust via: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
exit 1
fi
sudo tee /etc/systemd/system/slipstream-panel.service > /dev/null << EOF
[Unit]
Description=Slipstream Panel
After=network.target
[Service]
Type=simple
User=$USER
WorkingDirectory=$INSTALL_DIR
EnvironmentFile=$DATA_DIR/.env
ExecStart=$INSTALL_DIR/slipstream-panel
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable slipstream-panel
echo -e "${GREEN}✓${NC} Installation complete!"
echo "Start with: sudo systemctl start slipstream-panel"