Commit Graph

5314 Commits

Author SHA1 Message Date
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
master3395
31eb292784 fix: Add emailMarketing URL route to main urls.py
emailMarketing was in INSTALLED_APPS but URL route was missing,
causing 'Reverse for emailMarketing not found' error when template
tries to use {% url 'emailMarketing' %}
2026-01-26 03:07:10 +01:00
master3395
915f7cc5d0 fix: Restore emailMarketing to INSTALLED_APPS
emailMarketing was removed from INSTALLED_APPS but the plugin directory
still exists, causing Django to fail with:
'Model class emailMarketing.models.EmailMarketing doesn't declare an explicit
app_label and isn't in an application in INSTALLED_APPS'

This fixes the HTTP 500 error on /plugins/installed
2026-01-26 03:06:01 +01:00
master3395
41b548e8f5 fix(plugins): Improve 'already installed' check to handle incomplete directories
- Only consider plugin installed if meta.xml exists
- Auto-cleanup incomplete plugin directories during install
- Prevents 'Plugin already installed' error when directory exists but is incomplete

Fixes: Plugin already installed: discordAuth (when directory exists but incomplete)
2026-01-26 03:03:52 +01:00
master3395
1fb039caf4 fix(plugins): Fix uninstall permission errors and Python path issues
- Fix Python path: Replace /usr/local/CyberCP/bin/python with python3 (path doesn't exist)
- Fix removeFiles(): Add permission fixing before deletion to handle .DS_Store, __pycache__, etc.
- Improve 'already installed' check: Only consider plugin installed if meta.xml exists
- Auto-cleanup incomplete plugin directories during install
- Add fallback to rm -rf if shutil.rmtree fails

Fixes:
- [Errno 2] No such file or directory: '/usr/local/CyberCP/bin/python'
- [Errno 13] Permission denied: '.DS_Store', '__pycache__', 'README.md'
- Plugin already installed: discordAuth (when directory exists but incomplete)
2026-01-26 03:03:25 +01:00
master3395
d32f815775 revert(plugins): Remove all plugin auto-registrations from core
Plugins should be installed via Plugin Store, not auto-registered in core.
Plugin registrations (INSTALLED_APPS and URL routes) are added dynamically
during plugin installation via pluginInstaller, not hardcoded in core.

Removed from INSTALLED_APPS:
- fail2ban
- discordAuth (already removed by user)
- googleTagManager
- discordWebhooks (already removed by user)

Removed from urls.py:
- All plugin URL routes (fail2ban, googleTagManager, discordAuth)

These plugins must be installed via Plugin Store, which will automatically
add them to INSTALLED_APPS and urls.py during installation.
2026-01-26 02:57:15 +01:00
master3395
1ef9236514 revert(plugins): Remove plugin auto-registrations from core
Plugins should be installed via Plugin Store, not auto-registered in core.
Plugin registrations (INSTALLED_APPS and URL routes) are added dynamically
during plugin installation, not hardcoded in the core repository.

Reverted:
- Removed fail2ban, discordWebhooks, googleTagManager from INSTALLED_APPS
- Removed plugin URL routes from urls.py
- discordAuth was already removed by user

Kept:
- Automatic lscpd restart after plugin installation (pluginHolder/views.py)
- File ownership/permissions fixes
2026-01-26 02:57:02 +01:00
master3395
c0af88706b feat(plugins): Add plugin registrations and improve installation process
- Add fail2ban, discordAuth, discordWebhooks, googleTagManager to INSTALLED_APPS
- Add URL routes for all new plugins
- Add automatic lscpd restart after plugin installation in pluginHolder/views.py
- Fix file ownership/permissions for baseTemplate/index.html (cyberpanel:cyberpanel 664)

Plugins added:
- fail2ban: Security management plugin
- discordAuth: Discord authentication plugin
- discordWebhooks: Discord webhook notifications plugin
- googleTagManager: Google Tag Manager integration plugin
2026-01-26 02:53:24 +01:00
master3395
8abf8b1b91 Add enhanced security features to premium plugins
- Implement server fingerprinting for license binding
- Add code integrity verification with SHA256 hashes
- Implement domain binding for license validation
- Add time-based re-validation with 1-hour caching
- Create secure_verification_required decorator with multiple security layers
- Update both Patreon and PayPal premium plugins with security enhancements
- Add PayPal verification endpoint (verify-paypal-payment.php)
- Update Patreon endpoint to support server fingerprint and domain binding
2026-01-25 23:36:54 +01:00
master3395
ddc4e8c656 Add NEW/Stale badges to Plugin Store and fix intermittent display issues
- Added NEW badge for plugins updated within last 3 months (90 days)
- Added Stale badge for plugins not updated in last 2 years (730 days)
- Removed Author, Status, and Active columns from Plugin Store view
- Fixed intermittent old table display with cache-busting v7
- Added column count validation to ensure correct 8-column structure
- Added tooltips for NEW and Stale badges with descriptive messages
- Cleared plugin store cache to prevent stale data display
- Updated cache-busting version to v7 to force browser refresh
2026-01-25 22:25:21 +01:00
master3395
56cb95fadd Update pluginHolder with Free/Paid badges and Plugin Information support
- Added Free/Paid badges to Grid View, Table View, and Plugin Store
- Fixed intermittent badge display issues with robust boolean handling
- Updated plugin store to show plugin icons and proper pricing badges
- Removed Deactivate/Uninstall from Plugin Store (only Install/Installed)
- Fixed template syntax errors and duplicate navigation buttons
- Enhanced cache handling for plugin metadata (is_paid, patreon_url, etc.)
- Improved JavaScript cache-busting and isPaid normalization
2026-01-25 20:55:56 +01:00