bug fix
This commit is contained in:
commit
8b63192bf2
|
|
@ -0,0 +1 @@
|
|||
patreon: cyberpanel
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
---
|
||||
name: Bug report
|
||||
about: Create a bug report to help us improve
|
||||
title: "[BUG]"
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
**Important**
|
||||
Do not create a new issue if there is already an issue similar(even if nearly) to yours already posted by someone. Just post an update of your issue in that old issue. At this moment CyberPanel only have few contributors. Please do not create any maintenance burden.
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is. Please include as much information as possible in your issue report, such as the configuration of your server and any troubleshooting steps that you've already performed.
|
||||
|
||||
**NOTE: Do not include any personal or sensitive information, such as email addresses or passwords.**
|
||||
|
||||
**To Reproduce**
|
||||
What steps did you take when the issue occurred?
|
||||
1. Ex.: Click on the "Websites" tab.
|
||||
2. Ex.: Click on "Create Website".
|
||||
3. Ex.: Attempted to create a website and received an error.
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Operating system:**
|
||||
Please enter your answer here (e.g. Ubuntu 20.04 LTS)
|
||||
|
||||
**CyberPanel version:**
|
||||
Please enter your answer here (e.g. 2.1.1).
|
||||
|
||||
**Additional context**
|
||||
If there is anything else that you'd like us to know about this issue that will help us diagnose and troubleshoot more effectively, such as links to forum posts or other discussions, please feel free to share here.
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
name: sync2gitee
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
branches:
|
||||
- '**'
|
||||
create:
|
||||
branches:
|
||||
- '**'
|
||||
delete:
|
||||
branches:
|
||||
- '**'
|
||||
jobs:
|
||||
repo-sync:
|
||||
env:
|
||||
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
|
||||
dst_token: ${{ secrets.GITEE_TOKEN }}
|
||||
gitee_user: ${{ secrets.GITEE_USER }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: sync github -> gitee
|
||||
uses: Yikun/hub-mirror-action@master
|
||||
if: env.dst_key && env.dst_token && env.gitee_user
|
||||
with:
|
||||
src: 'github/${{ github.repository_owner }}'
|
||||
dst: 'gitee/${{ secrets.GITEE_USER }}'
|
||||
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
|
||||
dst_token: ${{ secrets.GITEE_TOKEN }}
|
||||
static_list: ${{ github.event.repository.name }}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
.DS_Store
|
||||
.AppleDouble
|
||||
.LSOverride
|
||||
*.pyc
|
||||
.idea
|
||||
venv
|
||||
/.venv/
|
||||
345
cyberpanel.sh
345
cyberpanel.sh
|
|
@ -4,6 +4,92 @@
|
|||
#set -x
|
||||
#set -u
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
# Logging setup
|
||||
LOG_DIR="/var/log/cyberpanel"
|
||||
LOG_FILE="$LOG_DIR/cyberpanel_install_$(date +%Y%m%d_%H%M%S).log"
|
||||
DEBUG_LOG_FILE="$LOG_DIR/cyberpanel_install_debug_$(date +%Y%m%d_%H%M%S).log"
|
||||
|
||||
# Create log directory if it doesn't exist
|
||||
mkdir -p "$LOG_DIR" 2>/dev/null || {
|
||||
# If /var/log/cyberpanel cannot be created, use /tmp
|
||||
LOG_DIR="/tmp/cyberpanel_logs"
|
||||
mkdir -p "$LOG_DIR"
|
||||
LOG_FILE="$LOG_DIR/cyberpanel_install_$(date +%Y%m%d_%H%M%S).log"
|
||||
DEBUG_LOG_FILE="$LOG_DIR/cyberpanel_install_debug_$(date +%Y%m%d_%H%M%S).log"
|
||||
}
|
||||
|
||||
# Logging functions
|
||||
log_info() {
|
||||
local message="$1"
|
||||
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
echo "[$timestamp] [INFO] $message" | tee -a "$LOG_FILE"
|
||||
}
|
||||
|
||||
log_error() {
|
||||
local message="$1"
|
||||
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
echo "[$timestamp] [ERROR] $message" | tee -a "$LOG_FILE" >&2
|
||||
}
|
||||
|
||||
log_warning() {
|
||||
local message="$1"
|
||||
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
echo "[$timestamp] [WARNING] $message" | tee -a "$LOG_FILE"
|
||||
}
|
||||
|
||||
log_debug() {
|
||||
local message="$1"
|
||||
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
echo "[$timestamp] [DEBUG] $message" >> "$DEBUG_LOG_FILE"
|
||||
}
|
||||
|
||||
log_command() {
|
||||
local command="$1"
|
||||
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
echo "[$timestamp] [COMMAND] Executing: $command" >> "$DEBUG_LOG_FILE"
|
||||
|
||||
# Execute command and capture output
|
||||
local output
|
||||
local exit_code
|
||||
output=$($command 2>&1)
|
||||
exit_code=$?
|
||||
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
echo "[$timestamp] [COMMAND] Success: $command" >> "$DEBUG_LOG_FILE"
|
||||
[ -n "$output" ] && echo "[$timestamp] [OUTPUT] $output" >> "$DEBUG_LOG_FILE"
|
||||
else
|
||||
echo "[$timestamp] [COMMAND] Failed (exit code: $exit_code): $command" >> "$DEBUG_LOG_FILE"
|
||||
[ -n "$output" ] && echo "[$timestamp] [ERROR OUTPUT] $output" >> "$DEBUG_LOG_FILE"
|
||||
fi
|
||||
|
||||
return $exit_code
|
||||
}
|
||||
|
||||
log_function_start() {
|
||||
local function_name="$1"
|
||||
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
echo "[$timestamp] [FUNCTION] Starting: $function_name" | tee -a "$LOG_FILE"
|
||||
echo "[$timestamp] [FUNCTION] Starting: $function_name with args: ${@:2}" >> "$DEBUG_LOG_FILE"
|
||||
}
|
||||
|
||||
log_function_end() {
|
||||
local function_name="$1"
|
||||
local exit_code="${2:-0}"
|
||||
local timestamp=$(date '+%Y-%m-%d %H:%M:%S')
|
||||
if [ $exit_code -eq 0 ]; then
|
||||
echo "[$timestamp] [FUNCTION] Completed: $function_name" >> "$DEBUG_LOG_FILE"
|
||||
else
|
||||
echo "[$timestamp] [FUNCTION] Failed: $function_name (exit code: $exit_code)" | tee -a "$LOG_FILE"
|
||||
fi
|
||||
}
|
||||
|
||||
# Initialize logging
|
||||
log_info "CyberPanel installation started"
|
||||
log_info "Log file: $LOG_FILE"
|
||||
log_info "Debug log file: $DEBUG_LOG_FILE"
|
||||
>>>>>>> stable
|
||||
|
||||
#CyberPanel installer script for CentOS 7, CentOS 8, CloudLinux 7, AlmaLinux 8, RockyLinux 8, Ubuntu 18.04, Ubuntu 20.04, Ubuntu 20.10, openEuler 20.03 and openEuler 22.03
|
||||
#For whoever may edit this script, please follow:
|
||||
|
|
@ -45,9 +131,17 @@ Sudo_Test=$(set)
|
|||
#for SUDO check
|
||||
|
||||
Set_Default_Variables() {
|
||||
<<<<<<< HEAD
|
||||
|
||||
echo -e "Fetching latest data from CyberPanel server...\n"
|
||||
echo -e "This may take few seconds..."
|
||||
=======
|
||||
log_function_start "Set_Default_Variables"
|
||||
|
||||
echo -e "Fetching latest data from CyberPanel server...\n"
|
||||
echo -e "This may take few seconds..."
|
||||
log_info "Fetching latest data from CyberPanel server"
|
||||
>>>>>>> stable
|
||||
|
||||
Silent="Off"
|
||||
Server_Edition="OLS"
|
||||
|
|
@ -76,9 +170,18 @@ Branch_Name="v${Panel_Version}.${Panel_Build}"
|
|||
|
||||
if [[ $Branch_Name = v*.*.* ]] ; then
|
||||
echo -e "\nBranch name fetched...$Branch_Name"
|
||||
<<<<<<< HEAD
|
||||
else
|
||||
echo -e "\nUnable to fetch Branch name..."
|
||||
echo -e "\nPlease try again in few moments, if this error still happens, please contact support"
|
||||
=======
|
||||
log_info "Branch name fetched: $Branch_Name"
|
||||
else
|
||||
echo -e "\nUnable to fetch Branch name..."
|
||||
echo -e "\nPlease try again in few moments, if this error still happens, please contact support"
|
||||
log_error "Unable to fetch branch name from version.txt"
|
||||
log_function_end "Set_Default_Variables" 1
|
||||
>>>>>>> stable
|
||||
exit
|
||||
fi
|
||||
|
||||
|
|
@ -104,6 +207,11 @@ Enterprise_Flag=""
|
|||
License_Key=""
|
||||
Debug_Log2 "Starting installation..,1"
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_debug "Default variables set - Server Edition: $Server_Edition, Total RAM: $Total_RAM MB"
|
||||
log_function_end "Set_Default_Variables"
|
||||
>>>>>>> stable
|
||||
}
|
||||
|
||||
# Helper Functions for Package Management
|
||||
|
|
@ -297,7 +405,13 @@ fi
|
|||
Check_Return() {
|
||||
#check previous command result , 0 = ok , non-0 = something wrong.
|
||||
# shellcheck disable=SC2181
|
||||
<<<<<<< HEAD
|
||||
if [[ $? != "0" ]]; then
|
||||
=======
|
||||
local exit_code=$?
|
||||
if [[ $exit_code != "0" ]]; then
|
||||
log_error "Previous command failed with exit code: $exit_code"
|
||||
>>>>>>> stable
|
||||
if [[ -n "$1" ]] ; then
|
||||
echo -e "\n\n\n$1"
|
||||
fi
|
||||
|
|
@ -314,14 +428,27 @@ fi
|
|||
|
||||
Retry_Command() {
|
||||
# shellcheck disable=SC2034
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
local command="$1"
|
||||
log_debug "Starting retry command: $command"
|
||||
>>>>>>> stable
|
||||
for i in {1..50};
|
||||
do
|
||||
if [[ "$i" = "50" ]] ; then
|
||||
echo "command $1 failed for 50 times, exit..."
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_error "Command failed after 50 retries: $1"
|
||||
>>>>>>> stable
|
||||
exit 2
|
||||
else
|
||||
$1 && break || {
|
||||
echo -e "\n$1 has failed for $i times\nWait and try again...\n"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_warning "Command failed, retry $i/50: $1"
|
||||
>>>>>>> stable
|
||||
# Exponential backoff: 1s, 2s, 4s, 8s, then cap at 10s
|
||||
if [[ $i -le 4 ]]; then
|
||||
sleep $((2**($i-1)))
|
||||
|
|
@ -334,10 +461,21 @@ done
|
|||
}
|
||||
|
||||
Check_Root() {
|
||||
<<<<<<< HEAD
|
||||
echo -e "\nChecking root privileges..."
|
||||
if echo "$Sudo_Test" | grep SUDO >/dev/null; then
|
||||
echo -e "\nYou are using SUDO , please run as root user...\n"
|
||||
echo -e "\nIf you don't have direct access to root user, please run \e[31msudo su -\e[39m command (do NOT miss the \e[31m-\e[39m at end or it will fail) and then run installation command again."
|
||||
=======
|
||||
log_function_start "Check_Root"
|
||||
echo -e "\nChecking root privileges..."
|
||||
log_info "Checking root privileges"
|
||||
if echo "$Sudo_Test" | grep SUDO >/dev/null; then
|
||||
echo -e "\nYou are using SUDO , please run as root user...\n"
|
||||
echo -e "\nIf you don't have direct access to root user, please run \e[31msudo su -\e[39m command (do NOT miss the \e[31m-\e[39m at end or it will fail) and then run installation command again."
|
||||
log_error "Not running as root user - SUDO detected"
|
||||
log_function_end "Check_Root" 1
|
||||
>>>>>>> stable
|
||||
exit
|
||||
fi
|
||||
|
||||
|
|
@ -345,6 +483,7 @@ echo -e "\nChecking root privileges..."
|
|||
echo -e "\nYou must run on root user to install CyberPanel...\n"
|
||||
echo -e "or run following command: (do NOT miss the quotes)"
|
||||
echo -e "\e[31msudo su -c \"sh <(curl https://cyberpanel.sh || wget -O - https://cyberpanel.sh)\"\e[39m"
|
||||
<<<<<<< HEAD
|
||||
exit 1
|
||||
else
|
||||
echo -e "\nYou are runing as root...\n"
|
||||
|
|
@ -358,6 +497,30 @@ Server_IP=$(curl --silent --max-time 30 -4 https://cyberpanel.sh/?ip)
|
|||
else
|
||||
echo -e "Can not detect IP, exit..."
|
||||
Debug_Log2 "Can not detect IP. [404]"
|
||||
=======
|
||||
log_error "Not running as root user - UID is not 0"
|
||||
log_function_end "Check_Root" 1
|
||||
exit 1
|
||||
else
|
||||
echo -e "\nYou are runing as root...\n"
|
||||
log_info "Root user verified"
|
||||
fi
|
||||
log_function_end "Check_Root"
|
||||
}
|
||||
|
||||
Check_Server_IP() {
|
||||
log_function_start "Check_Server_IP"
|
||||
log_debug "Fetching server IP address"
|
||||
Server_IP=$(curl --silent --max-time 30 -4 https://cyberpanel.sh/?ip)
|
||||
if [[ $Server_IP =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
echo -e "Valid IP detected..."
|
||||
log_info "Valid server IP detected: $Server_IP"
|
||||
else
|
||||
echo -e "Can not detect IP, exit..."
|
||||
Debug_Log2 "Can not detect IP. [404]"
|
||||
log_error "Failed to detect valid server IP address"
|
||||
log_function_end "Check_Server_IP" 1
|
||||
>>>>>>> stable
|
||||
exit
|
||||
fi
|
||||
|
||||
|
|
@ -384,12 +547,27 @@ fi
|
|||
if [[ "$Server_Country" = *"CN"* ]] ; then
|
||||
Server_Country="CN"
|
||||
echo -e "Setting up to use mirror server...\n"
|
||||
<<<<<<< HEAD
|
||||
fi
|
||||
}
|
||||
|
||||
Check_OS() {
|
||||
if [[ ! -f /etc/os-release ]] ; then
|
||||
echo -e "Unable to detect the operating system...\n"
|
||||
=======
|
||||
log_info "Server country set to CN - will use mirror servers"
|
||||
fi
|
||||
log_debug "Server location: $Server_Country, IP: $Server_IP"
|
||||
log_function_end "Check_Server_IP"
|
||||
}
|
||||
|
||||
Check_OS() {
|
||||
log_function_start "Check_OS"
|
||||
if [[ ! -f /etc/os-release ]] ; then
|
||||
log_error "Unable to detect the operating system - /etc/os-release not found"
|
||||
echo -e "Unable to detect the operating system...\n"
|
||||
log_function_end "Check_OS" 1
|
||||
>>>>>>> stable
|
||||
exit
|
||||
fi
|
||||
|
||||
|
|
@ -434,6 +612,10 @@ Server_OS_Version=$(grep VERSION_ID /etc/os-release | awk -F[=,] '{print $2}' |
|
|||
#to make 20.04 display as 20, etc.
|
||||
|
||||
echo -e "System: $Server_OS $Server_OS_Version detected...\n"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_info "Operating system detected: $Server_OS $Server_OS_Version"
|
||||
>>>>>>> stable
|
||||
|
||||
if [[ $Server_OS = "CloudLinux" ]] || [[ "$Server_OS" = "AlmaLinux" ]] || [[ "$Server_OS" = "RockyLinux" ]] || [[ "$Server_OS" = "RedHat" ]] ; then
|
||||
Server_OS="CentOS"
|
||||
|
|
@ -445,10 +627,20 @@ if [[ "$Debug" = "On" ]] ; then
|
|||
Debug_Log "Server_OS" "$Server_OS $Server_OS_Version"
|
||||
fi
|
||||
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
Check_Virtualization() {
|
||||
echo -e "Checking virtualization type..."
|
||||
=======
|
||||
log_function_end "Check_OS"
|
||||
}
|
||||
|
||||
Check_Virtualization() {
|
||||
log_function_start "Check_Virtualization"
|
||||
echo -e "Checking virtualization type..."
|
||||
log_info "Checking virtualization type"
|
||||
>>>>>>> stable
|
||||
#if hostnamectl | grep -q "Virtualization: lxc"; then
|
||||
# echo -e "\nLXC detected..."
|
||||
# echo -e "CyberPanel does not support LXC"
|
||||
|
|
@ -460,6 +652,10 @@ echo -e "Checking virtualization type..."
|
|||
|
||||
if hostnamectl | grep -q "Virtualization: openvz"; then
|
||||
echo -e "OpenVZ detected...\n"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_info "OpenVZ virtualization detected - applying specific configurations"
|
||||
>>>>>>> stable
|
||||
|
||||
if [[ ! -d /etc/systemd/system/pure-ftpd.service.d ]]; then
|
||||
mkdir /etc/systemd/system/pure-ftpd.service.d
|
||||
|
|
@ -489,6 +685,11 @@ fi
|
|||
}
|
||||
|
||||
Check_Panel() {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_function_start "Check_Panel"
|
||||
log_info "Checking for existing control panels"
|
||||
>>>>>>> stable
|
||||
if [[ -d /usr/local/cpanel ]]; then
|
||||
echo -e "\ncPanel detected...\n"
|
||||
Debug_Log2 "cPanel detected...exit... [404]"
|
||||
|
|
@ -509,6 +710,11 @@ fi
|
|||
}
|
||||
|
||||
Check_Process() {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_function_start "Check_Process"
|
||||
log_info "Checking for conflicting processes"
|
||||
>>>>>>> stable
|
||||
local services=("httpd" "apache2" "named" "exim")
|
||||
|
||||
for service in "${services[@]}"; do
|
||||
|
|
@ -517,11 +723,23 @@ Check_Process() {
|
|||
manage_service "$service" "disable"
|
||||
manage_service "$service" "mask"
|
||||
echo -e "\n$service process detected, disabling...\n"
|
||||
<<<<<<< HEAD
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
Check_Provider() {
|
||||
=======
|
||||
log_warning "$service process detected and disabled"
|
||||
fi
|
||||
done
|
||||
log_function_end "Check_Process"
|
||||
}
|
||||
|
||||
Check_Provider() {
|
||||
log_function_start "Check_Provider"
|
||||
log_info "Detecting server provider"
|
||||
>>>>>>> stable
|
||||
if hash dmidecode >/dev/null 2>&1; then
|
||||
if [[ "$(dmidecode -s bios-vendor)" = "Google" ]]; then
|
||||
Server_Provider="Google Cloud Platform"
|
||||
|
|
@ -577,6 +795,10 @@ echo -e "\nThis will install LiteSpeed Enterise , replace LICENSE_KEY to actual
|
|||
}
|
||||
|
||||
Check_Argument() {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_function_start "Check_Argument" "$@"
|
||||
>>>>>>> stable
|
||||
if [[ "$#" = "0" ]] || [[ "$#" = "1" && "$1" = "--debug" ]] || [[ "$#" = "1" && "$1" = "--mirror" ]]; then
|
||||
echo -e "\nInitialized...\n"
|
||||
else
|
||||
|
|
@ -966,7 +1188,14 @@ License_Check "$License_Key"
|
|||
}
|
||||
|
||||
Pre_Install_Setup_Repository() {
|
||||
<<<<<<< HEAD
|
||||
if [[ $Server_OS = "CentOS" ]] ; then
|
||||
=======
|
||||
log_function_start "Pre_Install_Setup_Repository"
|
||||
log_info "Setting up package repositories for $Server_OS $Server_OS_Version"
|
||||
if [[ $Server_OS = "CentOS" ]] ; then
|
||||
log_debug "Importing LiteSpeed GPG key"
|
||||
>>>>>>> stable
|
||||
rpm --import https://cyberpanel.sh/rpms.litespeedtech.com/centos/RPM-GPG-KEY-litespeed
|
||||
#import the LiteSpeed GPG key
|
||||
|
||||
|
|
@ -1063,6 +1292,10 @@ EOF
|
|||
fi
|
||||
|
||||
if [[ $Server_OS = "openEuler" ]]; then
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_debug "Importing LiteSpeed GPG key"
|
||||
>>>>>>> stable
|
||||
rpm --import https://cyberpanel.sh/rpms.litespeedtech.com/centos/RPM-GPG-KEY-litespeed
|
||||
#import the LiteSpeed GPG key
|
||||
yum clean all
|
||||
|
|
@ -1169,8 +1402,14 @@ done
|
|||
}
|
||||
|
||||
Pre_Install_Required_Components() {
|
||||
<<<<<<< HEAD
|
||||
|
||||
Debug_Log2 "Installing necessary components..,3"
|
||||
=======
|
||||
log_function_start "Pre_Install_Required_Components"
|
||||
Debug_Log2 "Installing necessary components..,3"
|
||||
log_info "Installing required system components and dependencies"
|
||||
>>>>>>> stable
|
||||
|
||||
if [[ "$Server_OS" = "CentOS" ]] || [[ "$Server_OS" = "openEuler" ]] ; then
|
||||
# System-wide update - consider making this optional for faster installs
|
||||
|
|
@ -1295,7 +1534,13 @@ Debug_Log2 "Necessary components installed..,5"
|
|||
}
|
||||
|
||||
Pre_Install_System_Tweak() {
|
||||
<<<<<<< HEAD
|
||||
Debug_Log2 "Setting up system tweak...,20"
|
||||
=======
|
||||
log_function_start "Pre_Install_System_Tweak"
|
||||
Debug_Log2 "Setting up system tweak...,20"
|
||||
log_info "Applying system tweaks and optimizations"
|
||||
>>>>>>> stable
|
||||
Line_Number=$(grep -n "127.0.0.1" /etc/hosts | cut -d: -f 1)
|
||||
My_Hostname=$(hostname)
|
||||
|
||||
|
|
@ -1473,10 +1718,22 @@ if [[ -n "$Line1" ]] && [[ "$Line1" =~ ^[0-9]+$ ]]; then
|
|||
else
|
||||
echo "Warning: Could not find 'nameserver 8.8.8.8' pattern in installCyberPanel.py - skipping resolv.conf modification"
|
||||
fi
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
License_Validation() {
|
||||
Debug_Log2 "Validating LiteSpeed license...,40"
|
||||
=======
|
||||
|
||||
log_debug "System tweaks completed - SWAP, limits, and DNS configured"
|
||||
log_function_end "Pre_Install_System_Tweak"
|
||||
}
|
||||
|
||||
License_Validation() {
|
||||
log_function_start "License_Validation"
|
||||
Debug_Log2 "Validating LiteSpeed license...,40"
|
||||
log_info "Validating LiteSpeed Enterprise license"
|
||||
>>>>>>> stable
|
||||
Current_Dir=$(pwd)
|
||||
|
||||
if [ -f /root/cyberpanel-tmp ]; then
|
||||
|
|
@ -1510,13 +1767,26 @@ fi
|
|||
if ./lshttpd -V |& grep "ERROR" || ./lshttpd -V |& grep "expire in 0 days" ; then
|
||||
echo -e "\n\nThere appears to be an issue with license , please check above result..."
|
||||
Debug_Log2 "There appears to be an issue with LiteSpeed License, make sure you are using correct serial key. [404]"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_error "LiteSpeed license validation failed"
|
||||
log_function_end "License_Validation" 1
|
||||
>>>>>>> stable
|
||||
exit
|
||||
fi
|
||||
|
||||
echo -e "\nLicense seems valid..."
|
||||
<<<<<<< HEAD
|
||||
cd "$Current_Dir" || exit
|
||||
rm -rf /root/cyberpanel-tmp
|
||||
#clean up the temp files
|
||||
=======
|
||||
log_info "LiteSpeed license validated successfully"
|
||||
cd "$Current_Dir" || exit
|
||||
rm -rf /root/cyberpanel-tmp
|
||||
#clean up the temp files
|
||||
log_function_end "License_Validation"
|
||||
>>>>>>> stable
|
||||
}
|
||||
|
||||
Pre_Install_CN_Replacement() {
|
||||
|
|
@ -1579,7 +1849,13 @@ Retry_Command "/root/.acme.sh/acme.sh --upgrade --auto-upgrade"
|
|||
}
|
||||
|
||||
Main_Installation() {
|
||||
<<<<<<< HEAD
|
||||
Debug_Log2 "Starting main installation..,30"
|
||||
=======
|
||||
log_function_start "Main_Installation"
|
||||
Debug_Log2 "Starting main installation..,30"
|
||||
log_info "Starting main CyberPanel installation"
|
||||
>>>>>>> stable
|
||||
if [[ -d /usr/local/CyberCP ]] ; then
|
||||
echo -e "\n CyberPanel already installed, exiting..."
|
||||
Debug_Log2 "CyberPanel already installed, exiting... [404]"
|
||||
|
|
@ -1680,9 +1956,19 @@ Post_Install_Addon_Mecached_LSMCD() {
|
|||
|
||||
manage_service "lsmcd" "enable"
|
||||
manage_service "lsmcd" "start"
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
Post_Install_Addon_Memcached() {
|
||||
=======
|
||||
log_info "LSMCD installation completed"
|
||||
log_function_end "Post_Install_Addon_Mecached_LSMCD"
|
||||
}
|
||||
|
||||
Post_Install_Addon_Memcached() {
|
||||
log_function_start "Post_Install_Addon_Memcached"
|
||||
log_info "Installing Memcached and PHP extension"
|
||||
>>>>>>> stable
|
||||
install_php_packages "memcached"
|
||||
|
||||
if [[ $Total_RAM -ge 2048 ]]; then
|
||||
|
|
@ -1704,6 +1990,11 @@ Post_Install_Addon_Memcached() {
|
|||
}
|
||||
|
||||
Post_Install_Addon_Redis() {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_function_start "Post_Install_Addon_Redis"
|
||||
log_info "Installing Redis server and PHP extension"
|
||||
>>>>>>> stable
|
||||
# Install PHP Redis extension
|
||||
install_php_packages "redis"
|
||||
|
||||
|
|
@ -1749,7 +2040,13 @@ Post_Install_Addon_Redis() {
|
|||
}
|
||||
|
||||
Post_Install_PHP_Session_Setup() {
|
||||
<<<<<<< HEAD
|
||||
echo -e "\nSetting up PHP session storage path...\n"
|
||||
=======
|
||||
log_function_start "Post_Install_PHP_Session_Setup"
|
||||
echo -e "\nSetting up PHP session storage path...\n"
|
||||
log_info "Setting up PHP session storage configuration"
|
||||
>>>>>>> stable
|
||||
#wget -O /root/php_session_script.sh "${Git_Content_URL}/stable/CPScripts/setup_php_sessions.sh"
|
||||
chmod +x /usr/local/CyberCP/CPScripts/setup_php_sessions.sh
|
||||
bash /usr/local/CyberCP/CPScripts/setup_php_sessions.sh
|
||||
|
|
@ -1758,6 +2055,11 @@ Debug_Log2 "Setting up PHP session conf...,90"
|
|||
}
|
||||
|
||||
Post_Install_PHP_TimezoneDB() {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_function_start "Post_Install_PHP_TimezoneDB"
|
||||
log_info "Installing PHP TimezoneDB extension"
|
||||
>>>>>>> stable
|
||||
Current_Dir="$(pwd)"
|
||||
rm -f /usr/local/lsws/cyberpanel-tmp
|
||||
mkdir /usr/local/lsws/cyberpanel-tmp
|
||||
|
|
@ -1785,6 +2087,11 @@ Debug_Log2 "Installing timezoneDB...,95"
|
|||
}
|
||||
|
||||
Post_Install_Regenerate_Webadmin_Console_Passwd() {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_function_start "Post_Install_Regenerate_Webadmin_Console_Passwd"
|
||||
log_info "Regenerating WebAdmin console password"
|
||||
>>>>>>> stable
|
||||
if [[ "$Server_Edition" = "OLS" ]]; then
|
||||
PHP_Command="admin_php"
|
||||
else
|
||||
|
|
@ -1803,10 +2110,21 @@ chown lsadm:lsadm /usr/local/lsws/admin/conf/htpasswd
|
|||
chmod 600 /usr/local/lsws/admin/conf/htpasswd
|
||||
echo "${Webadmin_Pass}" >/etc/cyberpanel/webadmin_passwd
|
||||
chmod 600 /etc/cyberpanel/webadmin_passwd
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
|
||||
Post_Install_Setup_Watchdog() {
|
||||
if [[ "$Watchdog" = "On" ]]; then
|
||||
=======
|
||||
log_info "WebAdmin console password regenerated"
|
||||
log_function_end "Post_Install_Regenerate_Webadmin_Console_Passwd"
|
||||
}
|
||||
|
||||
Post_Install_Setup_Watchdog() {
|
||||
log_function_start "Post_Install_Setup_Watchdog"
|
||||
if [[ "$Watchdog" = "On" ]]; then
|
||||
log_info "Setting up watchdog monitoring service"
|
||||
>>>>>>> stable
|
||||
wget -O /etc/cyberpanel/watchdog.sh "${Git_Content_URL}/stable/CPScripts/watchdog.sh"
|
||||
chmod 700 /etc/cyberpanel/watchdog.sh
|
||||
ln -s /etc/cyberpanel/watchdog.sh /usr/local/bin/watchdog
|
||||
|
|
@ -1841,6 +2159,11 @@ fi
|
|||
}
|
||||
|
||||
Post_Install_Display_Final_Info() {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_function_start "Post_Install_Display_Final_Info"
|
||||
log_info "Preparing final installation information"
|
||||
>>>>>>> stable
|
||||
snappymailAdminPass=$(grep SetPassword /usr/local/CyberCP/public/snappymail.php| sed -e 's|$oConfig->SetPassword(||g' -e "s|');||g" -e "s|'||g")
|
||||
Elapsed_Time="$((Time_Count / 3600)) hrs $(((SECONDS / 60) % 60)) min $((Time_Count % 60)) sec"
|
||||
echo "###################################################################"
|
||||
|
|
@ -1912,6 +2235,11 @@ fi
|
|||
|
||||
|
||||
Post_Install_Regenerate_Cert() {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_function_start "Post_Install_Regenerate_Cert"
|
||||
log_info "Regenerating SSL certificates for control panel"
|
||||
>>>>>>> stable
|
||||
cat <<EOF >/root/cyberpanel/cert_conf
|
||||
[req]
|
||||
prompt=no
|
||||
|
|
@ -2032,6 +2360,11 @@ fi
|
|||
}
|
||||
|
||||
Post_Install_Tweak() {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_function_start "Post_Install_Tweak"
|
||||
log_info "Applying post-installation tweaks and configurations"
|
||||
>>>>>>> stable
|
||||
if [[ -d /etc/pure-ftpd/conf ]]; then
|
||||
echo "yes" >/etc/pure-ftpd/conf/ChrootEveryone
|
||||
systemctl restart pure-ftpd-mysql
|
||||
|
|
@ -2142,6 +2475,10 @@ systemctl stop lsws >/dev/null 2>&1
|
|||
systemctl start lsws >/dev/null 2>&1
|
||||
echo -e "\nFinalizing...\n"
|
||||
echo -e "Cleaning up...\n"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_info "Cleaning up temporary installation files"
|
||||
>>>>>>> stable
|
||||
rm -rf /root/cyberpanel
|
||||
|
||||
if [[ "$Server_Country" = "CN" ]] ; then
|
||||
|
|
@ -2164,6 +2501,14 @@ sed -i 's|http://license.litespeedtech.com/|https://cyberpanel.sh/license.litesp
|
|||
}
|
||||
|
||||
echo -e "\nInitializing...\n"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
log_info "============================================="
|
||||
log_info "CyberPanel installation script started"
|
||||
log_info "Script version: $Panel_Version.$Panel_Build"
|
||||
log_info "Script arguments: $*"
|
||||
log_info "============================================="
|
||||
>>>>>>> stable
|
||||
|
||||
if [[ "$*" = *"--debug"* ]] ; then
|
||||
Debug="On"
|
||||
|
|
|
|||
Loading…
Reference in New Issue