Commit Graph

204 Commits

Author SHA1 Message Date
master3395
c434aaeb54 harden installer adminPass wrapper behavior
Persist quoted admin password to /etc/cyberpanel/adminPass and tighten wrapper permissions to 700 in installer-generated /usr/bin/adminPass.
2026-04-14 21:57:04 +02:00
master3395
a548f0c042 fix password argument quoting for adminPass flows
Quote admin password arguments during install and harden upgrade rewrites of /usr/bin/adminPass so shell-sensitive characters are preserved instead of expanded.
2026-04-14 21:54:27 +02:00
master3395
c7995ecf03 Fix missing /usr/local/CyberCP/bin/python for cron and IncBackups
Add plogical/cyberpanel_python.py with resolve_cyberpanel_python() and
ensure_cyberpanel_bin_python_shim() (symlink to system Python when venv
binary is absent). Call shim before writing root crontab on install/upgrade,
and from IncBackups/IncScheduler.py so existing jobs self-heal. IncBackups
views use resolved interpreter for backupUtilities. Upgrade._python_for_manage
delegates to resolve_cyberpanel_python().
2026-04-12 02:54:08 +02:00
master3395
3d83fce2c2 Panel static: sync Django STATIC_ROOT to public/static for LiteSpeed
LiteSpeed CyberPanel vhost serves /static/ from public/static while
collectstatic writes to STATIC_ROOT. Merge after collectstatic and ensure
webmail assets so /webmail/ Angular loads. Hook install/upgrade staticContent,
deploy scripts, and upgrade.sh; fix Django --noinput flag; restore lscpd
ownership on public/static after chown root. SnappyMail: require index.php on
install and validate tree after unzip on upgrade.
2026-04-12 02:39:26 +02:00
master3395
6f6f1dcd53 fix(php): OS-specific lsphp install matrix shared install↔upgrade
Add install_utils.get_lsphp_install_suffixes() (Alma 9/10+, EL9+,
Ubuntu 24.04+, Debian 13+ use 74–85; older OS keep 71–85).
installCyberPanel.installAllPHPVersions uses the matrix and installs
every listed lsphp on Ubuntu (fixes 74 skipped by slice).
upgrade.get_available_php_versions loads the same helper from install/.
Extend PHP-FPM restart loops to 8.4/8.5 and CloudLinux list to 85.
Clarify /usr/bin/php symlink priority comments in install.py.
2026-04-11 23:03:26 +02:00
master3395
7306fcb87d Bundle SnappyMail list-unsubscribe-header plugin; enable on install/upgrade
- Add install/snappymail/plugins/list-unsubscribe-header (upstream GitHub plugin)
- Add plogical/snappymail_plugin_utilities.py to copy into snappymail + legacy rainloop data roots and merge enabled_list
- Run after SnappyMail CyberPanel installer in install.py and upgrade.py
- InstallMailBoxFoldersPlugin now merges plugins instead of replacing enabled_list; also installs list-unsubscribe

Roundcube is not shipped by CyberPanel core; SnappyMail is the bundled webmail.
2026-04-11 01:51:09 +02:00
master3395
2c00789774 Add RabbitMQ support to Manage Applications and lifecycle flows.
Wire RabbitMQ into app management UI/actions, optional fresh-install flag handling, and upgrade-safe marker/service reconciliation so new installs and upgrades can expose it reliably.
2026-03-31 20:41:00 +02: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
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
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
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
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
90fcc7b621 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
usmannasir
4490a1830e Merge branch 'v2.4.4' into v2.4.5 2026-03-15 06:29:40 +05:00
usmannasir
a7c342daae 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
63fb988b55 Docker containers 500 fix, firewall banned IPs, container logs readability, base Ban IP sync to DB
- dockerManager: add 0001_initial migration (CREATE TABLE IF NOT EXISTS), migrate-and-retry on DB errors, safe error response, fix logging.CyberCPLogFileWriter.writeToFile
- dockerManager/views: listContainersPage fallback HTML with error message if template fails
- dockerManager/viewContainer: improve container log readability (font-size 1rem, color #f1f5f9, line-height 1.6)
- baseTemplate: blockIPAddress also adds ban to firewall BannedIP model so Firewall > Banned IPs shows all
- firewall: getBannedIPs migrate-and-retry on OperationalError/ProgrammingError; install runs migrate firewall
- plogical/upgrade: syncBannedIPsJsonToDb() to sync JSON bans to firewall_bannedips; firewallMigrations() calls it; CyberPanelUpgrade runs firewallMigrations(); someDirectories creates /usr/local/CyberCP/data
- install: explicit migrate firewall after global migrate
2026-03-06 18:50:30 +01:00
usmannasir
cc9d830507 Fix SMTP relay on AlmaLinux/RHEL: install cyrus-sasl-plain package
Postfix SASL PLAIN auth fails with "No worthy mechs found" on
RHEL/AlmaLinux because cyrus-sasl-plain is not installed by default.
- Add cyrus-sasl-plain to postfix install in install.py
- Auto-install in configureRelayHost() for existing servers
- Add to upgrade.py setupSieve() for existing installations
2026-03-06 18:36:41 +05:00
usmannasir
abc901f1c8 Fix fresh install crash: replace plogical imports in installCyberPanel.py
installSieve() and setupWebmail() imported from plogical module which
doesn't exist during fresh install (CyberPanel code not yet deployed).
- Replace FirewallUtilities.addSieveFirewallRule() with direct firewall-cmd/ufw calls
- Replace generate_pass() with inline secrets.choice() password generation
2026-03-06 17:10:08 +05:00
usmannasir
1e6e60a0e9 Revert webmail.conf ownership to cyberpanel:cyberpanel
CyberPanel Python app runs as cyberpanel user (lscpd is just the web
server). The webmail.conf must be readable by cyberpanel, not lscpd.
2026-03-06 16:29:34 +05:00
usmannasir
7fe521e1b3 Fix webmail.conf ownership: use lscpd:lscpd instead of cyberpanel:cyberpanel
lscpd worker runs as user lscpd, not cyberpanel. The webmail.conf file
(containing master user credentials) was unreadable by lscpd, causing
master auth to silently fail and fall back to empty password auth.
Also fix ownership on existing installs during upgrade.
2026-03-06 16:24:42 +05:00
usmannasir
485dd27257 Fix dovecot-mysql missing on AlmaLinux 9+: use standard packages instead of gf-plus
AlmaLinux 9 uses standard dovecot/dovecot-mysql packages from OS repos,
not dovecot23/dovecot23-mysql from Ghettoforge. Also fix openeuler path
which was missing dovecot-mysql entirely.
2026-03-06 16:17:19 +05:00
usmannasir
1d33ba0107 Improve Sieve: folder dropdown in rules UI, INBOX. prefix fix, robust upgrade regexes
- Replace free text input with folder dropdown for move-to-folder rules
- Auto-prefix INBOX. namespace to folder names in sieve scripts
- Strip INBOX. prefix when parsing sieve scripts back to rules
- Make upgrade setupSieve() regexes more flexible to handle config variations
- Add os.makedirs for conf.d directory in both install and upgrade
- Validate ManageSieve config with both inet_listener and service checks
2026-03-06 03:50:03 +05:00
usmannasir
3a0729156a Fix Sieve storage: add home dir to user_query, sieve plugin paths, and mailbox autocreate
- Add home directory (CONCAT) to dovecot-sql.conf.ext user_query so sieve
  can locate script storage per user
- Add sieve/sieve_dir plugin settings to dovecot.conf templates
- Add lda_mailbox_autocreate/autosubscribe so fileinto creates missing folders
- Update setupSieve() upgrade function to patch all three on existing installs
2026-03-06 03:39:04 +05:00
usmannasir
008cc7da0e Enable Sieve email filtering in install and upgrade for all OS
- Add sieve to dovecot protocols in both dovecot.conf templates
- Add sieve plugin to LDA mail_plugins in dovecot.conf templates
- Write ManageSieve config (20-managesieve.conf) during installSieve()
- Add setupSieve() upgrade function: patches dovecot.conf, installs
  packages (dovecot-sieve/managesieved on Ubuntu, pigeonhole on CentOS),
  writes ManageSieve config, opens firewall port 4190, restarts dovecot
- Call setupSieve() in main upgrade flow
2026-03-06 03:32:04 +05:00
usmannasir
36f0185708 Fix webmail SSO setup in install and upgrade
Install setupWebmail() now creates /etc/cyberpanel dir if missing,
patches dovecot.conf with master passdb block if absent, and skips
gracefully when already configured. Prevents webmail auth failures
on fresh installs where the directory didn't exist yet.

Also adds cybermail_accounts and cybermail_domains CREATE TABLE
statements to upgrade.py applyLoginSystemMigrations() for the
emailDelivery app on existing installs.
2026-03-06 01:15:04 +05:00
usmannasir
7e86659a55 Fix missing mail TLS certs: copy self-signed certs to /etc/pki/dovecot/ at install and upgrade
On Ubuntu, the install creates /etc/pki/dovecot/ directories but never
populates them with certs. Postfix main.cf references these paths for
STARTTLS. Without them, inbound STARTTLS fails and external mail servers
(Gmail etc.) drop the connection, preventing mail delivery.
2026-03-05 05:54:09 +05:00
usmannasir
632dc3fbe9 Fix critical webmail bugs: XSS, SSRF, install ordering, and UI issues
Security fixes:
- Escape plain text body to prevent XSS via trustAsHtml
- Add SSRF protection to image proxy (block private IPs, require auth)
- Sanitize Content-Disposition filename to prevent header injection
- Escape Sieve script values to prevent script injection
- Escape IMAP search query to prevent search injection

Install/upgrade fixes:
- Move setupWebmail() call to after Dovecot is installed (was running
  before doveadm existed, silently failing on every fresh install)
- Make setupWebmail() a static method callable from install.py
- Fix upgrade idempotency: always run dovecot.conf patching and
  migrations even if webmail.conf already exists (partial failure recovery)

Frontend fixes:
- Fix search being a no-op (was ignoring results and just reloading)
- Fix loading spinner stuck forever on API errors (add errback)
- Fix unread count decrementing on already-read messages
- Fix draft auto-save timer leak when navigating away from compose
- Fix composeToContact missing signature and auto-save
- Fix null subject crash in reply/forward
- Clear stale data when switching accounts
- Fix attachment part_id mismatch between parser and downloader

Backend fixes:
- Fix Sieve _read_response infinite loop on connection drop
- Add login check to apiSaveDraft
2026-03-05 05:10:14 +05:00
usmannasir
6a61e294a9 Fix webmail account switcher and improve error handling
- Fix apiSSO() resetting selected account to first one on every call,
  now preserves previously selected account if still valid
- Fix webmail.conf ownership to use cyberpanel:cyberpanel (Django runs
  as cyberpanel user, not nobody)
- Add error notifications when SSO or folder loading fails
2026-03-05 05:01:45 +05:00
usmannasir
fd7960f790 Automate Dovecot master user setup for webmail SSO in install and upgrade
Adds master passdb config to dovecot.conf templates, setupWebmail() to
the installer and upgrade paths to generate credentials and create
/etc/dovecot/master-users and /etc/cyberpanel/webmail.conf automatically.
The upgrade path is idempotent and patches existing dovecot.conf if needed.
2026-03-05 03:39:00 +05:00
usmannasir
39baa9b05e Update cyberpanel_ols module hashes for SIGSEGV crash fix
Rebuilt module fixes NULL pointer dereference in apply_headers() when
OLS generates error responses (4xx/5xx). The get_req_var_by_id() call
for DOC_ROOT crashed because request variables aren't initialized
during error response generation. Fix adds status code guard to skip
header processing for error responses.
2026-03-04 16:46:21 +05:00
master3395
026460fbcb Install/upgrade and CPScripts: preserve all local changes
- cyberpanel_install_monolithic.sh, cyberpanel_upgrade_monolithic.sh
- install/ (install.py, venvsetup), install_modules/02_install_core.sh
- plogical/upgrade.py
- upgrade_modules/03_mariadb.sh, 05_repository.sh
- CPScripts: phpmyadmin_version_changer.sh, snappymail_version_changer.sh
- to-do/ (MARIADB-ROLLBACK-FROM-BACKUP.md)
2026-02-17 13:37:20 +01:00
master3395
a42e2ffab0 MariaDB: ensure client no-SSL (ssl=0, skip-ssl) on all installs - fix ERROR 2026 2026-02-17 00:00:28 +01:00
master3395
dbbcd945d2 Ban IP: close connections when already banned; install conntrack-tools on all OS
- firewallUtilities: add closeConnectionsFromIP() using conntrack -D -s IP
- addBannedIP: when IP already banned, close connections and return success message
- Frontend: always call API on Ban IP so backend can close connections; show server message
- Install: add conntrack-tools (RHEL) / conntrack (Debian/Ubuntu) to all install paths
  (rhel_deps, debian_deps, install_modules/01_verify_deps, install.py, venvsetup)
2026-02-16 19:54:37 +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
0ba2cf201d Fix phpMyAdmin for install/upgrade on v2.5.5-dev
- versionFetcher: normalize RELEASE_5_2_3 -> 5.2.3 for phpMyAdmin tags
- upgrade: verify tarball size after download; chown lscpd at end of phpMyAdmin install
- install: same glob-based extract + verify; check tarball size
- fix-phpmyadmin.sh: one-off script to install/fix phpMyAdmin on server (404 fix)
2026-02-15 03:27:33 +01:00
master3395
fc6639e211 Merge v2.4.4 updates: OLS v2.4.4 binaries, module config, Auto-SSL injection, OLS test suite
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 22:12:27 +01:00
usmannasir
050425c019 Update OLS binary hashes for SSL listener auto-map fix
rhel9:  418d2ea06e29c0f847a2e6cf01f7641d5fb72b65a04e27a8f6b3b54d673cc2df
ubuntu: 60edf815379c32705540ad4525ea6d07c0390cabca232b6be12376ee538f4b1b
rhel8:  d08512da7a77468c09d6161de858db60bcc29aed7ce0abf76dca1c72104dc485
2026-02-14 02:22:03 +05:00
usmannasir
78650a6d60 Update OLS binary hashes for SSL listener auto-map fix
New hashes for all 3 platforms after fixing the bug where VHosts with
SSL context but missing listener map entries served the wrong cert.

rhel9:  04921afbad94e7ee69bc93a73985e318df93f28b2b0d578447b0ef43dc6e3818
ubuntu: ae2564742f362d3e34ea814dff37edeb8f8b73ae9ca1484ba78e2453a3987429
rhel8:  855b6bccb4a7893914506a07185cffd834bd31a7f7c080b5b4190283def7fa3e
2026-02-14 01:18:18 +05:00
usmannasir
0c07293d1a Use regex for Auto-SSL config injection to handle any adminEmails value
The previous string replace only matched 'adminEmails               root@localhost'
exactly. On fresh OLS installs where adminEmails may have a different value
or different spacing, the replace would silently fail and Auto-SSL config
would never be injected. Use re.sub to match the adminEmails line regardless
of its value.
2026-02-14 00:43:30 +05:00
usmannasir
cedbbd27e8 Fix Auto-SSL config injection appending garbage to acmeEmail line
The string replace matched only 'adminEmails' keyword instead of the
full existing line 'adminEmails               root@localhost', causing
the remaining '               root@localhost' to trail onto the acmeEmail
line and break ACME account registration.
2026-02-14 00:16:34 +05:00
usmannasir
5e304f9481 Enable Auto-SSL injection during fresh install 2026-02-13 15:46:48 +04:00
usmannasir
aed1f29eb1 Update OLS binary hashes for Ubuntu/RHEL8 and enable Auto-SSL support 2026-02-13 14:47:22 +04:00
usmannasir
5f3b6253a9 Update OLS binary hashes for all 3 platforms (Plesk test verified) 2026-02-13 13:54:25 +04:00
usmannasir
9f244ffca8 Update RHEL 9 OLS binary hash after default VHost wildcard rebuild 2026-02-13 03:10:23 +05:00
usmannasir
fb31c7686c Update OLS binary hashes for Ubuntu and RHEL 8 (default VHost wildcard fix) 2026-02-13 02:59:08 +05:00
usmannasir
dfef3acaac Update OLS binary SHA256 hashes for rebuilt v2.4.4 binaries 2026-02-12 16:07:27 +05:00
usmannasir
7c35b292ad Update OLS binary URLs and hashes to v2.4.4
Universal binaries with all features config-driven (PHPConfig API, Origin
Header Forwarding, ReadApacheConf with Portmap, Auto-SSL ACME v2,
ModSecurity ABI compatibility). Updates install, upgrade, and modSec paths.
2026-02-12 14:08:29 +05:00
master3395
00dedf49d1 Install logs: show paths at start and on completion; dns-one path fix; shell/composer fixes; doc install log locations 2026-02-04 23:58:43 +01:00