Add _read_lines_from_protected_file: cp via executioner when EACCES/EPERM on read.
Use for settings.py, urls.py, baseTemplate index.html on install/uninstall paths.
- Add plugin_settings_proxy for /plugins/<name>/settings/ so settings pages
work for all installed plugins (handles plugins installed after worker start)
- Add path('<str:plugin_name>/settings/', plugin_settings_proxy) in pluginHolder.urls
- removeFromSettings/removeFromURLs: use try/except for read/write, raise clear
PermissionError message; ensure panel user can write (chgrp lscpd; chmod g+w)
- Deploy: make CyberCP/settings.py, urls.py, baseTemplate index.html group-
writable by lscpd so uninstall can update them
- Find plugin in GitHub archive by any path segment (Category/pluginName)
- extractPlugin: prefer top-level dir matching plugin name; handle repo-root
single dir by using plugin subdir when present (avoids wrong location)
- Add pluginHolder and pluginInstaller to upgrade recovery essential dirs
Fixes: Files extracted to wrong location (e.g. pm2Manager, README.md in root)
- 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
- 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.
- 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
- 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)
- Enhanced plugin installer to properly extract and install plugins
- Added security middleware exception for plugin webhook endpoints
- Improved plugin listing with better error handling
- Added testPlugin as example plugin for CyberPanel plugin system
- Updated INSTALLED_APPS and URL routing for plugins
Author: master3395