Commit Graph

5769 Commits

Author SHA1 Message Date
master3395
a8d1c0f4e9 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
ff93f0facb 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
c50b51dfbf 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
e71fe07952 install.sh: fetch cyberpanel.sh from repo so AlmaLinux 10 fixes are used 2026-03-26 01:35:06 +01:00
Infinyte Solutions
421f085d26 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
50eef93271 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
a835413b63 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
63110a4605 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
e09804f25a 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
0610e07a4a 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
35b705aaad 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
12475461a1 fix(install): strip MaxScale apt repo in universal_os_fixes (Ubuntu/Debian) 2026-03-26 01:06:26 +01:00
master3395
9627770c99 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
b4a17be963 Merge pull request #1745 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-26 00:30:03 +01:00
master3395
80e4df87ba 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
f4a720d65e 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
856606d6a3 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
17c66c8485 CyberPanel: fix webmail folder selection and UI assets 2026-03-25 22:02:54 +01:00
master3395
bc54c9c845 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
789b914b6f 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
cc9baf962d 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
8d78e90ad6 install: detectPlatform treat bare VERSION_ID 9/10 as rhel9 for OLS binaries 2026-03-25 20:37:43 +01:00
master3395
a4421681bc 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
234d5211ef Merge pull request #1744 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-25 19:10:43 +01:00
master3395
4b4625e032 Populate plugin store modify dates 2026-03-25 15:26:26 +01:00
master3395
7a9fcf28fb Fix plugin settings proxy view callables 2026-03-25 14:41:40 +01:00
master3395
a2fddadfd6 Fix plugin settings proxy callable names 2026-03-25 14:38:09 +01:00
master3395
0b79346ea1 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
22f97ac33d Merge pull request #1743 from master3395/v2.5.5-dev
Add websiteFunctions legacy Websites stub migration
2026-03-25 11:05:52 +01:00
master3395
3524b46ff0 Add websiteFunctions legacy Websites stub migration 2026-03-25 11:04:47 +01:00
Master3395
012a9c6248 Merge pull request #1742 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-25 10:58:05 +01:00
master3395
69bafdf09e 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
fea1ab6619 listUsers: suppress duplicate success toasts after refresh
populateCurrentRecords() always showed Users successfully fetched on every
successful fetch, so delete/edit/ACL/suspend showed two popups. Add optional
suppressSuccessNotify; use silent refresh after mutations and on initial load.
2026-03-25 01:47:31 +01:00
master3395
3054e6e50d fix(users): delete panel users when WebAuthn tables are missing
- robust_delete_administrator: use ORM delete when webauthn_credentials exists; else SQL DELETE after optional webauthn row cleanup and recursive child admins
- Fixes MySQL 1146 ProgrammingError on submitUserDeletion for installs without webauthn migrations
- JSON responses use application/json; errors include deleteStatus for listUsers UI
2026-03-25 01:43:58 +01:00
master3395
a741375aa4 fix(users): homeDirectoryManager logging + duplicate username check
- Replace invalid logging.CyberCPLogFileWriter calls (logging is already CyberCPLogFileWriter); fixes AttributeError masking real errors in createUserDirectory
- Same fix in homeDirectoryViews exception handlers
- Pre-check Administrator username before save; use django.db.utils.IntegrityError
- Fix userMigration error handler to call writeToFile correctly
- Validate non-empty username after strip
2026-03-25 01:23:02 +01:00
master3395
e78f391ce3 fix(users): resolve home_dir when selected home id missing (UnboundLocalError)
- After invalid/missing HomeDirectory id, resolve home_dir from best path like auto mode
- Handle MultipleObjectsReturned on path lookup; use get_or_create for UserHomeMapping
- Clear errors for ACL.DoesNotExist and IntegrityError (duplicate username)
- Ensure JSON error responses include createStatus and application/json
2026-03-25 01:14:55 +01:00
master3395
276b4fa375 fix(users): Create User ACL ng-model default and safer submitUserCreation
- Initialize selectedACL in create user template so JSON POST always includes ACL
- Explicit option values; pass default_acl_name from view for ng-init
- Coerce websitesLimit to int; validate selectedACL before ACL.objects.get
- ensure_csrf_cookie on createUser page load
- Optional /etc/cyberpanel/csrf_trusted_origins for HTTPS IP:port panels
- Allow changeUserACL on getUserHomeDirectories (parity with create user page)
- Sync public/static and static copies of userManagment.js with app static
2026-03-25 01:10:11 +01:00
master3395
fbbb3dcbed pluginInstaller: privileged read for core files (index.html uninstall)
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.
2026-03-25 00:08:08 +01:00
master3395
1f06e8b090 pluginInstaller: privileged write for settings/urls, skip duplicate pluginHolder urls
- _write_lines_to_protected_file: temp file + ProcessUtilities cp when direct write fails
- upgradingSettingsFile: idempotent; fallback anchor pluginHolder; clearer warnings
- upgradingURLs: no-op when pluginHolder.urls present (avoids duplicate routes and root-only edits)
- add/removeInterfaceLink and removeFromSettings/URLs use protected writer
2026-03-24 23:21:09 +01:00
master3395
bb61871b28 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
bd790c39a6 Merge pull request #1741 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-24 20:33:27 +01:00
master3395
b9b24dd687 FTP: path normalization, post-create directory edit, enable/disable
- Resolve FTP home paths without duplicating /home/domain; support absolute paths under site home
- Add changeFTPDirectory API and list UI; improve create form path help
- Add setFTPAccountStatus (Status 0/1) with Enable/Disable on list page
- Pure-FTPd MySQL: require Status='1' for authentication in install templates
- Plugin signals for change directory and account status
2026-03-24 20:22:56 +01:00
master3395
10d4da6c0f fix(ftp): hide create-account alerts until submit (ng-show + ng-cloak)
- Replace inverted ng-hide flags with alertFtp* + ng-show (default false).
- Remove broken cantLoadInitialDatas guard (successfullyCreatedFTP !== false
  was true on initial state).
- Per-request submissionCompleted prevents duplicate error handlers.
- ng-cloak on controller root + CSS avoids FOUC before first digest.
- Sync static/ and public/static/ ftp.js with app static copy.
2026-03-24 00:17:23 +01:00
master3395
606209060f fix(ftp): add idempotent custom_quota columns on users table
- CPScripts/ensure_ftp_users_quota_columns.py checks information_schema and
  ALTER TABLE users ADD COLUMN for custom_quota_enabled and custom_quota_size
  when missing (fixes MySQL 1054 on FTP account creation).
- deploy-ftp-users-custom-quota-columns.sh copies script to CyberCP and runs
  repair; restarts lscpd when active.
- upgrade_modules/10_post_tweak.sh runs the repair after upgrade sync.
2026-03-24 00:07:58 +01:00
usmannasir
383d4ea3f1 Fix Dovecot hard restart killing active IMAP/POP3 connections
Replace 'systemctl restart dovecot' with 'doveadm reload' in
virtualHostUtilities, mailUtilities, and renew modules. The nightly
backup scheduler, SSL operations, and weekly cert renewal were
forcefully terminating all client sessions. doveadm reload applies
config changes (including updated SSL certs) without dropping
existing connections. upgrade.py is intentionally left unchanged
as full restarts are appropriate during upgrades.
2026-03-20 16:01:30 +05:00
usmannasir
d8cfad2761 Merge branch 'v2.4.4' into v2.4.5 2026-03-15 06:29:40 +05:00
usmannasir
92dbc2be76 Update cyberpanel_ols module to v2.7.0 and remove hash verification
Downloads are served directly from cyberpanel.net so checksum
verification is unnecessary. Also updates module URLs from v2.4.4
to v2.7.0.
2026-03-15 06:28:17 +05:00
Master3395
edeebb55ce Merge pull request #1737 from master3395/v2.5.5-dev
Subdomain fixes: creation (FQDN normalize), SSL (child webroot), Clou…
2026-03-14 23:53:14 +01:00
master3395
56866172c6 Subdomain fixes: creation (FQDN normalize), SSL (child webroot), CloudFlare delete (parent zone), acme-challenge dir 2026-03-14 23:51:51 +01:00
Master3395
0587085a5b Merge pull request #1734 from master3395/v2.5.5-dev
Database create: allow special chars in password, return real errors,…
2026-03-13 23:39:18 +01:00