From 02280da785d9a67116515cc039f1225a5273d0d2 Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 13 Nov 2025 01:37:26 -0500 Subject: [PATCH 1/6] update install.sh to support latest rocky linux --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 6625579..4ea97bc 100644 --- a/install.sh +++ b/install.sh @@ -89,7 +89,7 @@ check_distroreqs() { UBUNTU_VERSION=$(lsb_release -rs) log success "Detected Ubuntu ${UBUNTU_VERSION}" elif [ -f "/etc/redhat-release" ]; then - EL_MAJOR_VERSION=$(sed -rn 's/.*([0-9])\.[0-9].*/\1/p' /etc/redhat-release) + EL_MAJOR_VERSION=$(grep -oE '[0-9]+([.][0-9]+)?' /etc/redhat-release | head -n1 | cut -d. -f1) if [ -f "/etc/fedora-release" ]; then DIST="fedora" log success "Detected Fedora" From c835f8122c5973c11272700818d4c4a86cd8423f Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 13 Nov 2025 01:47:23 -0500 Subject: [PATCH 2/6] add variables missing from el8 --- src/distros/el8.sh | 124 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 122 insertions(+), 2 deletions(-) diff --git a/src/distros/el8.sh b/src/distros/el8.sh index 2fd7e2f..7359dbc 100644 --- a/src/distros/el8.sh +++ b/src/distros/el8.sh @@ -2,8 +2,128 @@ set -e -# Import common functions and variables from ubuntu.sh -source "$(dirname "$0")/ubuntu.sh" + +# Color and style definitions +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +MAGENTA='\033[0;35m' +CYAN='\033[0;36m' +BOLD='\033[1m' +DIM='\033[2m' +ITALIC='\033[3m' +NC='\033[0m' + +# Spinner frames +SPINNER_FRAMES=('⠋' '⠙' '⠹' '⠸' '⠼' '⠴' '⠦' '⠧' '⠇' '⠏') + +# Progress bar function +progress_bar() { + local duration=$1 + local width=50 + local progress=0 + local step=$((width * 100 / duration / 100)) + + printf "${CYAN}[${NC}" + for ((i = 0; i < width; i++)); do + printf "${DIM}▱${NC}" + done + printf "${CYAN}]${NC} ${DIM}0%%${NC}" + + for ((i = 0; i <= duration; i++)); do + sleep 0.1 + progress=$((i * 100 / duration)) + pos=$((i * width / duration)) + printf "\r${CYAN}[${NC}" + for ((j = 0; j < width; j++)); do + if [ $j -lt $pos ]; then + printf "${GREEN}▰${NC}" + else + printf "${DIM}▱${NC}" + fi + done + printf "${CYAN}]${NC} ${BOLD}%d%%${NC}" $progress + done + printf "\n" +} + +# Spinner function +spinner() { + local pid=$1 + local message=$2 + local i=0 + + while kill -0 $pid 2>/dev/null; do + printf "\r${BLUE}${SPINNER_FRAMES[i]}${NC} ${message}" + i=$(((i + 1) % ${#SPINNER_FRAMES[@]})) + sleep 0.1 + done + printf "\r${GREEN}✓${NC} ${message}\n" +} + +# Enhanced logging function +log() { + local level=$1 + local msg=$2 + local timestamp=$(date '+%H:%M:%S') + + case $level in + info) + printf "${DIM}${timestamp}${NC} ${BLUE}ℹ${NC} ${msg}\n" + ;; + success) + printf "${DIM}${timestamp}${NC} ${GREEN}✓${NC} ${BOLD}${msg}${NC}\n" + ;; + warn) + printf "${DIM}${timestamp}${NC} ${YELLOW}⚠${NC} ${ITALIC}${msg}${NC}\n" + ;; + error) + printf "${DIM}${timestamp}${NC} ${RED}✗${NC} ${BOLD}${msg}${NC}\n" + ;; + section) + printf "\n${MAGENTA}┌──${NC} ${BOLD}${msg}${NC}\n" + ;; + subsection) + printf "${CYAN}├─${NC} ${msg}\n" + ;; + done) + printf "${MAGENTA}└──${NC} ${GREEN}${BOLD}${msg}${NC}\n\n" + ;; + esac +} + +# Function to show task completion +show_task() { + local msg=$1 + local cmd=$2 + + log subsection "$msg" + ($cmd) & + spinner $! " ${DIM}$msg${NC}" +} + +# ASCII art banner +display_banner() { + clear + cat << "EOF" + +██╗ ██╗ ██╗███╗ ██╗ █████╗ ██████╗ ███████╗██╗ ██╗███████╗██╗ ██╗ +██║ ██║ ██║████╗ ██║██╔══██╗██╔══██╗██╔════╝██║ ██║██╔════╝██║ ██║ +██║ ██║ ██║██╔██╗ ██║███████║██████╔╝███████╗███████║█████╗ ██║ ██║ +██║ ██║ ██║██║╚██╗██║██╔══██║██╔══██╗╚════██║██╔══██║██╔══╝ ██║ ██║ +███████╗╚██████╔╝██║ ╚████║██║ ██║██║ ██║███████║██║ ██║███████╗███████╗███████╗ +╚══════╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚══════╝╚══════╝╚══════╝ +EOF + printf "\n${DIM}Version 2.0.0 - Advanced Installation${NC}\n" + printf "${CYAN}Developed by${NC} ${BOLD}Luna${NC}\n" + printf "\n${MAGENTA}Contributors:${NC}\n" + printf "${DIM}├─${NC} ${BOLD}Luna${NC} ${DIM}(Lead Developer)${NC}\n" + printf "${DIM}├─${NC} ${BOLD}Bahar Kurt${NC} ${DIM}(@kurtbahartr)${NC}\n" + printf "${DIM}├─${NC} ${BOLD}Community Members${NC}\n" + printf "${DIM}└─${NC} ${BOLD}Open Source Contributors${NC}\n" + printf "\n${DIM}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}\n\n" +} install_packages() { log section "Installing Required Packages" From b2025fac94da7e351d27b4aa6faf102baf93e884 Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 13 Nov 2025 01:49:01 -0500 Subject: [PATCH 3/6] fix error --- src/distros/el8.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/distros/el8.sh b/src/distros/el8.sh index 7359dbc..0bf73a4 100644 --- a/src/distros/el8.sh +++ b/src/distros/el8.sh @@ -225,7 +225,7 @@ main() { if [ "$EUID" -ne 0 ]; then log error "Please run as root or with sudo" exit 1 - } + fi # Detect distribution if [ -f /etc/fedora-release ]; then From 02ac4dc3235e7d692028df7112498fea8dc1b5ce Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 13 Nov 2025 01:51:43 -0500 Subject: [PATCH 4/6] fix possibly --- src/distros/el8.sh | 48 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/src/distros/el8.sh b/src/distros/el8.sh index 0bf73a4..f5e351f 100644 --- a/src/distros/el8.sh +++ b/src/distros/el8.sh @@ -2,7 +2,6 @@ set -e - # Color and style definitions RED='\033[0;31m' GREEN='\033[0;32m' @@ -87,7 +86,7 @@ log() { subsection) printf "${CYAN}├─${NC} ${msg}\n" ;; - done) + finish) printf "${MAGENTA}└──${NC} ${GREEN}${BOLD}${msg}${NC}\n\n" ;; esac @@ -217,6 +216,51 @@ system_update() { log done "System updated successfully" } +configure_ssh() { + log info "Configuring SSH..." + mkdir -p ~/.ssh + chmod 700 ~/.ssh + + # Backup and configure sshd_config + SSHD_CONFIG="/etc/ssh/sshd_config" + cp "$SSHD_CONFIG" "${SSHD_CONFIG}.bak" + + # Configure SSH security settings + declare -A ssh_settings=( + ["LogLevel"]="VERBOSE" + ["MaxAuthTries"]="2" + ["MaxSessions"]="2" + ["AllowAgentForwarding"]="no" + ["AllowTcpForwarding"]="no" + ["TCPKeepAlive"]="no" + ["Compression"]="no" + ["ClientAliveCountMax"]="2" + ["PasswordAuthentication"]="no" + ["PermitRootLogin"]="no" + ["X11Forwarding"]="no" + ) + + for key in "${!ssh_settings[@]}"; do + sed -i "s/^#*${key}.*/${key} ${ssh_settings[$key]}/" "$SSHD_CONFIG" + done + + # Add SSH key + log info "Please enter your SSH public key:" + read -r ssh_key + + if [[ -n "$ssh_key" ]]; then + echo "$ssh_key" >> ~/.ssh/authorized_keys + chmod 600 ~/.ssh/authorized_keys + log success "SSH key added" + else + log error "No SSH key provided" + exit 1 + fi + + # Restart SSH service + systemctl restart sshd 2>/dev/null || systemctl restart ssh +} + # Main installation function for RHEL-based systems main() { display_banner From 7889e80c2b7554b71c9fb3c28b07a6ce55be71c9 Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 13 Nov 2025 01:57:02 -0500 Subject: [PATCH 5/6] replace figlet with toilet - figlet not available on rocky 10 --- src/distros/el8.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/distros/el8.sh b/src/distros/el8.sh index f5e351f..9a1d4e2 100644 --- a/src/distros/el8.sh +++ b/src/distros/el8.sh @@ -139,9 +139,9 @@ install_packages() { fi PACKAGES=( - "figlet" "jq" "zsh" "sysstat" "curl" "wget" + "toilet" "jq" "zsh" "sysstat" "curl" "wget" "htop" "neofetch" "net-tools" "tree" "unzip" - "firewalld" + "firewalld" ) total_packages=${#PACKAGES[@]} @@ -158,7 +158,7 @@ install_packages() { fi done - log done "Package installation complete" + log finish "Package installation complete" } # Override firewall configuration for RHEL-based systems From 1a87eafb0c5fabe91db411090906b9f2f409dc6a Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 13 Nov 2025 01:59:54 -0500 Subject: [PATCH 6/6] replace neofetch with fastfetch, readily available --- src/distros/el8.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/distros/el8.sh b/src/distros/el8.sh index 9a1d4e2..d0a090c 100644 --- a/src/distros/el8.sh +++ b/src/distros/el8.sh @@ -140,7 +140,7 @@ install_packages() { PACKAGES=( "toilet" "jq" "zsh" "sysstat" "curl" "wget" - "htop" "neofetch" "net-tools" "tree" "unzip" + "htop" "fastfetch" "net-tools" "tree" "unzip" "firewalld" )