-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall-red-engine.sh
More file actions
executable file
·60 lines (53 loc) · 1.81 KB
/
Copy pathinstall-red-engine.sh
File metadata and controls
executable file
·60 lines (53 loc) · 1.81 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
#!/bin/bash
echo "========================================"
echo "🚀 Installing RED Engine (Production Mode)..."
echo "========================================"
if [ ! -f "docker-compose.yml" ]; then
echo "[*] Cloning RED Engine repository..."
git clone https://github.com/RED-Collective/red-engine.git
cd red-engine || exit 1
fi
if [ ! -d "./data" ]; then
echo "[*] Creating ./data directory..."
mkdir -p ./data
else
echo "[*] ./data directory already exists."
fi
if [ ! -f "config.json" ]; then
echo "[*] Generating default config.json..."
NEW_TOKEN=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 24 | head -n 1)
cat <<EOF > config.json
{
"addr": ":8080",
"siteName": "RED Engine",
"dataDir": "/app/data",
"adminToken": "$NEW_TOKEN",
"startupSync": []
}
EOF
echo "[*] Generated Admin Token: $NEW_TOKEN"
fi
if [ ! -f "contributors.json" ]; then
echo "[]" > contributors.json
else
echo "[*] contributors.json already exists."
fi
# 5. Detect the container engine
if command -v podman-compose &> /dev/null; then
COMPOSE_CMD="podman-compose up --build -d"
elif command -v docker-compose &> /dev/null; then
COMPOSE_CMD="docker-compose up --build -d"
elif command -v docker &> /dev/null && docker compose version &> /dev/null; then
COMPOSE_CMD="docker compose up --build -d"
else
echo "❌ Error: Neither podman-compose nor docker compose found on this system."
echo "Please install Podman or Docker to continue."
exit 1
fi
echo "[*] Starting RED Engine using container engine..."
$COMPOSE_CMD
echo "========================================"
echo "✅ Installation Complete!"
echo "🌐 Your node is running at: http://${HOST_IP}:${CONFIG_PORT}"
echo "⚙️ Admin Panel: http://${HOST_IP}:${CONFIG_PORT}/-/admin"
echo "========================================"