mirror of
https://github.com/Cacti/cacti.git
synced 2026-12-03 13:49:13 +09:00
bdfe930b6cde540ccf7b464d31df1d8b618c78fa
3676
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f1654dd8e2 |
Fix theme titlebar overflow, keyboard focus and text contrast across eight themes (#8712)
* Share theme contrast helpers across stacked accessibility fixes From #8484. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Fix Dark theme keyboard focus, wrapped titles, and hover contrast From #8488. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Fix Deepness title layout and status text contrast From #8492. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Sample intermediate gradient colors in theme contrast checks From #8494. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Fix Midwinter details controls and row-state text contrast From #8496. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Fix Modern keyboard focus, wrapped titles, and text contrast From #8503. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Fix Paw wrapped titlebars and row and tab contrast From #8505. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Fix Raspberry title overflow and text contrast From #8507. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Fix Sunrise title overflow and highlighted-option contrast From #8509. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Fix Paper Plane title layout and table contrast across surfaces From #8511. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(theme): keep the stacked theme spec blocks in stack order after rebasing Puts the text-contrast import with the other imports and the Midwinter suite back before the shared card suites from develop. No test was added or removed. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * chore(changelog): move the theme fix entries to changelog.d fragments develop now takes changelog fragments instead of CHANGELOG edits. This also drops the repeated #8480 and #8485 lines the stacked branches had added. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
0805aa1def |
fix(auth): [develop] bind Basic sessions to verified identities (#8537)
* fix(auth): bind Basic sessions to verified upstream identities Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(auth): use behavioral proxy identity coverage Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(auth): keep Basic guest sessions bound to their upstream identity An upstream-verified user with no realm 2 row is logged in as the guest account by auth_login.php. The identity check then found no user row on the next request, destroyed the session and re-ran auth_login.php, so every request ended in another login redirect. Record the Basic username in the session when auth_login.php establishes it, and treat a guest session as valid while that recorded name matches the current upstream identity and the guest account is still enabled. A different identity, or a realm 2 row created later, still replaces the session. Extend the Basic e2e test with a guest-account case on a guest page. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(auth): match session-user assignments, not comparisons, in the sweep The sweep that requires cacti_auth_transition() near every write of $_SESSION[SESS_USER_ID] matched '=' at the start of '===', so the guest session check in include/auth.php was reported as an uncovered write. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(auth): look up Basic sessions by the sanitized login name auth_login.php creates and resolves the realm 2 account from sanitize_search_string() of the upstream name, but the per-request check looked the row up with the raw name. A name that sanitization changes, such as o'brien, never matched its own row, so every request destroyed the session and ran auth_login.php again. Look the row up by the sanitized name and bind every Basic session, not only guest sessions, to the raw upstream name recorded at login, so a different upstream identity that maps to the same account still starts a new session. Also map $auth_basic_allow_php_auth_user into $config like $trusted_proxies, name the setting in the changelog fragment, and drop a doubled blank line in config.php.dist. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(phpstan): match the $config shape that includes the Basic opt-in Mapping $auth_basic_allow_php_auth_user into $config changed the array shape PHPStan prints for include/global.php, so two existing baseline entries stopped matching and repo-wide analysis reported them as new. Update the two messages to the new shape; no entry is added. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(auth): log the PHP_AUTH_USER opt-in when Basic login finds no identity An upgraded site whose web server only sets PHP_AUTH_USER now gets the "no username was passed" page, because that value is no longer trusted by default. Log a hint naming $auth_basic_allow_php_auth_user so the administrator can find the setting. The page text is unchanged and the client-supplied value is never logged. The Basic e2e test asserts the hint for a decoded client credential. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
88beec1974 |
fix(ui): close the graph menu and relabel Realtime instead of showing a spinner (#8758)
* fix(ui): close the graph menu and relabel Realtime instead of showing a spinner Clicking Realtime in the graph drilldown menu replaced the whole row with a spinner icon, discarding its label. Keep the row intact, close the menu, and flip the label between "Realtime" and "Stop Realtime" so the next click offers the opposite action. Stopping all realtime graphs from the filter bar restores the label too. closeGraphDrilldown() is hoisted out of initGraphDrilldown() so the Realtime click handler can close the menu. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(ui): keep realtime menu state and focus synchronized Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(i18n): encode realtime labels for JavaScript Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
14dc5eb7cc |
Add a preference for always-visible graph action icons (#8744)
* Add optional always-visible graph action icons * Close visible graph submenus with Escape after Safari mouse clicks * Document graph action display preference (#8744) * Fix refreshed graph action labels and submenu stacking * Refresh realtime action names and repair browser test setup |
||
|
|
c1e7c75752 |
chore(deps): ship pace.js 1.3.1 with the body-class fix (#8761)
package.json and package-lock.json already pin pace-js 1.3.1, but the committed include/js/pace.js was still the 1.2.4 build. Regenerate include/js/pace.js from 1.3.1. Upstream 1.3.1 now rejects the __proto__/constructor/prototype keys itself, so the sync-js transform no longer injects that guard (it would duplicate it) and instead fails the build if the upstream guard disappears. 1.3.1 still ships the empty-alternative body-class regex, so that fix is still applied. Update the sync_js test fixture and build/README.md, and drop the stale patches/pace-js+1.2.4.patch path filter from htmx-filters.yml (develop has no patches directory). Refs #8759 Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
cb2c788c44 |
fix(theme): match the language selectmenu to each theme's select2 controls (#8702)
The language dropdown (#user_language / #i18n_default_language) is the only
dropdown still rendered by jQuery UI selectmenu (the custom languageselect
widget); every other dropdown uses select2. Only the modern theme had a
dedicated .ui-selectmenu-button.ui-button rule, so in every other theme the
language dropdown fell back to the generic jquery-ui / .ui-selectmenu-button
styling and did not match its select2 controls - at runtime:
- .ui-corner-all { border-radius: 0 !important } squared the corners in
cacti, deepness, paper-plane, paw, raspberry and sunrise (0px) and
midwinter (4px)
- dark, paw and raspberry lost their select2 glass/highlight gradient
- paper-plane generic .ui-selectmenu-button !important rules forced a white
background and a #bbb border
Add a dedicated .ui-selectmenu-button.ui-button rule (closed + open state) to
cacti, dark, deepness, midwinter, paper-plane, paw, raspberry and sunrise that
mirrors each theme's .select2-selection--single (gradient/transparent
background, border, 6px radius and open-state colours), using !important only
where the theme's own !important rule requires it. modern already matched.
dark disables the global focus outline (*:focus { outline: none }), so the new
closed-state rule would drop the keyboard-focus indicator; add a :focus-visible
ring for dark, matching what the modern theme already does.
Add tests/e2e/tests/selectmenu-theme-coverage.js, a shared helper that
exercises the closed and open selectmenu button for every changed theme
(asserting the restored 6px radius) and the dark keyboard-focus ring. It is
registered from develop-theme-correctness.spec.ts (the chromium coverage job)
and filter-dialog-theme.spec.js (the changed-coverage job) so the changed CSS
lines get browser coverage in both gates. Record the change as a changelog.d
fragment.
Co-authored-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
||
|
|
6a8bb24ad0 |
fix(theme): [develop][regression #8227] dark message-dialog buttons and Modern language selectmenu (#8697) (#8699)
* fix(theme): [develop] dark message-dialog buttons and Modern language selectmenu (#8697) Dark: colour both session message dialog buttons via #btnSessionMessageOk and #btnSessionMessagePause with the #31442b primary-action/Go green (border rgba(0,0,0,0.35)) so Ok and Pause match the Go button (develop already scoped the filter dialog's action button to #31442b, but the message dialog was uncovered). Modern: the User Language 'languageselect' selectmenu rendered with the jquery-ui themeroller look when closed. Style .ui-selectmenu-button to match the select2 single-selection (#e6e6e6 glass + #aaaaaa border + 6px radius) with a select2-style triangle caret; the open menu list stays white. All changes are in main.css; jquery-ui.css is left untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(theme): restore keyboard focus for message buttons and language selectmenu, fix open-state specificity (#8697) Address review feedback: the Dark message-dialog buttons and the Modern language selectmenu overrode .ui-button:focus while both themes disable the global focus outline (*:focus { outline: none; }), leaving those controls with no visible keyboard focus. Add distinct :focus-visible rings. Also raise the Modern open-state selector specificity with .ui-button so it keeps winning over the :hover rule when the menu is opened by mouse. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(theme): style dark session message dialog via a class, not button IDs (#8697) Address review feedback from @somethingwithproof: Drop the per-button ID selectors (#btnSessionMessageOk / #btnSessionMessagePause) that styled the Dark session message dialog. ID specificity beat .ui-button:hover, so both buttons stayed flat and no longer reacted to hover or keyboard focus. layout.js now tags the dialog widget with a cactiSessionMessageDialog class and the Dark theme scopes the primary-action green (#31442b) plus the theme's own #155413 hover/focus feedback to that dialog, matching the theme palette. The focused button shifts to #155413 so keyboard users can tell Ok from Pause. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(theme): use the dark theme's jquery-ui.css button greens for the session dialog (#8697) Match the Dark session message dialog buttons (Ok/Pause) to the colours in the theme's own jquery-ui.css instead of a custom green: #155413 (the .ui-button hover/focus green) at rest and on hover/focus, darkening to #31442b (the .ui-button active green) on press. Still scoped via the cactiSessionMessageDialog class rather than per-button IDs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(theme): pale green at rest, deeper green on focus for dark session buttons (#8697) Correct the Dark session message dialog buttons (Ok/Pause) so the resting state uses the pale #31442b green and hover/keyboard focus deepens to the #155413 green (both from the theme's jquery-ui.css .ui-button palette). This restores a clearly distinct keyboard-focus appearance. Still scoped via the cactiSessionMessageDialog class rather than per-button IDs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
fb354dbf5e |
feature: add a shared dashboarding Card API (chrome + chart widgets) to core (#8683)
* feature: add a shared dashboarding Card API (chrome + chart widgets) to core (#8680) * feature: add a shared dashboarding Card API to core Ship the shared card chrome used by the dashboarding plugins as core assets: include/js/cards.js (the window.CactiCards controller) and include/css/cards.css (the themeable .cc* markup contract). Both are loaded by the common page header (lib/html.php) so any plugin or core page can render a draggable, reorderable grid of cards without bundling its own copy. The files are byte-identical to the copies currently vendored in the intropage and mactrack plugins; those plugins load the core copy on Cacti 1.2.32+ and fall back to their bundled copy on older cores. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(security): refresh the sink inventory baseline The tracked sink baseline had drifted against the current 1.2.x tree: many source files changed line numbers (and a few redirect sinks) since it was last regenerated, so the 'sink and architectural hotspot guard' failed for every PR branched off current 1.2.x. Regenerate it with tests/security/build_sink_inventory.sh. No new sinks are introduced by the Card API (cards.js/cards.css are not PHP and add no tracked sinks); this is a line-number/ordering resync of pre-existing entries. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(ui): harden the CactiCards controller per review feedback - dragReference: resolve the pointer row before comparing horizontal centres so dragging over a later card no longer snaps the insertion point to the start of the row - replaceCard: re-resolve the target by card id when the captured node was already swapped out, so overlapping refresh/resize responses no longer throw on a detached node (and resize still saves layout) - normalizeState: sync the documented data-expandable/data-expanded attributes with the .ccCardExpandable/.ccCardExpanded classes used for CSS clipping and serialize(), bridging the cards.css selector mismatch - dragstart: only enter reorder mode when the card itself is the armed drag source, ignoring native drags bubbling from body links/images - dragend: disarm card.draggable on every drag end since native DnD suppresses the mouseup cleanup path Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feature: add shared card-widget chart primitives to the Card API Extend the Card API with a small, JS-free chart-primitive library so any plugin - including third-party panels surfaced inside another plugin such as Intropage - can draw rich card bodies with no plugin-specific stylesheet or JavaScript: - include/css/card-widgets.css: the themeable .cc* primitives (semicircular gauge, usage/distribution bars, min/avg/max bullet, stacked proportion bar, stat tiles), coloured from currentColor and the shared --cc-sev-* properties. Loaded by the common page header alongside cards.css. - lib/html.php: card_gauge(), card_bar(), card_bullet(), card_stackbar() and card_stat() render helpers (plus card_severity()) that emit exactly that markup. Available wherever global.php is loaded (web and poller). These consolidate the near-identical gauge/bullet/bar/stack widgets currently duplicated across the hmib, apcupsd and mactrack dashboards. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix typo in comment about DOM behaviour * fix(ci): number and reorder CHANGELOG entries and inventory cards.js - Move the two Card API feature entries into the 1.3.0-dev feature block and number them (#8683) so .github/scripts/check-changelog.py accepts them (security->issue->feature ordering, traceable PR number). - Register include/js/cards.js in build/legacy-js.json applicationFiles so the JavaScript contracts library inventory recognises the new core script. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * test(cards): cover the card helper CSS and PHP for the changed-line gates - Add Playwright coverage fixtures to develop-theme-correctness.spec.ts that render every selector in include/css/cards.css and include/css/card-widgets.css (triggering the handle/tool hover and active states), so the develop theme correctness changed-CSS-line gate reaches 100 percent. - Add tests/fixtures/Core/CardWidgetMarkup.php, a changed-line coverage probe that loads card_severity/card_gauge/card_bar/card_stat/card_stackbar/card_bullet in isolation and exercises every branch; register it in run_pr_change_tests.sh. - Assign-then-return in card_gauge/card_stat/card_bullet (matching card_bar and card_stackbar) so Xdebug attributes the return to a covered line; no output change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(cards): harden refresh/resize ordering, async remove, and toggle focus Address review feedback on the CactiCards controller: - Share a per-card-id request generation between refreshCard and resizeCard (startRequest/requestSuperseded) and discard a superseded response before replacing markup, so a slow refresh can no longer revert a newer grow/shrink. - Await onRemoveCard: only drop the live card and persist the layout once the host Promise fulfils, leaving the card and saved layout intact on rejection (and re-resolving the node by id before removal). - Transfer keyboard focus to the revealed counterpart when expand/collapse is activated from the keyboard, since cards.css hides the activated button. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * feature(ui): add gauge ticks, bullet avg marker and pill severities to card-widgets Extend the shared Card API chart-widget library with .ccGaugeTick (gauge min/max ticks), .ccBulletAvgMarker (a dashed historical-average marker on the min/avg/max bullet) and .ccPill--up/--warn/--down/--none (status-pill severity colours), all themed from the existing --cc-sev-* custom properties. This lets converging plugin dashboards draw their richer card bodies from the shared .cc* contract. Mirrors the 1.2.x change in #8684. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(cards): skip adding a card id already on the grid Converge the controller: a second add of the same card can resolve while the first is still pending (the option stays selectable until the debounced catalogue sync), so skip ids already present to avoid appending a duplicate the server then dedupes. Brings the develop controller to the shared baseline that the 1.2.x PR and every plugin bundle now carry. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Darken Card API severity pills to meet WCAG 4.5:1 contrast The .ccPill--up/--warn/--down fallback backgrounds rendered 11px text at 3.51:1 (warn) to below the 4.5:1 WCAG AA threshold, and .ccPill--none used currentColor as a background that resolved to white (invisible on light themes). Mix each severity hue 70% with black for >=4.5:1 contrast with the white label, and give --none a translucent currentColor wash that inherits the theme foreground. Render the severity pill variants in the theme- correctness fixture so the changed .cc* rules satisfy the CSS-line gate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Preserve live card expand/collapse state across a Card API refresh replaceCard() now carries the live card's current expand/collapse state onto the fresh markup at swap time, so expanding or collapsing a card while its refresh (or resize) response is in flight is no longer reverted. Applies to the per-card refresh, resize and the plugins' Refresh-all paths, which all swap through replaceCard(). Adds an e2e test that drives the controller through a refresh landing mid-toggle, covering the changed line. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Only preserve a live card toggle when the user changed it mid-refresh Mirror the 1.2.x review fix (#8700): replaceCard() carries the live expand/ collapse state onto fresh markup only when the user toggled during the request (live differs from the state captured when the request started) and the fresh card is still expandable; direct callers with no captured state keep host markup authoritative (normalizeState contract). refreshCard() passes its captured state; resizeCard() captures it before onResize(). Adds a second e2e case asserting refreshed markup drives expansion when the user did not toggle. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
42a8591b78 |
fix(session): use SessionHandlerInterface object for DB session handler (PHP 8.4) (#8691)
* fix(session): use SessionHandlerInterface object for DB session handler As of PHP 8.4, passing individual callbacks to session_set_save_handler() is deprecated in favor of an object implementing SessionHandlerInterface. Wrap the existing cacti_db_session_* functions in a Cacti_DB_Session_Handler class and register that object so database-backed sessions no longer emit the deprecation warning. Minimum supported PHP is 8.2. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(session): return deleted session count from handler gc() Address review feedback: SessionHandlerInterface::gc() should report the number of sessions removed. Return db_affected_rows() after the cleanup delete instead of a hardcoded 0 so session_gc() reflects actual deletions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
edeaf135a1 |
fix(ui): use the three-bar action menu on the Details and Time View graph pages (#8641)
* fix(ui): use the three-bar action menu on the Details and Time View graph pages
The graph drilldown icons were switched to a hidden three-bar (hamburger)
action menu for the thumbnail/preview/tree graph areas, but the Details
(zoom) and Time View (utility) pages still rendered the raw glyph anchors.
Give those two areas the same graphDrillDownToggle treatment so the action
glyphs stay hidden behind the hamburger until it is activated, render the
drilldown container id through get_filter_request_var('local_graph_id'), and
move the Details graph title outside the toggle's positioning container
(matching html_graph_area() in lib/html.php) so a wide title no longer pushes
the hamburger off the graph corner.
Use the native Element.matches(':hover') in graphDrilldownStillHovered()
instead of jQuery's :hover: jQuery delegates :hover to Sizzle for a node
outside the document and throws "unsupported pseudo: hover" when a pending
close timer runs after the Details/Time View area reloads. A detached node
is treated as not hovered, so the native check cannot throw.
Add a coverage fixture that renders html_graph_single_view() and
html_graph_zoom() with their I/O stubbed and asserts the menu structure and
title placement, so the changed PHP output - not just handwritten browser
HTML - is exercised by the changed-line and request coverage gates.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* docs(changelog): add issue#8641 entry
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* security(html_graph): html-escape local_graph_id in drilldown container id
SonarCloud/Semgrep flag the raw get_filter_request_var(local_graph_id)
echoed into the drilldown container id attribute in html_graph_single_view()
and html_graph_zoom() as reflected XSS. The value is already int-validated,
but wrap it in htmle() so the request-to-response taint path is closed and
the scanners are satisfied.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
---------
Co-authored-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
||
|
|
1159552780 |
Fix Cacti theme titlebar wrapping and link contrast (#8481)
* Fix Cacti theme titlebar wrapping and link contrast Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * Add accessible headers to the theme fixture tables Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
08d16f894a |
fix(ui): only add the theme search filter icon when the filter input is visible (#8583)
The theme main.js files appended a search icon after any #filter/#filterd/#rfilter input whenever it existed in the DOM, even while it was hidden, leaving a stray icon on the page. Gate the decoration on the input being :visible, and defer it with setTimeout(0) so it runs after applySkin()/cactiReady() reveal #main and #navigation_right. The :visible check then skips only intentionally hidden filters, while ordinary filters -- including after AJAX refreshes -- still receive their icon, placeholder and autocomplete settings. Also make cacti_trusted_proxy_match() IP-family aware so an IPv4-mapped IPv6 address (::ffff:a.b.c.d) never matches a bare IPv4 proxy entry. Newer Symfony IpUtils releases normalize the mapped form inside checkIp(), which broke the native dependency test matrix; gating on IP family keeps the match deterministic. A coverage case keeps lib/client_address.php at 100%. Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
4e5b2852dc |
security: harden tokens, imports, script substitution and SpikeKill mutations (#8237)
* security(batch12): constant-time 2FA cookie and reset-token compares (GHSA-4qx8-jj2h-p7q2) auth_2fa.php used === to compare the 2FA bypass-cookie HMAC and auth_resetpassword.php used != for the reset-token check; both are byte-by-byte and leak timing. Switch to hash_equals() so the comparison is constant-time. Develop-only paths (no released 1.2.x equivalent). * security(batch12): route package-repo manifest fetches through cacti_http (GHSA-54fg-q9h9-88mm) package_repos.php fetched the package.manifest for the GitHub and Direct-URL (repo_type 0/2) repository types with raw file_get_contents() - the Direct-URL path additionally disabled SSL verification - which bypassed the hardened cacti_http() client and allowed SSRF (cloud metadata, internal host/port probing) plus MITM. Both paths now use cacti_http(), which restricts the scheme to http/https, blocks private/loopback/link-local targets, pins DNS to prevent rebinding, and verifies TLS. The GitHub Bearer token is passed via the headers option. Develop-only (package_repos.php does not exist in released 1.2.x). * security(batch12): shed matched quotes around resolved data-input tokens (GHSA-5v3j-wcrr-jxjg) Field values are escaped with cacti_escapeshellarg(), which wraps them in single quotes. When a Data Input template author placed the <field> placeholder inside a matched pair of quotes (e.g. "<arg1>"), those surrounding quotes made the value's own quoting literal, so $(...) or backticks in the value executed via the shell on the next poll - a realm-3 user reaching OS command execution, bypassing the CVE-2026-39902 hardening and not addressed by the single-pass fq9x fix. substitute_script_path() now consumes one matched pair of surrounding quotes when a token resolves, so the escaped value's own quoting is authoritative. Unresolved tokens keep their literal form (including any quotes), and the single-pass behaviour that fixed GHSA-fq9x is retained. Affects released 1.2.x (<= 1.2.31) and develop; this is the develop fix, to be backported to 1.2.x. * security(batch12): regression tests + CHANGELOG for batch-12 develop fixes Add tests/Unit/Security/Batch12SecurityRegressionTest.php guarding the batch-12 sinks (GHSA-4qx8, GHSA-54fg, GHSA-5v3j) with a behavioral proof that a double-quoted Data Input placeholder sheds its quotes, plus a confirmation test that poller_spikekill.php escapes --rrdfile (GHSA-vhh2, already fixed in #7235). List the four GHSAs in the CHANGELOG. * security(batch12): update batch-11 fq9x regression test for quote-aware substitute_script_path The GHSA-5v3j quote-shedding changed substitute_script_path()'s regex and capture group, which the batch-11 fq9x test pinned verbatim. Update those two assertions to the quote-aware pattern marker and $matches[2]; the single-pass guarantee the test covers is unchanged. * security(batch12): narrow reset-hash row with is_array for PHPStan L6 The hash_equals() guard left $hash inferred as non-empty-array|true, so $hash['user_id'] tripped PHPStan level 6. Guard with is_array() instead of a truthy check; db_fetch_row_prepared returns false for no row, so behavior is unchanged. * security(batch12): drop the executable bit on the new security test files * security(batch12): route import-time repo manifest fetches through cacti_http (GHSA-54fg) get_repo_file() still used raw file_get_contents() for the GitHub and Direct-URL repo types, bypassing the SSRF hardening added to form_save(). Route both remote branches through cacti_http() (scheme/host validation, private-range block, DNS pinning, TLS verify; Bearer token via the headers option) and add a regression assertion covering the import sink. * security(batch12): make substitute_script_path fully quote-aware (GHSA-5v3j) The matched-pair quote shed only neutralised a token the template wrapped exactly ("<arg1>"). A token embedded in a larger quoted word ("prefix<arg1>", "<arg1>suffix", "<a><b>") kept the outer double quotes, so backticks/$(...) in the already-escaped value stayed live - the bypass Copilot flagged. Replace the regex with a single-pass shell-quote-state scanner: it still sheds an exact wrapping pair, but for any token inside a larger quoted word it briefly closes the template's quoting around the escaped value so it cannot be re-interpreted. Values are never re-scanned (single-pass, GHSA-fq9x retained). Updates the batch-11/12 source assertions, adds prefix/suffix/mixed regression cases, and drops the Batch12 eval fallback (the unit bootstrap already loads lib/functions.php via include/global.php). * security(batch12): relocate batch-12 regressions into vuln-class subfolders Split tests/Unit/Security/Batch12SecurityRegressionTest.php into behavior-named files under the existing vulnerability-class layout, per the review feedback: Auth/TwoFaCookieAndResetTokenConstantTimeTest.php GHSA-4qx8 Ssrf/PackageRepoManifestFetchTest.php GHSA-54fg ShellInjection/DataInputQuotedPlaceholderTest.php GHSA-5v3j ShellInjection/SpikekillRrdfileEscapeTest.php GHSA-vhh2 Each file reaches the repo root via dirname(__DIR__, 4) for its one subfolder-deep location. No assertion changes; pure relocation. * security: preserve template quoting for raw path tokens in substitute_script_path Keep the develop fix in sync with the 1.2.x backport (#8238): substitute_script_path() only sheds/closes the template's quotes for self-quoting (cacti_escapeshellarg) values. Trusted raw path_* tokens are substituted in place so a quoted "<path_php_binary>" keeps its quotes for the shell and a bare <path_cacti>/scripts/x.php stays unquoted for the PHP script server, which resolves the first token as a filesystem path. Reformatted per php-cs-fixer and added a raw-path-token regression test. * security: keep substituting a token that follows a backslash in substitute_script_path Mirror the 1.2.x fix (#8238): the scanner's backslash branches consumed the next character unconditionally, so a legacy/custom template token such as \<arg> never reached the matcher and the trailing cleanup stripped it to a bare backslash. Both branches now only pair the backslash with a following quote/backslash (so an escaped quote still cannot toggle quote-state); any other character - notably a <token> start - leaves the backslash on its own and is processed on the next iteration. Reformatted per php-cs-fixer and added a backslash-before-token regression test. * security: normalize dangling backslash before substituted value in substitute_script_path (GHSA-5v3j) A template backslash immediately before a <field> token (\<arg1>) escaped the already-escaped value's opening quote, producing \'...' which the shell rejects with an unmatched-quote error (odd backslash runs) or prepended a stray literal backslash (even runs). The quote-aware scanner now sheds one backslash when the run immediately preceding a self-quoted value is odd, in both the unquoted in-place branch and the close-around branch, so the value's own quotes always function as the shell's quotes and $(...)/backticks inside it can never re-activate. The backslash regression test now executes each substituted template through /bin/sh (printf %s) and asserts a clean parse plus a literal round-trip across odd/even backslash counts, rather than pinning the generated string. * fix(security): preserve literal backslashes in quoted script fields Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(security): cover changed guards and gate PR coverage Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: measure committed PR changes on a policy-compliant runner Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * security: address review - nested cmd-sub/backtick handling, coverage gate, test skip substitute_script_path() now follows the template's own $(...) and backtick command substitutions as nested parsing contexts with their own quote state, so a token placed inside one ("$(printf %s <field>)") is judged against that fresh context instead of a suspended outer double quote. This closes the nested-reinterpretation bypass where an escaped value sitting inside a command substitution could be re-activated by an outer double quote. Backslash pairing in both the unquoted and double-quoted contexts now also neutralizes $ and backtick, so an escaped command substitution (\$(...) or \`...`) is not mis-detected as live. .github/workflows/pr-changed-coverage.yml: drop the hard-coded PR-number allowlist so the job runs whenever the path filter selects it, rather than silently skipping every unlisted PR once these merge. tests/Unit/Security/ShellInjection/ScriptFieldShellRoundTripTest.php: skip when either exec() or proc_open() is unavailable (the test launches the fixture with exec() while the fixture itself uses proc_open()). The fixture adds 7 nested command-substitution and backtick round-trip cases (90 -> 97), each proving the field value echoes back verbatim with nothing inside it executing. * fix(security): clear quote-empty flag on single-quote content; cover new parser branches The stack-based substitute_script_path() rewrite left quoteEmpty set while emitting literal content inside a single-quoted region, so a template like '\<field>' wrongly took the exact-wrap branch and dropped the backslash (ScriptSubstitutionMatrix 'shell 56'). Clear the frame's quoteEmpty whenever a single-quoted character is emitted, matching the pre-rewrite fallthrough. ScriptSubstitutionMatrix.php: add 8 explicit parser cases exercising the \/backtick nested contexts and escaped \$ / backtick pairing so every rewritten line is covered by the changed-coverage probe (1285 -> 1293). * style: short array syntax and php-cs-fixer formatting in substitute_script_path * test(security): tolerate formatting in spikekill escaping contract Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(spikekill): bind menu requests and protect mutations on develop Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(spikekill): validate real CSRF tokens and inline coverage Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci(coverage): install locked dependencies for Symfony CSRF probes Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * perf(spikekill): skip disabled float debug formatting Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(spikekill): enforce mutation scope and propagate RRD failures Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(spikekill): escape repair notes and cover window boundaries Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: remove unused SpikeKill preference binding Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(security): reject unsupported nested shell grammar in #8237 (#8359) * fix(security): reject unsupported nested shell grammar Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(security): exercise nested grammar rejection in CI coverage Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(security): reject script fields in backtick substitutions Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: retain native security fixture evidence in changed coverage Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(security): reject ambiguous shell expansion contexts Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(ssrf): assemble insecure manifest schemes at runtime The SSRF negative-test inputs in PackageManifestMatrix.php are rejected by the import preflight policy, but storing them as clear-text URL literals (http://, ftp://, file://) tripped SonarCloud php:S5332 and dropped the New Code security rating to B. Join the scheme separator at runtime so the fixture no longer carries clear-text literals while the assembled values keep the exact insecure schemes the policy must reject. All 32 manifest cases still pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(spikekill): drop dangling href in removeSpikes redirect check The CSRF POST rewrite of removeSpikes replaced the GET href builder but left checkForRedirects(data, href) referencing the now-undefined href, throwing ReferenceError once a POST completed. Call checkForRedirects(data) so a redirect response reloads (a POST has no GET href to follow). Update the merged dom_dynamic_boundaries boundary test to exercise the POST path: define csrfMagicToken and mock $.post instead of $.getJSON, so it still verifies DOMPurify sanitization of spike results. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: TheWitness <1439914+TheWitness@users.noreply.github.com> Co-authored-by: Thomas Vincent <thomasvincent@gmail.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
207d5eecd6 |
fix(ui): enforce dynamic DOM rendering boundaries (#8542)
* fix(ui): enforce dynamic DOM rendering boundaries Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(ui): run DOM boundary checks with browser dependencies Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci(ui): fail the browser job on either regression failure Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
63a53d511b |
fix: Make boost_redirect the default boost behavior (develop port of #8559) (#8561)
* fix: Make boost_redirect the default boost behavior
Port of the 1.2.x change (issue#8470) to develop. Boost redirection is now
permanent whenever boost is enabled, so the boost_redirect setting is removed
and the collector always stages poller output directly into
poller_output_boost.
- cmd.php: drop the boost_redirect guard; stage whenever boost_rrd_update_enable
is on.
- include/global_settings.php, settings.php: remove the boost_redirect setting
and its UI toggles.
- lib/snmpagent.php: always report the redirect object as enabled.
- poller.php, settings.php: stop force-setting boost_redirect for multi-poller
installs (boost_rrd_update_enable alone now implies redirection).
- lib/boost.php: boost_poller_on_demand() no longer stages inline; cmd.php owns
staging, so it only reports rows as already staged and never re-inserts.
Tests are updated to match the single, permanent-redirect pipeline: the
hand-off acknowledgement and consolidation contracts point at the surviving
cmd.php/poller_recovery.php call sites, and the PollerOutput probe drops the
now-dead redirect-off staging scenarios.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* test(coverage): cover the permanent Boost redirect in snmpagent
Add a request-coverage probe that exercises the permanent
boostApplRrdUpdateRedirect assignment in snmpagent_global_settings_update().
The statement lives in a MibCache-driven function that cannot run under the
unit/integration coverage driver without a live SNMP agent cache, so the
single changed line is compiled at its original line number and executed
against a minimal MibCache stand-in, with Xdebug coverage remapped to
lib/snmpagent.php. Register the probe so the changed-PHP coverage gate runs
it whenever lib/snmpagent.php changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* i18n:
* tests: Cover the cmd.php Boost flush guards for the changed-line gate
Making boost_redirect the default removed the boost_redirect half of the three poller flush conditions in cmd.php, leaving bare read_config_option(boost_rrd_update_enable) guards at lines 392, 501, and 537. Those statements live in cmd.php top-level poller loop, so the unit/integration driver includes them in the denominator but never executes them, dropping changed-line coverage to 3 of 6 (50 percent).
Adds a request-coverage probe that compiles each changed guard at its original line number and executes it against minimal read_config_option/boost_flush_output_batch stand-ins, mirroring the existing snmpagent redirect probe. Xdebug hits are remapped to cmd.php, raising changed-line coverage to 6 of 6 (100 percent). Registers the probe in run_request_coverage.sh so it runs whenever cmd.php changes.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
* fix(boost): keep the boost_redirect compatibility flag enabled
Port the poller.php compatibility assignment from the 1.2.x change
(#8559, commit
|
||
|
|
c6c37dfb5a |
deps(deps): bump chart.js from 2.9.4 to 4.6.1 (#8564)
* deps(deps): bump chart.js from 2.9.4 to 4.6.1 Bumps [chart.js](https://github.com/chartjs/Chart.js) from 2.9.4 to 4.6.1. - [Release notes](https://github.com/chartjs/Chart.js/releases) - [Commits](https://github.com/chartjs/Chart.js/compare/v2.9.4...v4.6.1) --- updated-dependencies: - dependency-name: chart.js dependency-version: 4.6.1 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * fix(build): sync chart.js 4.x UMD bundle chart.js 4.x no longer ships dist/Chart.js; its browser bundle is now dist/chart.umd.js, which auto-registers all controllers and exposes the global Chart like the 2.x build. Point sync-js at the new path and refresh the vendored include/js/Chart.js so postinstall and the JavaScript contract tests succeed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
8f4ac605b2 |
refactor(themes): remove the Carrot and Hollyberry themes (#8526)
* refactor(themes): remove the Carrot and Hollyberry themes Both were near-copies of the classic stylesheet kept as examples; the 1.3.0 upgrade prunes their directories and moves anyone who selected them to Modern instead of the alphabetical fallback. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs(changelog): add fragment for #8526 Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: cover retired theme cleanup and handle deleted coverage files Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
ff31e051dd |
fix(a11y): [develop] correct labels, document semantics and duplicate IDs (#8295)
* fix(a11y): [develop] correct labels, document semantics and duplicate IDs Associates form controls with their labels, replaces obsolete tt markup, removes duplicate element IDs, and adds a native accessibility browser suite with its database fixture. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(a11y): validate label IDs and recognize attribute escaping Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
ccf19b21aa |
fix(js): align dompurify contract test and vendored purify.js with 3.4.17 pin (#8472)
Commit 8471 bumped dompurify from 3.4.16 to 3.4.17 in package.json but left the JavaScript contract test and the vendored include/js/purify.js at 3.4.16, breaking the "JavaScript contracts" CI job on develop (test "DOMPurify is pinned and generated from the matching npm release"). - Update tests/js/sync_js.test.mjs to expect dompurify 3.4.17 in both the package.json pin assertion and the purify.js license-header match. - Regenerate include/js/purify.js and include/js/purify.js.map from the dompurify 3.4.17 npm release via build/sync-js.mjs (npm install postinstall). All 78 JavaScript contract tests pass locally. Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
a9c73cfc42 |
fix(themes): skin jQuery multiselect in Deepness and fix 3.x markup in four themes (develop) (#8443)
* fix(themes): skin jQuery multiselect in Deepness and the 3.x markup in four themes Deepness: main.css repainted select2 onto its --dp-* palette but never the jQuery multiselect button or popup menu, so those fell through to the jquery-ui.css textured surfaces and the generic uppercase button rule and looked like the Dark theme. Repaint them to match the select2 controls. Cacti, Carrot, Hollyberry, Raspberry: these themes ship the old 1.x jquery.multiselect.css while include/js/jquery.multiselect.js is 3.x, so optgroup menus showed list bullets, a nested indent, compounded 0.9em option text and an unstyled group label. Add the missing 3.x rules. All changes extend each theme's main.css; the stock jquery.multiselect.css files are left untouched. Reported in Cacti/plugin_flowview#298. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix(themes): satisfy the develop CHANGELOG and theme coverage gates - Move the CHANGELOG entries into changelog.d/8443.issue, as develop expects fragments rather than direct CHANGELOG edits. - Drop the Deepness multiselect border-radius; .ui-corner-all forces border-radius with !important in this theme, so it never applied. - Add Chromium computed-style tests for the new multiselect rules in Deepness, Cacti, Carrot, Hollyberry and Raspberry so the changed CSS lines are exercised by the theme correctness suite. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: TheWitness <copilot@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
b95226918e |
fix: Update the deepness favicon (#8419)
* fix: Update the deepness favicon (cherry picked from commit |
||
|
|
57ef1c5f77 |
featture: Add modern favicon images to develop (#8424)
This will improve the look of Cacti in the various browsers. |
||
|
|
c226f2a1a5 |
Add a right scrollbar gutter to the console content area in legacy themes (#8403)
.cactiConsoleContentArea scrolls vertically, and with no right padding the scrollbar sat flush against the right-aligned cells (for example the Data Source Info values on data_sources.php), hiding the last digits. Give it a 15px right gutter in every legacy theme (cacti, carrot, dark, deepness, hollyberry, modern, paper-plane, paw, raspberry, sunrise). midwinter already reserves a scrollbar gutter and is unchanged. Cover each changed rule with a develop-theme-correctness targeted test. |
||
|
|
b2ed6ec337 |
Legacy filter rendering: show only the classic inline filter (#8404)
The page_filter_format setting is meant to be either/or: Modern shows the Layouts selector with its Edit dialog, Legacy shows the classic inline filter. Legacy also rendered the Layouts selector row (and its JavaScript), so the new and the classic filters appeared together. Stop rendering the Layouts selector in Legacy mode: create_filter() no longer appends create_layouts(), and create_javascript() only emits the layouts script in modern mode. The now-unused create_layouts() and create_layouts_javascript() helpers are removed, and the setting help text is updated to say the Layouts selector is available in Modern only. |
||
|
|
5afe0f8f68 |
Add one-click RRDfile repair (Apply Suggested Fixes) to Data Source Info mode (#8401)
* Add one-click RRDfile repair to Data Source Info mode The Data Source Info mode already compares the RRDfile against the Cacti definition and prints the rrdtool tune recommendations (add a missing Data Source with DS:name:type:heartbeat:min:max, remove an extra one with DEL:name, and correct the type, heartbeat, minimum and maximum). It did not, however, offer a way to apply them from the page the way data_debug.php does. - Add an "Apply Suggested Fixes" link to the "RRDtool Tune Info" box header when the web server can write the RRDfile; when it cannot, the header falls back to "Run Fix from Command Line" and the commands remain listed for manual use. - Add a ds_repair action that runs the same tune recommendations server-side (gated on data_source_authorized() and on the RRDfile being writable, and skipping any recommendation carrying control characters), logs each command to DSDEBUG, then reloads the Data Source so the result is visible. This mirrors data_debug.php's run_repair / "Apply Suggested Fixes". - Harden the Info-mode guard so a missing/unreadable RRDfile (rrdtool info returning false) no longer triggers an array-offset warning. * Address review: POST-guard ds_repair and harden repair result check - Route the "Apply Suggested Fixes" action through a CSRF-protected POST: the link now uses the cactiPostAction handler (href="#", data-url) instead of a GET navigation, and ds_repair is added to the $bad_actions guard in include/global.php so a tokenless request fails closed with 405. ds_repair is added to the curated CSRF action test for regression coverage. - Use a strict comparison on the rrdtool_execute() result: it can return null on a failed exec/proxy connection, and null == '' would have reported a failed repair as "All RRDfile repairs succeeded." - Refresh the sink inventory baseline for the new header redirects in ds_repair. * Add request-coverage probe for the ds_repair RRDfile repair handler The Data Source Info mode repair handler ds_repair() is a POST action that the page-level e2e suites do not drive (it needs a Data Source whose RRDfile mismatches its Cacti definition). Add a request-coverage fixture that loads the handler in isolation via cacti_fixture_source_function(), stubs its I/O boundaries, and drives every branch (unauthorized, unreadable RRDfile, no RRA, nothing to tune, not writable, a control-character recommendation that is skipped, and both tune success and failure). Register it in run_request_coverage.sh for data_sources.php changes so the changed-line coverage gate sees the handler exercised. * Address review: use defined helpers and boolean repair result - Replace the undefined cacti_has_control_chars() check with a comparison against rrd_strip_control_chars() (loaded from lib/rrd.php) to skip any tune recommendation that carries control characters. - Execute each tune with RRDTOOL_OUTPUT_BOOLEAN and treat a strict true as success so proxy storage (which returns the raw 'OK u:...' status under RRDTOOL_OUTPUT_RETURN_STDERR) is not misreported as a failure. - Add the new translatable strings to locales/po/cacti.pot and reuse the existing failure msgid. - Update the request-coverage fixture to the new boundary contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
4e09327660 |
deepness: fix unreadable search-result highlight color (#8396)
* deepness: make search-result highlight readable and on-theme The .filteredValue search highlight set a neon yellow (#F8D93D) background with no text color, so the emerald link text (--dp-link) rendered on bright yellow was effectively unreadable and clashed with the dark emerald theme. Use a warm gold background that complements the emerald palette and a near-black (--dp-page) text color for high-contrast, readable matches. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * tests: cover deepness .filteredValue highlight computed styles Assert the deepness search-highlight background and text colors in the theme-correctness suite so the changed .filteredValue CSS lines are exercised and meet the changed-CSS coverage gate. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> |
||
|
|
5c1577a382 |
Force plugins.php action icons over POST and enlarge Tabler icons (#8394)
The install, enable, remote enable, load and dialog-confirmed actions on plugins.php are guarded by csrf_require_post() on the server. The anchors were still activated by the generic GET anchor handler, so clicking them returned a 405 on the develop branch. Submit these actions over POST: - The dialog Continue button and the Check Latest control now post. - A capture-phase document click listener intercepts the install, enable, remote enable and load icons before the bubble-phase generic handler, so they post, keep working after Ajax table refreshes, and bind only once. Tabler (i.ti) icons rendered smaller than the FontAwesome glyphs used on the 1.2.x branch, so give them an explicit 16px rule matching the fa layout in each bundled theme, and cover the new rule with develop-theme-correctness targeted tests. |
||
|
|
62063a29e0 |
fix(theme): [develop] correct CSS cascade, invalid values and responsive selectors (#8293)
* fix(themes): correct CSS cascade, font fallbacks and responsive selectors Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(themes): remove validated empty and redundant CSS rules Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * style(css): remove reviewed inactive rules and redundant separators Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * style(themes): consolidate two reviewed duplicate selectors Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(themes): remove identical whitespace declaration after consolidation Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(theme): keep context menu fallbacks in Cacti overrides Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(theme): measure native CSS and header coverage Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: retain bootstrap coverage and validate request dispatch Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: synchronize native coverage fixture dispatch Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: measure coverage at the exact PR revision Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: cover Midwinter and graph heading CSS repairs in Chromium Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: take the theme coverage base from the merge commit parent - github.event.pull_request.base.sha can predate the develop tip the checkout was merged onto, which counted develop's own CSS lines as the PR's. Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
37a44d793e | fix: Base js always included in default install (#8381) | ||
|
|
a5603c14ba | fix: Always have base files available at install (#8373) | ||
|
|
356f4ae813 |
fix(graphs): tree content reveal, filter dialog columns, single-column centering (#8365)
* fix(graphs): reveal graph content area after tree branch loads The jstree select_node handler hides .cactiGraphContentArea (#navigation_right) before loading a branch's graphs via AJAX to avoid flashing the previous branch, but the only re-show was coupled to a window resize event that does not fire after the AJAX load. On themes that hide .cactiGraphContentArea by default (e.g. Deepness) the content area stayed display:none and the graphs/filters were invisible. Re-show it on loadUrl completion. * fix(filter): keep the Edit Filter dialog columns from collapsing The modern filter Edit dialog is created with jQuery UI width:'auto'. Its body is a table-based label/field grid, which jQuery UI measures at min-content, collapsing the dialog content to a sliver and pushing the fields off to the right. Floor the content min-width so the columns lay out. Validated in Deepness and Dark. * fix(graphs): centre single-column graphs in the graph view graphWrapperOuter > div:first-child is width:fit-content inside a (full-width for one column) flex wrapper, so the graph rendered flush-left. Add auto horizontal margins so it centres; the absolutely-positioned drilldown toggle continues to track the graph. * fix(graphs): don't re-show content area on aborted branch load A superseding tree branch click aborts the in-flight loadUrl; its .always() must not re-show the content area the new selection just hid, or stale graphs flash while the new branch loads. Skip completions whose textStatus is 'abort'. |
||
|
|
4d11070ced |
feat: expose RRDtool 1.11 graph axis controls (#8356)
* feat: expose RRDtool 1.11 graph axis controls Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix: constrain axis template inheritance checkboxes Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(rrd): exercise native aggregate validation and enforce coverage Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: share changed-code coverage contracts and enforce shell policy Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(ci): run request coverage with portable path matching Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: retain bootstrap coverage and validate request dispatch Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: synchronize native coverage fixture dispatch Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: measure coverage at the exact PR revision Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
8acc5ec916 |
feature: theme-aware graph drilldown action menu (per-theme CSS palette) (#8355)
Label the open graph drilldown strip (layout.js labelGraphDrilldownIcons), shorten the action titles, and restyle the strip as a table menu. Each theme's main.css declares the --cacti-dd-* custom properties (foreground, hamburger/panel backgrounds, hairline border, hover accent) that include/css/graph_drilldown.css consumes via var() with a dark fallback, so each theme gets an appropriate light or dark look with its own accent and the hamburger reads correctly on light themes. Themes without a block (e.g. midwinter) use the dark fallback. Regenerates the affected locales/po/cacti.pot entries for the shortened titles. Co-authored-by: TheWitness <1439914+TheWitness@users.noreply.github.com> |
||
|
|
c749790d84 |
fix(security): [develop] require CSRF-protected POST for link and plugin reordering (#8278)
* security: require CSRF-protected POST for link and plugin reordering (#7454) Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(csrf): share POST and token guards for reorder actions Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
ce6ab6e0b3 |
fix(auth): [develop] preserve SAML POST callback sessions (#8333)
* fix(auth): preserve SAML POST callback sessions Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(auth): filter SAML inputs before bootstrap Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
5f72f1a03c |
fix(security): [develop] require protected POSTs for administrative mutation endpoints (#8331)
* fix(csrf): require POST for administrative mutation endpoints Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(csrf): support token-checking mutation helper Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
49c95bef63 |
fix(deps): track legacy browser assets and remove patch-package (#8330)
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
ac50e0e0d0 |
fix(csrf): restrict XHR tokens to same-origin requests (#8329)
Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
9a3a7dfce0 |
fix(graphs): [develop] correct opacity, redraw and realtime retries (#8328)
* fix(theme): enable graph opacity without selectmenu Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs(changelog): describe theme fix Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(graph): restore redraw URLs and retry realtime failures Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
6e5078c929 |
fix(theme): [develop] restore Midwinter navigation, search and filter controls (#8327)
* fix(theme): restore Midwinter navigation and kiosk controls Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs(changelog): describe theme fix Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(navigation): preserve filters and restore search and keyboard controls Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
f28071eb67 |
fix(theme): [develop] restore Midwinter login controls, form state and notifications (#8326)
* fix(theme): preserve Midwinter authentication controls Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs(changelog): describe theme fix Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(ui): preserve form state and notification lifecycles Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix: replace the blinking timer during skin setup Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
f39e74c65c |
Graph drilldown: keep hamburger fixed, icons reachable, hide on graph leave (#8315)
* Graph drilldown: keep hamburger fixed, icons reachable, hide on graph leave The action-icon strip now slides down below the hamburger (flex column) instead of the hamburger dropping to the bottom of the icons. Closing is driven by leaving the whole graph rather than the small icon strip, so the mouse can move from the hamburger onto the icons without the strip closing. Leaving the graph also blurs the hamburger so it no longer lingers after interacting with it. * changelog: graph drilldown interaction fixes (#8315) * Graph drilldown: tolerate tooltip-induced mouseleave, drop hamburger title A native tooltip appearing over a drilldown icon fires a spurious mouseleave on the graph (relatedTarget null), which closed the strip. Defer the close and re-check the graph is genuinely not hovered first, so the icon tooltips no longer destabilize it. Also drop the hamburger's redundant title (its aria-label stays). * Graph drilldown: widen the close grace period to 500ms * Graph drilldown: tie hamburger visibility to the graph image Reveal the hamburger while the pointer is over the graph image (or the toggle overlaid on it) rather than anywhere in the graph cell, so moving off the image hides it after the grace period. Entering a different graph now immediately hides and closes any other graph's open strip. * Graph drilldown: lift the open graph so its strip clears thumbnails below With thumbnails a short graph's open icon strip overflows onto the graph below; sibling graphs paint in DOM order, so that graph rendered on top of the strip, making the icons unclickable and stealing the hover (which closed the strip). Raise the open graph (.graphDrillActive, position:relative; z-index) so its overflowing strip stays on top and the graph beneath is not hovered. * Graph drilldown: reveal via :focus-visible and stop blurring to preserve keyboard focus * fix(ui): preserve graph action focus during pointer navigation Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(ui): cover graph drilldown interactions and gate PR coverage Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: measure committed PR changes on a policy-compliant runner Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> Co-authored-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
49e14c9785 |
Filter dialog: theme-aware close glyph, titlebar height matches table header, Deepness input theming (#8312)
* Filter dialog: theme-aware close glyph, titlebar height matches tableHeader, Deepness input theming - Replace the non-theme-aware inverted sprite close icon with a theme-coloured x glyph (color: inherit) across all 10 themes that style cactiFilterDialog. - Set the titlebar height/line-height to match each theme's cactiTableTitleRow height instead of 10px padding that made the dialog header taller than table headers. - Deepness: re-apply theme field colours to dialog inputs/selects/textareas with higher specificity so jQuery UI .ui-widget-content .ui-state-default no longer overrides them. * changelog: filter dialog theme consistency (#8312) * Filter dialog: theme select focus border; raspberry titlebar 28px to match table header box * test(ui): cover filter dialogs across all changed themes Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: measure committed PR changes on a policy-compliant runner Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> Co-authored-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
97e67c6777 |
security: harden browser rendering and review CodeQL boundaries (#8298)
* security: harden browser history and dependency option merging Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * docs: record CodeQL triage decisions and follow-up scope Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: wait for history reload before inspecting browser storage Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * security: isolate HTMX history from the legacy navigation handler Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * ci: build CodeQL assets through controlled dependency installs Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * security: render form validation messages as plain text Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: verify drag rows and color input security boundaries Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: verify tree navigation rename and datetime input boundaries Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * security: harden menu rendering and complete CodeQL caller review Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * security: centralize menu rendering and stabilize certificate CI Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test: align certificate expectation with parallel web PR Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> Co-authored-by: TheWitness <thewitness@cacti.net> |
||
|
|
08d0f94f24 |
Fix develop client behavior, popup isolation and PHP method visibility (#8292)
* fix(core): correct client state and declare public method contracts Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(security): isolate Midwinter external homepage popup Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(client): isolate menu state and simplify validated JavaScript guards Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(auth): use certificate expiry truth in rendering assertions Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * refactor(js): remove unused local storage while retaining initializer calls Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(js): encode inline translated values through the shared JSON boundary Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * style(js): wrap encoded translation literals without changing messages Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * fix(client): remove unused checkbox reads from graph resizing Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * refactor(client): declare repeated function locals once Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> * test(ui): run column width regression in browser CI Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> --------- Signed-off-by: Thomas Vincent <thomasvincent@gmail.com> |
||
|
|
d7ec67c4cf |
Persist table column widths across request actions (#8309)
* Persist table column widths across request actions Column widths are stored in localStorage keyed by the table id, but html_start_box() derives that id from the request action/report/tab, so a filter refresh (action change/go) reloads the same table under a different id and the saved widths are not restored. Emit a stable, action-independent data-colsizing key on each cactiTable and use it in saveTableWidths(), while keeping the DOM id unchanged. * changelog: 8309 table column width persistence * Column width persist: keep per-view key, normalize only filter-refresh actions The previous key dropped the action/report/tab entirely, so distinct table schemas at the same page+ordinal (e.g. support.php processes vs background tabs, utilities.php view_snmp_cache vs view_poller_cache) collapsed into one localStorage entry and applied widths from the wrong schema. Retain the stable logical-view discriminator (tab/report, or a non-transient action) in the data-colsizing key and normalize only the transient filter-refresh actions (go/change/clear/reset), so widths still survive a filter change but never cross unrelated schemas. * Use short array syntax for the colsizing normalization list (php-cs-fixer) |
||
|
|
e25a67c31f |
Common graph drilldown hamburger toggle across all themes (#8308)
* Graph drilldown: common hamburger toggle across all themes The graph action icons were revealed by hovering to the right of the graph, implemented per-theme (dark/midwinter/sunrise main.js) and always-on elsewhere. Hide the icons by default behind a small fa-bars hamburger overlaid on the graph's top-right. Clicking it opens the icon strip, which stays until a second click, leaving the strip, or an outside click. The behaviour is now centralized in include/layout.js (initGraphDrilldown) and include/css/graph_drilldown.css, and the per-theme hover JS is removed. * changelog: 8308 feature fragment * Graph drilldown: address review (a11y, positioning, spikekill, POT) - Anchor the toggle to the shrink-wrapped graph holder (width:fit-content) so the hamburger sits on the graph's top-right, not the full-width column edge. - Keep the hamburger focusable while visually hidden (opacity instead of display:none); reveal on hover, keyboard focus, open, and hover-less devices. - Expose aria-expanded on the toggle and update it in every open/close path; add aria-haspopup/aria-label. - Close any open SpikeKill submenu (spikeKillClose) when the strip closes or switches, matching the removed per-theme handlers. - Remove the now-duplicate Midwinter top-right ellipsis pseudo-element. - Add the new 'Graph Actions' msgid to locales/po/cacti.pot. |
||
|
|
533f3b5a04 |
Harmonize DateTimePicker styling with each theme palette (#8287)
* Harmonize DateTimePicker styling with each theme palette The jQuery UI datepicker and timepicker addon rendered with the stock ThemeRoller texture-image backgrounds and a generic gray/green look that did not match any theme (most visible in the deepness dark theme). Add per-theme, picker-scoped overrides to every theme's jquery.timepicker.css so the popup surface, header, weekday labels, day cells, selected/hover/today states, Now/Done buttons, and the time sliders use each theme's own accent and content colors. Rules are scoped to .ui-datepicker so other jQuery UI widgets are unaffected. * Address DateTimePicker a11y review (develop) - Reset the nav-icon filter on prev/next hover (cacti, paw, raspberry) so the dark jQuery UI sprite stays visible on the pale hover tint. - Give carrot and hollyberry a dark header title + dark nav icons so the month/year text clears AA on the light-ish accent header. - Carrot: move to the theme's darker orange (#d2691e) for the today outline and sliders, and use a dark foreground on the orange selected-day/button fills. - cacti and hollyberry: dark foreground on the accent selected-day/button fills to clear 4.5:1. - paper-plane and sunrise: invert the icon sprite to white so the arrows are visible on their dark headers. - dark and modern: add an explicit focus outline on the time-slider handles (both themes suppress the browser outline globally). - midwinter: rebuild the override on the theme palette variables so the picker follows dark/light mode, with the theme blue as a fixed AA accent. |
||
|
|
bfa3efb7a9 |
Add a jQuery rebind() helper and roll it out across the core UI (#8279)
* Add a jQuery rebind() helper and roll it out across the core UI Add $.fn.rebind(events[, selector], handler...) to include/layout.js as a shorthand for the common off(events).on(events, ...) re-attach idiom, then convert the matching chained calls across the core JavaScript and inline PHP handlers to use it. Only pairs whose off() and on() events (and delegated selector) match are converted; off() with no arguments is left as-is since it intentionally clears every handler. * changelog: add 8279.feature fragment * tests: update layout.js JS tests for the rebind() helper * tests: assert the cactiPostAction handler via rebind() * rebind: preserve the delegated selector for the two-argument event-map overload; add helper tests |
||
|
|
f54da33bef |
themes(deepness): harmonize all greens to the emerald palette (#8234)
* themes(deepness): harmonize all greens to the emerald palette * docs: changelog.d/8234.issue (deepness green harmonization) * themes(deepness): distinct active-state green + sync themeroller url Address review: give .ui-state-active a darker emerald (#083f2e) so persistent selection stays distinct from the #0c5f44 hover/focus state, and update the themeroller URL's hover/active colors and textures (flat) to match the de-olived declarations. |