Commit Graph

5324 Commits

Author SHA1 Message Date
master3395
5ee18f1cc3 Use bash instead of sh to execute cyberpanel.sh
- cyberpanel.sh uses #!/bin/bash so should be executed with bash
- Change to /tmp directory before execution to ensure writable location
- Fixes permission issues when cyberpanel.sh tries to execute other scripts
2026-01-26 21:17:34 +01:00
master3395
4b99e46bfd Use sh to execute cyberpanel.sh to avoid permission issues
- Execute with 'sh' instead of relying on exec permissions
- More reliable in process substitution context
- Handles cases where chmod might not work properly
2026-01-26 21:16:01 +01:00
master3395
6161081b98 Fix permission denied error - use absolute path and exec for cyberpanel.sh
- Use absolute path (/tmp/cyberpanel-96375.sh) instead of relative path
- Use exec instead of ./ to execute the script
- Ensures proper permissions and execution in process substitution context
- Clean up script file after execution
2026-01-26 21:14:59 +01:00
master3395
87a38b5a1b Simplify install.sh to match stable branch approach
- Remove complex modular architecture that was causing variable persistence issues
- Use simple OS detection like stable branch
- Download cyberpanel.sh directly for v2.5.5-dev branch
- Add disk space checking (10GB minimum)
- Support both yum and dnf for RHEL-based systems
- Fallback to standard cyberpanel.sh if branch-specific download fails
- Much simpler and more reliable approach
2026-01-26 21:13:02 +01:00
master3395
19f1ca62cb Always re-capture OS variables in install_dependencies to ensure they persist
- Always call detect_os() and get_os_info() in install_dependencies()
- This ensures variables are fresh and properly captured
- Add confirmation message showing captured values
- Fixes issue where variables were detected but empty when passed to manage_dependencies
2026-01-26 21:11:18 +01:00
master3395
734a8ed6e8 Fix OS variable persistence - use eval with get_os_info in install_dependencies
- Remove debug output that wasn't showing
- Use eval with get_os_info() to properly capture OS variables
- Add better error messages showing actual variable values
- Ensure variables are properly exported before calling manage_dependencies
2026-01-26 21:09:46 +01:00
Master3395
222f671801 Merge pull request #1658 from master3395/v2.5.5-dev
V2.5.5 dev
2026-01-26 21:02:03 +01:00
master3395
073e6a0b11 Ensure file ends with newline 2026-01-26 20:59:45 +01:00
master3395
0e7cb5b798 Remove extra fi statement causing syntax error 2026-01-26 20:56:39 +01:00
master3395
20c51e9edb Fix syntax error (missing fi) and add disk space checking
- Fix missing 'fi' closing the TEMP_DIR check block
- Add check_disk_space() function to verify minimum 10GB available
- Display disk space requirements and available space
- Warn if insufficient space but allow continuation
2026-01-26 20:56:15 +01:00
master3395
f928578abb Fix OS variable capture - use get_os_info() to properly retrieve values
- Use eval with get_os_info() to capture OS variables
- Ensures variables are properly set in current shell scope
- Fixes issue where variables were detected but not available to install_dependencies()
2026-01-26 20:54:07 +01:00
master3395
1351de7590 Add debug output to diagnose OS variable passing issue 2026-01-26 20:53:48 +01:00
master3395
872704635f Fix set -e causing exit on mkdir failure - disable temporarily for temp dir creation
- Temporarily disable set -e when trying to create temp directories
- Prevents script from exiting when /tmp is full
- Allows fallback to alternative directories or fallback installer
2026-01-26 20:51:16 +01:00
master3395
be80a9e873 Handle disk space issues - try multiple temp directories and fallback gracefully
- Try multiple temp directory locations (/tmp, /var/tmp, /root, /root)
- Clean up old temporary directories before creating new ones
- Skip git clone if no temp directory can be created
- Try multiple locations for fallback installer download
- Better error messages for disk space issues
2026-01-26 20:49:18 +01:00
master3395
b6d64f99c6 Fix git clone fallback logic - properly handle failed clones
- Use flag-based approach to track git clone success
- Verify repository structure (install.sh and modules/) before using
- Fix fallback execution path
- Support both yum and dnf for package installation
- Better error messages
2026-01-26 20:45:42 +01:00
master3395
1db7ebfeed Improve git clone error handling and fallback logic
- Add timeout for git clone (180 seconds)
- Better error messages showing actual git errors
- Verify repository structure before using cloned repo
- Improve fallback installer download with better error handling
- Support both yum and dnf for RHEL-based systems
2026-01-26 20:45:14 +01:00
master3395
6b46cbafcd Fix OS variable passing to dependency manager - export variables and add safety checks 2026-01-26 20:43:17 +01:00
master3395
399cb06f50 Remove to-do folder and documentation files 2026-01-26 20:40:59 +01:00
master3395
17421b6dfe Fix v2.5.5-dev installation issues: handle curl execution and MariaDB upgrade attempts
- Fix install.sh to detect curl/wget execution and clone repo before loading modules
- Add MariaDB detection and upgrade attempt logic in install.py
- Attempt MariaDB 12.1 upgrade first, fallback to existing 10.x if blocked
- Add comprehensive error handling and logging for upgrade attempts
- Update documentation with fix details
2026-01-26 20:39:25 +01:00
master3395
35a4e90698 Fix dashboard insights 500s: FTPUsers filter, session/ACL safety, /proc hardening
- FTPUsers: use domain__domain__in (FK to Websites) not domain__in
- Session: use session.get('userID'), return JSON when missing
- ACL: use currentACL.get('admin',0) to avoid KeyError
- /proc: resilient parsing for net/dev, diskstats, stat
- Log errors via CyberCPLogFileWriter; generic user-facing messages
- Prevents intermittent 500s that zero out insights (Users, Sites, etc.)
2026-01-26 20:01:34 +01:00
Master3395
037b1ea6cf Merge pull request #1657 from master3395/v2.5.5-dev
V2.5.5 dev
2026-01-26 17:47:17 +01:00
master3395
211571a4db Fix plugin count discrepancy and remove duplicate view toggle
- Fixed installed plugin count to correctly show all 10 installed plugins
- Added filesystem verification to ensure accurate plugin counting
- Fixed duplicate view-toggle navigation row (removed second row)
- Added installed/active count display in page header
- Improved plugin installed status detection logic
- Enhanced debug logging for plugin count discrepancies
2026-01-26 17:45:36 +01:00
master3395
e13c0d0756 fix(plugins): Add total_installed and total_active to context 2026-01-26 03:48:13 +01:00
master3395
2c9500fe35 feat(plugins): Add installed and active plugin statistics to Installed Plugins page
- Calculate total installed plugins count
- Calculate total active/enabled plugins count
- Display statistics in page header with icons
- Shows 'Installed: X' and 'Active: Y' counts
- Statistics only shown when plugins are installed
- Improves visibility of plugin status at a glance
2026-01-26 03:47:41 +01:00
master3395
1f369b36b8 fix(plugins): Add missing outer except block in fetch_plugin_store 2026-01-26 03:45:29 +01:00
master3395
3026d50f35 fix(plugins): Fix indentation in fetch_plugin_store - final fix 2026-01-26 03:44:59 +01:00
master3395
28b69eb2f0 fix(plugins): Fix indentation error in fetch_plugin_store exception handler
- Fix except block indentation to match try block
- Add error handling for enrichment in stale cache fallback
- Ensures proper exception handling structure
2026-01-26 03:44:34 +01:00
master3395
35167b46cf fix(plugins): Add error handling to fetch_plugin_store to prevent 500 errors
- Wrap mailUtilities.checkHome in try-except
- Add try-except around _enrich_store_plugins calls
- If enrichment fails, return plugins without enrichment instead of 500 error
- Add error handling for _is_plugin_enabled calls
- Prevents HTTP 500 errors when plugin store loading fails
- Fixes issue where installing discordWebhooks caused plugin store to fail
2026-01-26 03:43:49 +01:00
master3395
6b65cf12d8 fix(plugins): Fix 'local variable pluginInstaller referenced before assignment' error
- Remove redundant local import of pluginInstaller inside install_from_store function
- pluginInstaller is already imported at module level (line 20)
- The local import was creating a variable shadowing issue
- When the cleanup code path wasn't executed, pluginInstaller was referenced before assignment
- Fixes installation from store failing with variable reference error
2026-01-26 03:41:14 +01:00
master3395
666b1d4097 fix(plugins): Fix plugin store showing uninstalled plugins as installed
- Only check /usr/local/CyberCP/ for installed status, not /home/cyberpanel/plugins/
- Require both plugin directory AND meta.xml to exist for installed status
- Plugins in source directory are not considered installed
- Fixes issue where Discord Webhooks, Fail2ban, Premium Plugin Example, and Test Plugin showed as installed when they weren't

Previously, the check used: os.path.exists(installed_path) or os.path.exists(source_path)
This incorrectly marked plugins as installed if they existed in the source directory.

Now uses: os.path.exists(installed_path) and os.path.exists(installed_meta)
This correctly only marks plugins as installed if they're actually in /usr/local/CyberCP/ with meta.xml
2026-01-26 03:37:48 +01:00
master3395
5cce9a036d fix(plugins): Allow store view to work when grid/table views don't exist
- Make toggleView more flexible - only require the specific view element needed
- Store view can now work even when gridView/tableView don't exist (no plugins installed)
- Fix initialization to directly show store view without calling toggleView recursively
- Find store button by text content instead of array index for reliability
- Prevents 'View elements not found' errors when loading Plugin Store with no installed plugins
2026-01-26 03:35:39 +01:00
master3395
42f66f30ea fix(plugins): Hide Grid/Table view buttons when no plugins installed
- Hide Grid and Table view buttons when plugins list is empty
- Only show Plugin Store button when no plugins are installed
- Improves UX by preventing clicks on non-functional buttons
- Combined with null checks, ensures no JavaScript errors occur
2026-01-26 03:33:32 +01:00
master3395
43f10f7796 fix(plugins): Add null checks to toggleView function to prevent errors when no plugins installed
- Add null checks for gridView, tableView, and storeView elements
- Prevent 'Cannot read properties of null' errors when elements don't exist
- Add null checks for viewBtns array access
- Add function existence checks before calling setupStoreSearch, loadPluginStore, displayStorePlugins
- Improve initialization code with better error handling
- Fixes Plugin Store loading errors when no plugins are installed
2026-01-26 03:32:49 +01:00
master3395
ead1044781 fix(plugins): Only show actually installed plugins in Installed Plugins page
- Filter pluginList to only include plugins where installed == True
- Uninstalled plugins will only appear in Plugin Store, not Installed Plugins
- This fixes the issue where uninstalled plugins were still showing locally
- Plugins in /home/cyberpanel/plugins/ but not in /usr/local/CyberCP/ are now hidden from Installed Plugins
2026-01-26 03:30:35 +01:00
master3395
22a6ba9cca fix(plugins): Fix removeFromSettings to properly track INSTALLED_APPS section
- Track INSTALLED_APPS section state while iterating
- Only remove plugin if found within INSTALLED_APPS section
- Prevents removing plugin references from comments or other sections
2026-01-26 03:28:21 +01:00
master3395
c9c4d521f8 fix(plugins): Improve removeFromSettings and removeFromURLs precision
- Use more precise string matching to avoid partial matches
- removeFromSettings: Match plugin name in quotes within INSTALLED_APPS context
- removeFromURLs: Match plugin name in path() and include() patterns
- Prevents false positives (e.g., 'pluginName2' matching 'pluginName')

This ensures uninstall only removes the exact plugin, not similar names.
2026-01-26 03:27:49 +01:00
master3395
0c140ed69d fix(plugins): Check ProcessUtilities return values and add shell=True fallback
- Check return values from ProcessUtilities.normalExecutioner() (returns 0/1)
- Add subprocess with shell=True as additional fallback
- Better error handling and logging

Fixes: pm2Manager and paypalPremiumPlugin uninstall failures
2026-01-26 03:25:09 +01:00
master3395
130ec9f4a8 fix(plugins): Improve uninstall retry logic with permission fix and root fallback
- Fix permissions with ProcessUtilities before removal retry
- Add subprocess fallback if running as root
- Add filesystem sync delay after removal
- Better error messages showing all attempted methods

Fixes: pm2Manager and paypalPremiumPlugin uninstall failures
2026-01-26 03:24:23 +01:00
master3395
f8ad67056f fix(plugins): Fix syntax error in removeFiles() - restructure if/else logic
- Check if directory exists first, return early if not
- Properly structure try/except blocks
- Fixes SyntaxError: invalid syntax
2026-01-26 03:22:34 +01:00
master3395
70f3cb646b fix(plugins): Add else clause for when directory doesn't exist in removeFiles
Also handle case where directory is already removed (doesn't exist)
2026-01-26 03:21:28 +01:00
master3395
e92f3a7f17 fix(plugins): Add verification and retry logic to uninstall process
- Verify plugin directory is actually removed after removeFiles()
- If directory still exists, retry with ProcessUtilities.normalExecutioner()
- Return error if directory still exists after all attempts
- Prevents silent failures where uninstall appears successful but plugin remains

Fixes: Plugins showing as installed after 'successful' uninstall
2026-01-26 03:20:56 +01:00
master3395
1911de75ec fix(plugins): Remove duplicate os import in removeFiles()
os is already imported at module level, removing duplicate import
that was causing 'local variable os referenced before assignment' error
2026-01-26 03:19:01 +01:00
master3395
c4205ccb94 fix(plugins): Use ProcessUtilities instead of sudo for privileged operations
- Check if running as root (os.geteuid() == 0)
- If root: fix permissions directly without sudo
- If not root: use ProcessUtilities.normalExecutioner() which handles
  privileged commands properly (no password prompt needed)
- Remove sudo dependency that was causing password prompts

Fixes: sudo password prompt errors when uninstalling plugins
2026-01-26 03:17:46 +01:00
master3395
a0b88345dd fix(plugins): Improve removeFiles to handle root-owned files with sudo
- Try direct removal first (fastest)
- If that fails, use sudo chown/chmod to fix permissions, then remove
- Final fallback: use sudo rm -rf
- Better error handling and logging at each step

Fixes: Permission denied errors when uninstalling plugins with root-owned files
(examplePlugin, paypalPremiumPlugin, pm2Manager)
2026-01-26 03:15:11 +01:00
master3395
f9573d9155 fix: Remove remaining emailMarketing references from pluginHolder/views.py
Remove emailMarketing manage_url assignments that were left after
skipping the plugin. These were causing issues.
2026-01-26 03:12:50 +01:00
master3395
db7bc3791a fix: Completely remove emailMarketing template reference
Remove commented-out emailMarketing URL reference from template.
Django may still try to parse commented {% url %} tags, causing
'Reverse for emailMarketing not found' error.
2026-01-26 03:12:27 +01:00
master3395
5b30486d24 fix: Replace emACL usage with False since emailMarketing is removed
Replace emACL.checkIfEMEnabled() call with False since emailMarketing
module is no longer available.
2026-01-26 03:11:18 +01:00
master3395
b751caff01 fix: Remove emailMarketing import from websiteFunctions/website.py
emailMarketing was removed from INSTALLED_APPS but websiteFunctions
was still trying to import it, causing ModuleNotFoundError.

Fixes: ModuleNotFoundError: No module named 'emailMarketing'
2026-01-26 03:10:53 +01:00
master3395
806571e0f1 fix: Remove emailMarketing references after removal from INSTALLED_APPS
- Comment out emailMarketing menu item in baseTemplate/index.html
- Skip emailMarketing in pluginHolder/views.py when listing plugins
- Prevents HTTP 500 error when template tries to reverse 'emailMarketing' URL

Fixes: HTTP 500 on /plugins/installed after emailMarketing removal
2026-01-26 03:09:58 +01:00
master3395
618ceb61e5 fix(plugins): Improve auto-cleanup of incomplete plugin directories
- Use pluginInstaller.removeFiles() which handles permissions properly
- Add fallback to rm -rf if pluginInstaller method fails
- Better error handling and logging
- Applied to both install_plugin and install_from_store functions

Fixes: Incomplete plugin directory cleanup failures due to permission issues
2026-01-26 03:09:01 +01:00