Commit Graph

5790 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
4d36536115 Merge pull request #1748 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-27 23:51:17 +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
7aaacc1f0d Merge pull request #1747 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-27 23:10:37 +01:00
master3395
b89ed169ca upgrade sync: force match origin when checkout blocked; fail script if sync fails
- 09_sync: stash -u + reset --hard; quarantine untracked paths; verify HEAD==origin/branch
- Remove subshell/tee that hid git failures; set /etc/cyberpanel/last_git_sync_failed on error
- cyberpanel_upgrade: exit 1 after final display if git sync failed
- 11_display_final: show warning banner when CYBERPANEL_GIT_SYNC_OK!=1
2026-03-27 23:02:32 +01:00
master3395
d2e0a1bda7 upgrade: fail fast if CyberCP clone fails; retry clone; quarantine old tree
- Honor downloadAndUpgrade return value; exit 1 instead of printing Upgrade Completed
- Restart lscpd if code update fails so panel is reachable on old tree
- CYBERPANEL_UPGRADE_CLONE_ATTEMPTS (default 2) for transient clone errors
- On rmtree failure, move /usr/local/CyberCP aside instead of aborting when possible
- Export CYBERPANEL_UPGRADE_CLONE_ATTEMPTS from 08_main_upgrade.sh
2026-03-27 22:47:09 +01:00
master3395
35fe6abba6 Version Management: show fork + upstream tips; upstream-only when origin is official
- Parse git origin; show fork block only when not usmannasir/cyberpanel
- Always fetch official upstream branch tip; fetch fork tip when fork
- Notecheck: fork installs vs fork tip; official vs upstream tip
- Template: tracking branch, optional fork rows, drift info; clarify warning
2026-03-27 22:35:16 +01:00
master3395
ce11e643bd feat(versionManagment): fork vs official upstream rows and layout refresh
- views: remote_display, branch_ref, fork_remote_commit, upstream_commit,
  short SHAs, GitHub commit URLs, notecheck_compare_remote, local_behind_official
- template: installation grid, full-width meta rows, i18n upgrade note,
  info notice when local differs from official upstream on dev
2026-03-27 22:08:45 +01:00
master3395
cbbb1b8dba fix(versionManagment): compare dev fork installs to fork branch on GitHub
Official usmannasir/cyberpanel origin still uses upstream v2.5.5-dev tip;
forks now resolve latest commit from origin owner/repo so local HEAD can
match Latest Commit without false upgrade notices.
2026-03-27 21:58:48 +01:00
master3395
bbcfec196d fix: LPMA launch routes in secMiddleware; strict sign-on + lpma_policy_read
- secMiddleware: allow Limited phpMyAdmin launch URLs and phpmyadminsignin
  without JSON-body filtering that breaks sign-on POSTs
- plogical/public phpmyadminsignin: lpma_policy_read.inc.php, strict cookie helpers
- webmail: section header comments only
2026-03-27 21:54:17 +01:00
master3395
1c6ab7a188 feat(baseTemplate): plugin sidebar context; LPMA link for grant-only users
- plugin_sidebar_context: show_plugins_menu, Limited phpMyAdmin for cpuser grants
- index.html: conditional Installed/Store vs grant-only LPMA submenu
2026-03-27 21:48:25 +01:00
master3395
087863134c feat(firewall): merge Auto Ban Security Alerts logs into banned IPs API
- getBannedIPs: append AutoBanLog rows (latest per IP) not already in DB/JSON
- Skip expired timed bans; tag rows with ban_source autoBanSecurityAlerts
- removeBannedIP/deleteBannedIP: handle synthetic id ablog-<pk> via unban by IP
2026-03-27 21:48:25 +01:00
Master3395
af07be2fa1 Merge pull request #1746 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-27 21:14:23 +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
e94293f1d3 fix phpmyadmin signin endpoint not found
Restore the missing phpMyAdmin sign-in bridge file so CyberPanel DB login no longer returns 404 on /phpmyadmin/phpmyadminsignin.php.
2026-03-27 13:40:49 +01:00
master3395
3af98321d3 fix: ensure phpMyAdmin signin bridge + auto plugin migrations + PMA tmp dir
- Add plogical/phpmyadmin_utils.ensure_phpmyadmin_signin_bridge: restore
  phpmyadminsignin.php and tmp/ if missing (fixes 404 on /phpmyadmin/phpmyadminsignin.php).
- Call from databases phpMyAdmin page, fetchDetailsPHPMYAdmin, install, and upgrade PMA paths.
- install/upgrade: use makedirs(..., exist_ok=True) for phpmyadmin/tmp instead of mkdir.
- pluginInstaller: run migrate when migrations/ contains modules OR enable_migrations;
  use CyberCP venv python; --noinput for migrate; log non-zero exits.
2026-03-27 01:15:33 +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
638ad8f04e install: port origin/v2.4.5 lscpd el9/10 selection, start retry, venv lscpd restart (e49ed16f)
- Use lscpd.0.4.0 on Alma 9/10 and RHEL-family VERSION_ID 9/10
- daemon-reload + retry systemctl start lscpd in setupLSCPDDaemon
- 04_after_install: _restart_lscpd_safe + libxcrypt-compat on EL10 prereqs
2026-03-26 01:36:55 +01:00
master3395
6db13857d2 install.sh: fetch cyberpanel.sh from repo so AlmaLinux 10 fixes are used 2026-03-26 01:35:06 +01:00
Infinyte Solutions
67fc054364 Refactor: replace url() with path() for Django routes
Update URL generation to use path() instead of url(),
aligning with Django 4.x where url() is deprecated.
2026-03-26 01:26:39 +01:00
usmannasir
a9b3018d7e Add ModSecurity compatibility detection for user installations
Handle the scenario where users install ModSecurity after CyberPanel is already
installed with custom OpenLiteSpeed binaries.

Problem:
- When users click "Install ModSecurity" in CyberPanel UI, the system used
  package manager (yum/apt) to install stock ModSecurity
- Stock ModSecurity is NOT ABI-compatible with custom OLS binaries
- This causes immediate server crashes (segfaults) when installed

Solution:
- Detect if custom OLS binary is already installed before installing ModSecurity
- If custom OLS detected, download compatible ModSecurity from cyberpanel.net
- If stock OLS detected, use package manager as usual

Implementation:
- isCustomOLSBinaryInstalled(): Detects custom OLS by scanning binary for markers
- detectBinarySuffix(): Determines Ubuntu vs RHEL binaries needed
- installCompatibleModSecurity(): Downloads, verifies, and installs compatible ModSecurity
- Modified installModSec(): Main entry point - routes to compatible installer if needed

User flow:
1. User with custom OLS clicks "Install ModSecurity" in UI
2. System detects custom OLS binary is installed
3. System writes "Detected custom OpenLiteSpeed binary" to install log
4. System downloads OS-specific compatible ModSecurity from cyberpanel.net
5. System verifies SHA256 checksum
6. System backs up any existing ModSecurity
7. System installs compatible version with OLS restart
8. User sees "ModSecurity Installed (ABI-compatible version).[200]"

Safety features:
- Checksum verification before installation
- Automatic backup of existing ModSecurity
- Graceful OLS restart with timeout handling
- Detailed logging to /home/cyberpanel/modSecInstallLog

This prevents server crashes when users install ModSecurity after custom OLS
binaries are already deployed.
2026-03-26 01:25:21 +01:00
usmannasir
61bc08d36c Fix n8n proxy configuration for OpenLiteSpeed compatibility
- Change N8N_HOST to 0.0.0.0 (internal bind address, not domain)
- Simplify VHost extraHeaders to ONLY set Origin header
- Remove duplicate X-Forwarded-* headers (OLS adds these automatically)
- Remove N8N_ALLOWED_ORIGINS and N8N_ALLOW_CONNECTIONS_FROM (not needed)

The key issue was duplicate X-Forwarded-Host headers. OpenLiteSpeed proxy
contexts automatically add X-Forwarded-* headers, so explicitly setting
them creates duplicates that cause n8n validation to fail.

Only the Origin header needs explicit configuration in extraHeaders.
This works with the patched OLS binary (MD5: b9c65aa2563778975d0d2361494e9d31)
that forwards Origin headers from the client.
2026-03-26 01:25:16 +01:00
usmannasir
fd6c8a337a Update n8n deployment to use latest version
- Changed from pinned version 1.86.1 to latest
- Requires OpenLiteSpeed binaries with Origin header forwarding support
- Compatible with n8n 1.87.0+ which has strict Origin validation

Note: This requires the OpenLiteSpeed binary that includes the Origin
header forwarding patch in the proxy module. The patch is available
in the CyberPanel OpenLiteSpeed distribution.
2026-03-26 01:24:45 +01:00
usmannasir
7e98fbd093 Fix n8n deployment compatibility with OpenLiteSpeed proxy
- Pin n8n to version 1.86.1 to avoid Origin header validation issues
- Change N8N_HOST from 0.0.0.0 to domain for better compatibility
- Add N8N_PROXY_HOPS=1 to fix X-Forwarded-For errors
- Add N8N_ALLOWED_ORIGINS and N8N_ALLOW_CONNECTIONS_FROM for future compatibility
- Fix SetupN8NVhost to remove malformed Origin header setting

n8n versions 1.87.0+ introduced strict Origin header validation that is
incompatible with OpenLiteSpeed proxy (which doesn't forward Origin headers).
Version 1.86.1 works correctly with OLS and SSE push backend.
2026-03-26 01:24:45 +01:00
master3395
7588dc5cef Fix AlmaLinux 8 installation: Add python-dotenv to requirements
- Install python-dotenv in virtual environment during CyberPanel setup
- Fixes Django's inability to load .env file on AlmaLinux 8
- Resolves "Access denied for user 'cyberpanel'@'localhost'" errors
- Added to all installation paths (normal, DEV, and after_install)

This ensures Django can properly load database credentials from .env file
on AlmaLinux 8 systems where python-dotenv was missing.
2026-03-26 01:24:35 +01:00
Master3395
86912db06e Enhance OS detection and support for additional distributions
- Updated OS detection logic to include CentOS Stream and Red Hat Enterprise Linux.
- Added support for AlmaLinux 9 and 10, as well as Debian 11, 12, and 13.
- Improved error messages to reflect the expanded list of supported operating systems.
- Adjusted package management handling for Debian to treat it as Ubuntu for compatibility.
2026-03-26 01:23:03 +01:00
master3395
f6c3c5e64f fix(install): strip MaxScale apt repo in universal_os_fixes (Ubuntu/Debian) 2026-03-26 01:06:26 +01:00
master3395
aa0567f2af fix(install): Ubuntu MaxScale apt repo (#1740), AlmaLinux 10 prereqs (#1736)
- Add install_utils.strip_mariadb_maxscale_apt_repos() after mariadb_repo_setup
  so noble/jammy apt-get update succeeds (GH usmannasir/cyberpanel#1740).
- AlmaLinux 10: skip early return after universal fixes; add is_almalinux10,
  fix_almalinux10_mariadb (EPEL, CRB, MariaDB.org repo, maxscale disable).
- EL10 maps to rhel9 for OLS custom binary URLs until el10 builds exist.
- Mirror MaxScale strip in install.py _attemptMariaDBUpgrade Ubuntu path.
2026-03-26 01:04:48 +01:00
Master3395
80de7fe237 Merge pull request #1745 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-26 00:30:03 +01:00
master3395
cdcc199e2e webmail: account picker search, list/reader resize, assets v28
- Searchable mailbox dropdown and compose From filter
- Resizable split between message list and reader pane
- Styles for picker, list-detail resizer, sr-only; bump webmail.js to v28
2026-03-26 00:26:27 +01:00
master3395
f6fc11e697 webmail: folder settings store, spam/junk layout, cache busting
- Persist folder mappings outside /etc/cyberpanel (writable fallback under CyberCP)
- IMAP client + manager: settings API, safer folder delete rules
- Frontend: case-insensitive roles, layout race fix, single Spam mapping row
- Views: no-store cache headers; template v5 UI marker and webmail.js v26
2026-03-26 00:10:57 +01:00
master3395
3e8750ab58 webmail: v2.5.5-dev UI and backend improvements
- Resizable folder sidebar with persisted width; nested folder tree with expand/collapse
- Message search: scope all folders or single folder; listMessages honors UID filter
- Drag-and-drop messages onto folders to move (multi-select supported)
- SnappyMail import paths, folder settings store, wm DB migration and SQL install
- IMAP quoted mailbox, IPv4 SMTP relay, compose recipient handling
- Modal new/delete folder flows; dash-free UI copy; folder pills in search results
2026-03-25 23:18:54 +01:00
master3395
e764828ac8 CyberPanel: fix webmail folder selection and UI assets 2026-03-25 22:02:54 +01:00
master3395
b20422430f upgrade sync: merge DATABASES only into settings after git pull (fix webmail/emailDelivery dropped from INSTALLED_APPS); add merge_production_settings.py; fix PIPESTATUS with tee 2026-03-25 20:58:33 +01:00
master3395
36276ecb64 Merge origin/v2.5.5-dev into v2.5.5-dev (integrate PR #1744 with local 2.4.5 parity) 2026-03-25 20:51:16 +01:00
master3395
9f77df85fb CyberCP: align urlpatterns with v2.4.5 (loginSystem after base; webmail/emailDelivery last); keep PUBLIC_ROOT routes first; optional emailMarketing after plugins; add webmail/emailDelivery slash redirects 2026-03-25 20:47:21 +01:00
master3395
1dfb592b02 install: detectPlatform treat bare VERSION_ID 9/10 as rhel9 for OLS binaries 2026-03-25 20:37:43 +01:00
master3395
4d62272664 Merge upstream v2.4.5 into v2.5.5-dev for full stack parity
Integrates webmail and emailDelivery apps, mail-server and install/upgrade
paths, cyberpanel_ols 2.7.0-style binaries, and v2.4.5 UI patterns while
preserving v2.5.5-dev behavior (SnappyMail/PUBLIC_ROOT, childPath in
launchChild, hardened downloads and SSH activity modal).
2026-03-25 20:36:51 +01:00
Master3395
26e20be12d Merge pull request #1744 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-25 19:10:43 +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
3cc0f7723b Merge pull request #1743 from master3395/v2.5.5-dev
Add websiteFunctions legacy Websites stub migration
2026-03-25 11:05:52 +01:00