-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstaller.sh
More file actions
55 lines (43 loc) · 1.21 KB
/
installer.sh
File metadata and controls
55 lines (43 loc) · 1.21 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
#!/bin/bash
# SingFLEX Platform Installer
# Usage: sudo bash installer.sh
set -e
APP_PATH="/var/app/sf3"
REPO_URL="https://github.com/OneTV-ng/SF3.git"
NODE_VERSION="18"
# 1. Install system dependencies
apt-get update
apt-get install -y git curl build-essential
# 2. Install Node.js (if not present)
if ! command -v node &> /dev/null; then
curl -fsSL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -
apt-get install -y nodejs
fi
# 3. Install PM2 globally
npm install -g pm2
# 4. Create app directory
mkdir -p $APP_PATH
chown $USER:$USER $APP_PATH
cd $APP_PATH
# 5. Clone repository
if [ ! -d ".git" ]; then
git clone $REPO_URL .
else
git pull origin main
fi
# 6. Setup environment files
bash server-setup.sh
# 7. Install dependencies and build
cd hub && npm install && npm run build
cd ../hubx && npm install && npm run build
# 8. Run database migrations
cd $APP_PATH/hubx
npx sequelize-cli db:migrate
# 9. Start services with PM2
pm2 start $APP_PATH/hub/ecosystem.config.js
pm2 save
pm2 startup
# 10. Final instructions
echo "✅ SingFLEX installation complete!"
echo "Edit .env files in hubx/ and hub/ as needed."
echo "Access frontend at http://<server-ip>:4422 and backend at http://<server-ip>:4400"