Commit Graph

67 Commits

Author SHA1 Message Date
master3395
6755d75e2c plugins: place settings back-link inside #main-content
Avoid full-width bar over sidebar; rounded card-style bar; fallback after <body>
if template has no main-content.
2026-03-27 23:59:00 +01:00
master3395
831c0fbae3 plugins: back link to Installed on all proxied settings pages
Inject bar after <body> in plugin_settings_proxy HTML responses; skip streaming
and non-HTML; idempotent if bar already present; translatable label.
2026-03-27 23:54:41 +01:00
master3395
f83a573242 plugins: delete local source after uninstall (with confirmations)
- POST /plugins/api/delete-source/<name>/ removes copies under plugin source paths only
- Require safe plugin id, block if still installed under CyberCP; symlink-aware paths
- Clear state file, informCyberPanelRemoval, invalidate store cache
- UI: Delete local copy in grid/table/store; two-step confirm; amber button style
- Enrich store JSON with has_local_source and builtin
2026-03-27 23:49:36 +01:00
master3395
5e8f973bb5 plugins: reliable lscpd restart after install and revert
- restartGunicorn: try systemctl as root; else sudo -n then systemctl; log failures
- revert_plugin: call restartGunicorn after successful backup restore
2026-03-27 23:39:11 +01:00
master3395
ceee5297ee fix(pluginHolder): reliable plugin upgrades, store UI dates, upgrades columns
- Harden meta.xml sync (cache-bust, no CDN downgrade); ZIP meta fallback; fail if version stuck
- Invalidate plugin store cache after successful upgrade
- Add modify_timestamp for browser-local DD.MM.yyyy / 24h display via toLocaleString
- Upgrades table: Your Version column before New Version; freshness uses timestamp when present
2026-03-27 21:08:40 +01:00
master3395
d66ea24997 fix(pluginHolder): resolve CyberPanel admin identity for activation APIs
Use session userID -> Administrator email for subscription checks, activation persistence, and paid-plugin access when Django auth user is not populated.
2026-03-26 23:16:45 +01:00
master3395
44263a37a9 pluginHolder: fix plugin store stale-cache refresh + hourly scheduler
Remove stuck plugin-store refresh locks, show correct cache status in UI, and add a management command for hourly refresh.
2026-03-26 22:45:54 +01:00
master3395
4b48627150 pluginHolder: fix plugin store cache timestamp display and stale refresh trigger.
Render next cache update in Norwegian format and mark overdue cache clearly while triggering background refresh from Installed view when cache metadata is expired.
2026-03-26 15:22:56 +01:00
master3395
f195733c0d pluginHolder: auto-persist activation keys from plugin settings pages.
Inject a lightweight fetch hook into settings pages to call store-activation after successful plugin activation responses, reducing premium relock risk after upgrades.
2026-03-26 15:09:03 +01:00
master3395
b1f0ae220f pluginHolder: persist premium activation keys in MariaDB.
Store plugin activation entitlements in DB and use them in access checks so upgrades do not relock premium plugins.
2026-03-26 12:39:48 +01:00
master3395
2bfe6ac6ce Populate plugin store modify dates 2026-03-25 15:26:26 +01:00
master3395
3b6edc4806 Fix plugin settings proxy view callables 2026-03-25 14:41:40 +01:00
master3395
e60070cdce Fix plugin settings proxy callable names 2026-03-25 14:38:09 +01:00
master3395
6d9399778e Improve plugin store UX and fix plugin settings 404s
- Make /plugins/<plugin>/settings/ work for incomplete plugin installs by importing plugin views from source and relaxing overly strict proxy checks.
- Sync INSTALLED_APPS from plugin source when installed markers exist but installed copies are incomplete.
- Keep prior plugin store performance improvements (lazy upgrades fetching, fewer GitHub calls).
2026-03-25 14:31:57 +01:00
master3395
b3ae20cba0 Add managePlugins ACL + enforce pluginHolder actions
Ensures delegated admins with plugin management permission can access `/plugins/installed` UI and all plugin action endpoints consistently.
2026-03-25 10:12:48 +01:00
master3395
341667f3d9 pluginHolder: compat installPlugin() without zip_path (legacy pluginInstaller)
Detect inspect.signature for zip_path; fall back to chdir + pluginName.zip
for store install, upload install, and upgrade from GitHub.
2026-03-24 22:28:12 +01:00
master3395
91e8fb9aa4 pluginHolder: harden upgrade - verify meta sync, retry, fsync so version updates reliably 2026-03-07 22:04:52 +01:00
master3395
a6102f9c86 Plugin settings 404 and uninstall permission fixes
- 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
2026-03-06 21:00:33 +01:00
master3395
ecf3af0986 Plugin install: exclude README.md from wrong-location check (main repo has it at root)
Fixes false 'Files extracted to wrong location' when /usr/local/CyberCP/README.md
exists. Ensure panel user can create plugin dirs (e.g. chgrp lscpd /usr/local/CyberCP,
chmod g+w, and add panel user to group lscpd).
2026-03-06 20:51:45 +01:00
master3395
bbf0436c0d Plugin store: fix install for all plugins (nested repo + extraction)
- 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)
2026-03-06 20:40:37 +01:00
master3395
a6268d7f53 Plugin install: pass absolute zip path to avoid cwd races; extract always uses given path 2026-03-06 20:26:15 +01:00
master3395
197f355cf7 Plugins: fix 404 - add plugin roots to sys.path before loading URLs
- pluginHolder/urls: insert /usr/local/CyberCP and source paths at top of module
  so __import__(plugin_name + '.urls') finds plugin packages (fixes No module
  named 'X.urls'). Register plugin routes before catch-all help route.
- pluginHolder/views: add debug_loaded_plugins API and log full traceback on
  plugin import failure. panelAccess/emailMarketing settings/ routes added
  earlier; cspManager resilient to missing DB table.
Author: master3395
2026-02-15 23:24:04 +01:00
master3395
8fc7446d95 Plugins: fix installed/active counts, 404s, metadata sync, install fallback
- pluginHolder/views: use dir+meta.xml for installed count; exclude core apps;
  repair pass to restore meta.xml from source or GitHub; ensure_plugin_meta_xml
  falls back to GitHub when source missing; cap active <= installed
- pluginHolder/urls: include plugin routes for all on-disk plugins (not only
  INSTALLED_APPS) so /plugins/<name>/settings/ works after install
- pluginHolder/plugins.html: Install button tries local then store (GitHub)
- CyberCP/settings: sync INSTALLED_APPS with plugin dirs on disk (meta.xml+urls.py)
Author: master3395
2026-02-15 23:03:01 +01:00
master3395
4177f0023b Misc: firewall, pluginHolder, mobile CSS, install utilities, static assets
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 23:02:47 +01:00
master3395
02c8a9b6ac Plugin upgrade: sync meta.xml from GitHub raw so version matches store; logging get_current_timestamp
- Add CyberCPLogFileWriter.get_current_timestamp() for errorSanitizer (fixes 500 logging)
- After upgrade/install: fetch meta.xml from raw GitHub and overwrite installed file so
  store version (e.g. 1.1.0) is correct even when archive ZIP is cached/stale
- Upgrade/install: discover ZIP top-level folder and match plugin folder case-insensitively
- Improves redisManager/memcacheManager upgrade and all store installs
2026-02-03 19:37:36 +01:00
master3395
6218cfd064 Log successful plugin install (upload) to CyberPanel main log 2026-02-03 19:28:10 +01:00
master3395
d8ee83e30d Plugin Store & Installed Plugins: search bar, A-Å sort, sort toggle, Store A-Å label
- Installed plugins: search box in header (same row as Activate/Deactivate All)
- Grid/Table: default sort A-Å by name; sort bar with Name (toggle A-Å/Å-A), Type, Date (toggle newest/oldest)
- Apply sort on load so list shows A-Å when Name A-Å is selected
- Store view: letter filter label 'A-Å Filter' (not A-Z); add Æ, Ø, Å to letter buttons
- views.py: sort pluginList by name (case-insensitive) before template
- Add deploy-installed-plugins-search.sh for template deployment
2026-02-02 20:39:56 +01:00
master3395
e32219edde Plugin Store: badges (NEW/Stable/Unstable/STALE), Activate/Deactivate All, categories & premium docs in help 2026-02-02 02:18:05 +01:00
master3395
86b5ed6e0e feat: no plugins required by default; Plugin Store category updates
- Remove emailMarketing from default INSTALLED_APPS
- Comment out emailMarketing URL (plugin installer adds when installed)
- Bump emailMarketing, examplePlugin meta.xml to 1.0.1
- Plugin Holder: remove Plugin category, enforce Utility/Security/Backup/Performance
- Add to-do/PLUGIN-DEFAULT-REMOVAL-2026-02-01.md
2026-02-01 23:47:12 +01:00
master3395
2bde2624f0 Enhance plugin store: Add upgrade button, auto-backup, revert functionality, cache randomization, and local time display
- Add upgrade button in plugin store when updates are available
- Implement automatic plugin backup before upgrades
- Add revert version functionality with backup selection
- Randomize cache duration (±10 minutes) to prevent simultaneous GitHub API requests
- Display cache expiry time in user's local timezone and locale format
- Fix revert plugin function to work without event object
- Improve error handling in plugin store operations
2026-01-27 00:32:45 +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
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
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
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
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
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
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
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
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
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
master3395
571a34822f Fix plugin Settings button to use main route instead of /settings/
- Change default manage_url from /plugins/{plugin}/settings/ to /plugins/{plugin}/
- Many plugins don't have a /settings/ route but have a main route
- Ensures Settings button works for plugins like examplePlugin that only have a main route
- Still respects settings_url and url from meta.xml if provided
2026-01-20 01:39:35 +01:00