Commit Graph

5597 Commits

Author SHA1 Message Date
master3395
5f9a55bbdb 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
b19e59b40f 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
09094adcb1 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
fb321340da 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
2176147772 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
e1d191c905 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
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
b23f09bf98 Merge pull request #1741 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-24 20:33:27 +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
master3395
836db0f378 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
d2fc85741b 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
Master3395
3e9567e565 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
d99982416d Subdomain fixes: creation (FQDN normalize), SSL (child webroot), CloudFlare delete (parent zone), acme-challenge dir 2026-03-14 23:51:51 +01:00
Master3395
3b9799ec59 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
master3395
9b038badec Database create: allow special chars in password, return real errors, safe SQL
- secMiddleware: allow dbPassword to bypass strict char check (stronger passwords)
- mysqlUtilities.createDatabase: return (0, error_message) on failure so UI shows real error instead of '0'
- mysqlUtilities.createDatabase: backtick-quote db name (fix 'near -admin' with hyphens), escape password and user for SQL
- submitDBCreation: pass through error message from createDatabase
- backupUtilities, Backupsv2, restoreMeta: treat createDatabase != 1 as failure (tuple return)
- patches/allow-dbpassword-special-chars.patch for secMiddleware deploy
2026-03-13 23:36:29 +01:00
Master3395
7f36e581b3 Merge pull request #1731 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-12 12:14:21 +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
8a9cc36aff Merge pull request #1725 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-07 02:52:07 +01:00
master3395
6eb28d6ec4 docs: remove hardcoded IP from 2FA guide (use your-server placeholder) 2026-03-07 02:47:55 +01:00
master3395
4be0bfd5aa 2FA/WebAuthn, user management, deploy and fix scripts
- loginSystem: WebAuthn (webauthn backend, models, urls, views), login template and webauthn.js
- baseTemplate: index.html updates
- docs: 2FA_AUTHENTICATION_GUIDE.md
- userManagment: createUser/modifyUser templates, userManagment.js, views, tests; check_modify_users_page.py
- requirments.txt: add webauthn>=2.0.0
- deploy-templates.sh: deploy templates/static to live CyberCP
- fix-cyberpanel-500.sh: script for common HTTP 500 login fixes (MariaDB, configservercsf, cache, restart)
2026-03-07 02:46:15 +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
55ba384174 Merge pull request #1724 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-06 21:14:43 +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
11d201747a Fix plugin installation: extract to plugin dir for any zip structure (install/upgrade/downgrade safe) 2026-03-06 20:17:48 +01:00
Master3395
9c556120ee Merge pull request #1723 from master3395/v2.5.5-dev
V2.5.5 dev
2026-03-06 20:08:43 +01:00
master3395
6c7143ae92 Remove to-do folder, docs/WINDOWS_INSTALLATION_GUIDE.md, docs/release_v2.5.5-dev.md 2026-03-06 20:07:44 +01:00
master3395
55d814a7dd Issue SSL tile + centered SSL form close (X) for v2.5.5-dev; install/upgrade/downgrade safe 2026-03-06 20:03:19 +01:00
Master3395
1afbfdea54 Merge pull request #1722 from master3395/v2.5.5-dev
Docker containers 500 fix, firewall banned IPs, container logs readab…
2026-03-06 19:07:12 +01: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
Master3395
6520ab721d Merge pull request #1714 from master3395/v2.5.5-dev
V2.5.5 dev
2026-02-26 21:10:27 +01:00
master3395
0de0733d37 fix(webterminal): use SSH port from sshd_config for custom SSH port (fixes #1713)
- Add get_ssh_port() to read Port from /etc/ssh/sshd_config
- Use 127.0.0.1 and port=SSH_PORT in asyncssh.connect()
- Web Terminal now works when SSH runs on non-22 port
2026-02-26 21:00:10 +01:00
master3395
0e8d077961 Fix vhost config Save button visibility on child domain page
Add fallback gradient and !important color for btn-primary when
--bg-gradient is undefined (e.g. dark mode/base theme), so the Save
button is always visible instead of appearing white/invisible.
2026-02-22 01:33:27 +01:00
master3395
f801edf86f Cloudflare: auto-enable proxy except mail-related subdomains
Expand mail-domain detection so proxy stays off for:
mail., smtp., imap., pop3., pop., autodiscover., webmail.
(and subdomains containing these). Other A/AAAA/CNAME get proxied by default.
2026-02-22 01:19:36 +01:00
master3395
fca759e8e9 Fix createNONSSLMapEntry: propagate real errors, case-insensitive listener match, detect missing Default block
- Return (success, error_msg) from createNONSSLMapEntry instead of 0/1
- Fix logging: use CyberCPLogFileWriter.writeToFile instead of writeToFile
- Match listener block case-insensitively (listener Default / listener default)
- Raise clear ValueError if Default listener block not found in httpd_config.conf
- Propagate actual error messages in createConfigInMainVirtualHostFile and createConfigInMainDomainHostFile
2026-02-22 01:13:45 +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
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
c2e474d724 Fix DNS + settings: CNAME skip in fixDNS, DB password from file
- dnsManager.fixDNSRecordsCloudFlare: track existing_types_by_name;
  skip adding A/AAAA when hostname has CNAME (A/AAAA cannot coexist
  with CNAME). Clearer docstring.
- dnsUtilities: comment tweak for proxy-capable record types.
- settings.py: read DB password from /etc/cyberpanel/mysqlPassword
  when present so panel stays in sync with CLI/install scripts.
2026-02-17 02:20:12 +01:00
master3395
28f9c6ceae Cloudflare DNS: allow AAAA proxying + harden addDeleteDNSRecordsCloudFlare
- dnsManager.py: include AAAA in record types that get proxied flag on
  update (was only A, CNAME); fix HTTP 500 by hardening loadCFKeys and
  addDeleteDNSRecordsCloudFlare (safe file read, always pass
  domainsList/cfEmail/cfToken to template).
- dnsUtilities.py: A, AAAA and CNAME can be proxied in Cloudflare;
  set proxied only for those types; MX, TXT, etc. cannot be proxied.
2026-02-17 02:16:22 +01:00
master3395
be0d8a84b1 Fix GetServerIPv6(): parse IPv6 with ipaddress, exclude only loopback/link-local
- Bug: filtering on '::1' in line incorrectly excluded addresses like
  2a02:c206:2238:7806::1, so fixDNS() never created AAAA records.
- Fix: use ipaddress.ip_address() and is_loopback/is_link_local so
  only actual loopback (::1) and link-local (fe80::) are excluded.
- GetServerIPv6() now returns correct global IPv6 for DNS AAAA records.
2026-02-17 02:15:17 +01:00
master3395
971ea6badc Fix DNS: add A/AAAA for all panel domains and subdomains (no duplicates) 2026-02-17 01:50:00 +01:00
master3395
90dab2caf1 DNS CloudFlare: delete confirmation, clear all, restore, export/import, orphan check
- Delete record: confirmation dialog and local backup before delete
- Clear all DNS records: double confirmation (zone name), local backup, Restore button
- Export/Import DNS records (JSON) for zone
- Check orphan DNS: find A/AAAA/CNAME for hostnames no longer in panel, remove with backup
- Backend: getExportRecordsCloudFlare, clearAllDNSRecordsCloudFlare, importDNSRecordsCloudFlare, getStaleDNSRecordsCloudFlare, removeStaleDNSRecordsCloudFlare
2026-02-17 01:43:01 +01:00
master3395
bb8454d3f0 Remove to-do folder 2026-02-17 01:01:34 +01:00
master3395
adc2de08b8 v2.5.5-dev: phpMyAdmin CSRF exempt, login error handling, phpMyAdmin install script
- urls.py: serve_phpmyadmin with @csrf_exempt for sign-in POST
- loginSystem/views.py: loadLoginPage error handling; friendly 503 on DB access denied
- csrfMiddleware.py: optional path-based CSRF exempt for /phpmyadmin/, /snappymail/
- fix-phpmyadmin-install.sh: install/fix phpMyAdmin under public/phpmyadmin (signin + config)
2026-02-17 00:57:19 +01:00
master3395
b1b790bf46 Add deploy script for Docker containers fix to live panel 2026-02-17 00:43:11 +01:00
master3395
5fcfd7906c Fix HTTP 500 on /docker/containers: add error handling and auto-migrate 2026-02-17 00:39:48 +01:00
master3395
8e12b6b91c Upgrade: run upgrade.py from correct cwd; add install/upgrade audit doc 2026-02-17 00:36:41 +01:00