Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Prism
![image](https://github.com/user-attachments/assets/1d6587cf-59fe-4456-9b3b-385b79149839)

The all-in-one dashboard built from the legacy of Heliactyl. A high performance user interface, full built-in panel for managing servers, coins system, resources store and more.

Expand Down Expand Up @@ -42,7 +43,7 @@ If you don't do this, Prism can't communicate with your nodes.
- Nginx
- SSL certificate (recommended)

## 1. Prerequisites Installation
## 1. Prerequisites Installation [Harder Way]

1. Install Redis:
```bash
Expand Down Expand Up @@ -104,6 +105,36 @@ cd ../
bun run app.js
```

### Supported panel and wings operating systems

| Operating System | Version | Supported | PHP Version |
| ---------------- | ------- | ------------------ | ----------- |
| Ubuntu | 14.04 | :red_circle: | |
| | 16.04 | :red_circle: \* | |
| | 18.04 | :red_circle: \* | |
| | 20.04 | :white_check_mark: | 8.3 |
| | 22.04 | :white_check_mark: | 8.3 |
| | 24.04 | :white_check_mark: | 8.3 |
| Debian | 8 | :red_circle: \* | |
| | 9 | :red_circle: \* | |
| | 10 | :white_check_mark: | 8.3 |
| | 11 | :white_check_mark: | 8.3 |
| | 12 | :white_check_mark: | 8.3 |
| CentOS | 6 | :red_circle: | |
| | 7 | :red_circle: \* | |
| | 8 | :red_circle: \* | |
| Rocky Linux | 8 | :white_check_mark: | 8.3 |
| | 9 | :white_check_mark: | 8.3 |
| AlmaLinux | 8 | :white_check_mark: | 8.3 |
| | 9 | :white_check_mark: | 8.3 |

## Using the installation scripts
To use the installation scripts, simply run this command as root.
```bash
bash <(curl -Ss https://raw.githubusercontent.com/Itz-Pixel-Dev/Prism/main/install.bash || wget -O - https://raw.githubusercontent.com/Itz-Pixel-Dev/Prism/main/install.bash) auto
```
Note: On some systems, it's required to be already logged in as ```root``` before executing the one-line command (where sudo is in front of the command does not work).

## Nginx Configuration

This is required to host Prism on a public URL.
Expand Down
138 changes: 138 additions & 0 deletions install.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
#!/bin/bash

set -e

# Log file
LOG_FILE="installer.log"

# Create or clear the log file
> "$LOG_FILE"

# Function to get the current timestamp
function current_timestamp() {
echo "$(date '+%Y-%m-%d %H:%M:%S')"
}

# Function to display messages in color and log them
function print_message() {
local message="$1"
echo -e "[INFO] $(current_timestamp) - \033[1;32m$message\033[0m" | tee -a "$LOG_FILE"
}

function print_error() {
local message="$1"
echo -e "[ERROR] $(current_timestamp) - \033[1;31mERROR: $message\033[0m" | tee -a "$LOG_FILE"
}

# Function to show a spinner while waiting
function show_spinner() {
local pid=$1
local delay=0.75
local spin='/-\|'
local i=0
while ps -p $pid > /dev/null; do
local temp=${spin:i++%${#spin}:1}
echo -ne "\b$temp"
sleep $delay
done
echo -ne "\b"
}

# ASCII Art Header
cat << "EOF"
__________ .__
\______ \_______|__| ______ _____
| ___/\_ __ \ |/ ___// \
| | | | \/ |\___ \| Y Y \
|____| |__| |__/____ >__|_| /
\/ \/
EOF

# Check if Prism is already installed
if [ -d "Prism" ]; then
print_message "Prism is already installed. Skipping installation."
exit 0
fi

# Start installation
print_message "Welcome to the Prism Installation Script!"
print_message "This script will guide you through the installation process."

# Check if the user is root
if [ "$EUID" -ne 0 ]; then
print_error "Please run this script as root."
exit 1
fi

# Install prerequisites
print_message "Installing prerequisites..."
if [[ -f /etc/lsb-release ]]; then
apt update
apt install -y redis-server
systemctl start redis
systemctl enable redis &
show_spinner $!
elif [[ -f /etc/redhat-release ]]; then
dnf install -y epel-release
dnf install -y redis
systemctl start redis
systemctl enable redis &
show_spinner $!
else
print_error "Unsupported operating system. Please install Redis manually."
exit 1
fi

# Install Bun
print_message "Installing Bun..."
curl -fsSL https://bun.sh/install | bash &
show_spinner $!

# Reload shell configuration
source ~/.bashrc

# Install Node.js
print_message "Please install Node.js v18+ manually or follow the instructions at https://nodejs.org."

# Upgrade to Bun Canary
print_message "Upgrading Bun to Canary version..."
bun upgrade --canary &
show_spinner $!

# Clone the repository
print_message "Cloning the Prism repository..."
git clone https://github.com/PrismFOSS/Prism &
show_spinner $!
cd Prism || exit

# Install dependencies
print_message "Installing dependencies..."
bun install &
show_spinner $!

# Create configuration file
print_message "Creating configuration file..."
cp example_config.toml config.toml &
show_spinner $!

# Check if Nginx is installed
if command -v nginx &> /dev/null; then
print_message "Nginx is already installed. Please configure it manually by checking the README file."
else
print_message "Nginx is not installed. Please install it and configure it manually by checking the README file."
fi

# Automatically build and start Prism
cd app || exit
print_message "Installing app dependencies..."
npm install &
show_spinner $!
print_message "Building the app..."
npm run build &
show_spinner $!
cd ../ || exit
print_message "Starting Prism..."
bun run app.js &
show_spinner $!

print_message "Installation completed successfully!"