Commit Graph

12 Commits

Author SHA1 Message Date
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
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
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
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
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
ed7d4743b6 Add plugin system enhancements and testPlugin
- 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
2026-01-04 21:04:51 +01:00
Master3395
feee06fae6 Add Django version compatibility in pluginInstaller: Implement getUrlPattern method to generate URL patterns compatible with both Django 2.x and 3.x+. Update URL writing logic to utilize this method for improved maintainability and compatibility.
https://github.com/usmannasir/cyberpanel/pull/1366
2025-09-20 19:31:15 +02:00
usmannasir
6dd7114f6d Initial commit for v2.4.3 2025-08-01 14:56:30 +05:00