Commit Graph

97 Commits

Author SHA1 Message Date
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
9ee84252a2 pluginHolder: single upgrade confirmation (keep WARNING), refresh list after upgrade
- Remove second 'Final confirmation' dialog; keep only the WARNING backup dialog
- After successful upgrade, refetch plugin store and refresh upgrades list so
  upgraded plugins no longer appear under Upgrades Available
2026-03-07 21:12:54 +01:00
master3395
5a8f0431c3 Plugins: add Upgrades Available tab for easier plugin updates
- New tab between Table View and CyberPanel Plugin Store with badge count
- Dedicated view listing only installed plugins with a newer store version
- Table columns: Plugin Name, New Version, Your Version, Date, Action (Upgrade)
- Notice to read release info and backup before upgrading
- Badge and list populated from existing store API (update_available)
2026-03-07 02:44:54 +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
10e6d09e88 Apply stashes: README upgrade docs, .gitignore, dockerManager, pluginHolder URLs
- README: upgrade to v2.5.5-dev, master3395 URLs, preUpgrade/loader docs
- .gitignore: patreon_secrets.env, patreon_config.py
- dockerManager: keep listContainersPage (upstream), resolve JS conflict
- pluginHolder: add check-subscription and plugin_help routes (merge both)
2026-02-17 13:40:03 +01:00
KraoESPfan1n
5f6ca0d379 Merge origin/v2.5.5-dev: Plugin Store sidebar, ?view=store, master3395 default, clone comment 2026-02-16 23:51:13 +01:00
master3395
e458e04a8e Sidebar: add Plugin Store link; upgrade: MariaDB 12.3 path, master3395 clone
- baseTemplate: add 'Plugin Store' to Plugins submenu (links to ?view=store)
- pluginHolder/plugins.html: respect URL param view=store on load
- cyberpanel_upgrade.sh: proper MariaDB major-version upgrade (stop, remove, install, start, mariadb-upgrade); use CYBERPANEL_GIT_USER only (remove server-specific path)
- plogical/upgrade.py: clone URL from CYBERPANEL_GIT_USER for fork
2026-02-16 23:47:49 +01:00
master3395
b63317b7af Install/upgrade and UI updates: monolithic install, SnappyMail, firewall, to-do docs
- Install: monolithic install script, venvsetup_modules and venvsetup_monolithic,
  install_modules (parse_main, menus, actions, etc.), remove legacy email-configs
  and php-configs from repo, add install/snappymail and Rainloop->SnappyMail
  migration script
- CyberPanel: urls.py, cyberpanel.sh, cyberpanel_upgrade_monolithic.sh tweaks
- Firewall: firewall.js and firewall.html updates
- plogical: mailUtilities.py, upgrade.py; upgrade_modules 10_post_tweak.sh
- pluginHolder: deploy-plugins-template.sh
- to-do: docs (git conflicts, HTTP 500 recovery, phpMyAdmin, plugins, SnappyMail
  rename, install/upgrade OS support, security whitelist, etc.)
- upgrade_modules: 02_checks_part1/part2.txt
2026-02-16 00:12:03 +01:00
master3395
7de649c47a Plugins: move Show/Sort by into collapsible Filter (rename Category Filter to Filter) 2026-02-15 23:54:44 +01:00
master3395
22aeda0c98 Plugins: collapsible Category Filter on Grid/Table view (like A-Å in store) 2026-02-15 23:47:39 +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
48ebfc79b2 pluginHolder/urls: register plugin routes before catch-all so /plugins/<name>/settings/ match 2026-02-15 23:06:03 +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
df7c5ba234 Only include plugin URLs when app is in INSTALLED_APPS
Skip dynamic plugin URL inclusion for plugins that are on disk but not
in Django INSTALLED_APPS to avoid RuntimeError when loading models.
Plugin installer adds apps to INSTALLED_APPS on install; this prevents
breakage when that step was missed or reverted.
2026-02-03 19:09:46 +01:00
master3395
0225f2f95a Fix plugin settings 404: dynamic URL inclusion for all installed plugins
- pluginHolder/urls.py: Discover plugins from /usr/local/CyberCP and source
  paths (/home/cyberpanel/plugins, /home/cyberpanel-plugins); dynamically
  include each plugin's urls so /plugins/<name>/settings/ works without
  hardcoding. Add source path to sys.path when loading from source.
- CyberCP/urls.py: Remove hardcoded _plugin_routes; all plugin routes now
  served via pluginHolder dynamic inclusion.

Fixes 404 on /plugins/contaboAutoSnapshot/settings/ and any installed plugin
settings page. No per-plugin core changes required.
2026-02-03 18:46:05 +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
1118f63b1a Plugin updates: premiumPlugin & paypalPremiumPlugin unified verification, Installed Plugins UI improvements 2026-02-02 03:39:42 +01:00
master3395
462f87a578 Remove Patreon/subscribe messaging from plugin front - only in Settings 2026-02-02 03:01:14 +01:00
master3395
4757d45b11 Plugin Development Guide: bump version to 2.1.0 2026-02-02 02:36:23 +01:00
master3395
d6d1f2d993 Plugin Development Guide: add collapsible accordion sections 2026-02-02 02:35:23 +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
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