mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-12-16 05:19:43 +01:00
Implement ImunifyAV asset management and routing
- Added a static method to ensure ImunifyAV assets are created and permissions set correctly in CageFS.py. - Updated the URL routing in urls.py to include paths for ImunifyAV, supporting both legacy and new routes. - Modified the ImunifyAV HTML template to use Django's URL template tag for better maintainability. - Enhanced the cyberpanel_fixes.sh script to ensure ImunifyAV UI assets are installed during fixes. - Improved database user resolution and password handling in mysqlUtilities.py for better security and reliability. This update enhances the integration and management of ImunifyAV within the CyberPanel environment.
This commit is contained in:
@@ -216,6 +216,34 @@ fix_missing_dependencies() {
|
||||
print_status "$GREEN" "✅ Missing dependencies fixed"
|
||||
}
|
||||
|
||||
ensure_imunify_av_assets() {
|
||||
local package_manager=$1
|
||||
|
||||
print_status "$BLUE" "🔐 Ensuring ImunifyAV UI assets are installed..."
|
||||
|
||||
mkdir -p /etc/sysconfig/imunify360/generic 2>/dev/null || true
|
||||
mkdir -p /usr/local/CyberCP/public/imunifyav 2>/dev/null || true
|
||||
|
||||
case $package_manager in
|
||||
"yum"|"dnf")
|
||||
if ! $package_manager install -y imunify-ui-generic imunify-antivirus >/dev/null 2>&1; then
|
||||
print_status "$YELLOW" "⚠️ Unable to install Imunify packages via $package_manager (will continue)."
|
||||
fi
|
||||
;;
|
||||
"apt")
|
||||
apt-get update -y >/dev/null 2>&1 || true
|
||||
if ! apt-get install -y imunify-antivirus >/dev/null 2>&1; then
|
||||
print_status "$YELLOW" "⚠️ imunify-antivirus package not available in APT repositories."
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
chown -R lscpd:lscpd /usr/local/CyberCP/public/imunifyav 2>/dev/null || true
|
||||
chown -R lscpd:lscpd /etc/sysconfig/imunify360 2>/dev/null || true
|
||||
|
||||
print_status "$GREEN" "✅ ImunifyAV assets verified"
|
||||
}
|
||||
|
||||
# Function to check service status
|
||||
check_service_status() {
|
||||
local service_name=$1
|
||||
@@ -352,6 +380,9 @@ apply_cyberpanel_fixes() {
|
||||
|
||||
# Fix missing dependencies
|
||||
fix_missing_dependencies "$package_manager"
|
||||
|
||||
# Ensure ImunifyAV UI assets are always present
|
||||
ensure_imunify_av_assets "$package_manager"
|
||||
|
||||
print_status "$GREEN" "✅ All CyberPanel fixes applied successfully"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user