Commit Graph

765 Commits

Author SHA1 Message Date
6f1c36099b fix(web): adapt metric plots to policy-based resample config
The backend resample config changed from {trigger, resolutions[]} to a
policy/targetPoints model, but several components still spread
resampleConfig.resolutions, throwing "resolutions is not iterable" and
breaking the job list render. Default the initial resolution to null (the
backend resolves it from the configured policy; zoom overrides it) and
drop the now-obsolete resolution selector and admin display fields.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 27516ce259fd
2026-06-18 10:29:12 +02:00
ffbe171327 Merge branch 'main' into feature/526-average-resample 2026-06-18 07:17:41 +02:00
2b01b57495 feat: replace gorilla/sessions with alexedwards/scs/v2
Browser sessions are now server-side, stored in the SQLite database via
scs/sqlite3store (new `sessions` table, DB migration to version 12) instead
of gorilla/sessions client-side cookie storage. Only an opaque random token
is kept in the cookie; session data lives server-side and survives restarts.

Session middleware is wired as a hybrid to avoid buffering large responses:
scs.LoadAndSave on the login/logout write paths, and a non-buffering
read-only LoadSession middleware on the secured/config/frontend read paths
so the large GraphQL /query responses stream unbuffered. JWT-only APIs
(/api, /userapi, /api/metricstore) and static files are left unwrapped.

The session cookie Secure flag is now derived from the server config (set
when cc-backend terminates TLS itself); previously it was effectively never
set. The SESSION_KEY env var is removed as server-side tokens need no
signing secret. The dormant Bearer-JWT branch in the frontend urql client
is removed; the web UI authenticates GraphQL via the session cookie.

Closes #558

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: b51075f43cc7
2026-06-17 07:54:26 +02:00
5d8d4e228e Merge branch 'main' into feature/526-average-resample 2026-06-17 06:30:54 +02:00
16942f55a0 Fix medium-severity issues from follow-up security audit
Addresses the remaining medium findings from the second-pass audit:

- DoS hardening: bound GraphQL query cost with FixedComplexityLimit, and
  reject non-positive items-per-page / page values so uint64 conversion
  cannot underflow into an unbounded LIMIT/OFFSET. The -1 "load all"
  sentinel stays valid for dashboards; REST now returns 400 for bad input.

- Security headers: add X-Content-Type-Options, X-Frame-Options,
  Referrer-Policy and a conservative CSP (frame-ancestors/object-src/
  base-uri) that hardens against clickjacking and base-tag injection
  without restricting the self-hosted SPA's inline scripts.

- Stored XSS: render job.metaData.message as escaped text instead of
  {@html ...} in Job.root and JobFootprint, preserving line breaks via
  white-space: pre-wrap.

- SQL injection hardening: parameterize the tag-scope IN list and the
  manager project subquery in CountTags instead of interpolating
  user.Username / user.Projects (externally sourced via OIDC/LDAP).

- CSRF defense-in-depth: reject cross-site state-changing requests via
  Sec-Fetch-Site, failing open for non-browser clients, on top of the
  existing SameSite=Lax session cookie.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: de7d47a85c7c
2026-06-04 20:08:41 +02:00
Jan Eitzinger
0bc0f29f0a Merge pull request #551 from ClusterCockpit/release/v1.5
Release/v1.5
2026-05-31 07:59:06 +02:00
8bf5f67bb2 Update dependencies 2026-05-29 16:44:05 +02:00
6397f1eaae Merge branch 'release/v1.5' into feature/add_subcluster_filter 2026-04-24 11:55:28 +02:00
Christoph Kluge
4c59aee304 feat: add subCluster filter to filter component 2026-04-24 11:43:42 +02:00
86bc14b610 Merge branch 'main' into release/v1.5 2026-04-24 09:01:35 +02:00
Christoph Kluge
ac7865d597 fix: change to fixed legend coordinates instead of dynamic placement 2026-04-15 11:12:07 +02:00
e45b5f70e3 fix: Changes in frontend ui 2026-04-03 05:13:07 +02:00
3d99aec185 fix: Log viewer auto-refresh
Entire-Checkpoint: 0fc6e5388e08
2026-03-28 06:45:03 +01:00
b1884fda9d Prepare bug fix release 1.5.3
Entire-Checkpoint: 84d4ab77be71
2026-03-25 07:18:27 +01:00
Christoph Kluge
bd7125a52e review doubleranged filters, fix and improve valeu selection 2026-03-24 15:00:41 +01:00
Christoph Kluge
d5ea2b4cf5 change: query node states explicitly in node view 2026-03-23 17:23:54 +01:00
0c56591e4b Adopt config to use policy based resampler configuration
Entire-Checkpoint: 7536f551d548
2026-03-20 08:03:34 +01:00
0069c86e81 Replace explicit resampling config with policy based approach
Entire-Checkpoint: f69e38210bb1
2026-03-20 05:34:12 +01:00
Christoph Kluge
10b4fa5a06 change: remove heuristic metricHealth, replace with DB metricHealth
- add metricHealth to single Node view
2026-03-19 15:55:58 +01:00
Christoph Kluge
6cad2ee1f0 bump frontend dependencies, increase version to match release 2026-03-19 13:56:46 +01:00
Christoph Kluge
16ec1e69d9 streamline and unify statsSeries calc and render 2026-03-19 13:30:38 +01:00
Christoph Kluge
c42898bd99 fix: add top list query fixes to analysis and dashboard 2026-03-19 11:31:40 +01:00
Christoph Kluge
30b8ca4a1a further clarify plot titles 2026-03-19 10:45:55 +01:00
Christoph Kluge
bb6915771d fix: clarify title 2026-03-18 13:23:33 +01:00
df2a13def2 Merge branch 'hotfix' of github.com:ClusterCockpit/cc-backend into hotfix 2026-03-13 14:34:11 +01:00
d586fe4b43 Optimize usage dashboard: partial indexes, request cache, parallel histograms
- Add migration 14: partial covering indexes WHERE job_state='running'
  for user/project/subcluster groupings (tiny B-tree vs full table)
- Inline literal state value in BuildWhereClause so SQLite matches
  partial indexes instead of parameterized placeholders
- Add per-request statsGroupCache (sync.Once per filter+groupBy key)
  so identical grouped stats queries execute only once per GQL operation
- Parallelize 4 histogram queries in AddHistograms using errgroup
- Consolidate frontend from 6 GQL aliases to 2, sort+slice top-10
  client-side via $derived

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 5b26a6e5ff10
2026-03-13 14:31:37 +01:00
Christoph Kluge
bc214f6cea add nullsafes to frontend 2026-03-13 14:20:45 +01:00
cbe46c3524 Merge branch 'hotfix' of github.com:ClusterCockpit/cc-backend into hotfix 2026-03-13 13:17:34 +01:00
0037d969b2 Consolidate UsageDash into single GraphQL query
Merge three separate queries (topJobsQuery, topNodesQuery, topAccsQuery)
into one topStatsQuery with 6 aliased jobsStatistics fields, reducing
3 HTTP round trips to 1 on the status dashboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 40d806a3240c
2026-03-13 13:14:29 +01:00
Christoph Kluge
c23d7bd5e5 remove non-required sorting params
- caused expensive DB scans without use or need
2026-03-13 11:27:45 +01:00
Christoph Kluge
41114f7eda reorder frontend coded filters to match db indices 2026-03-13 10:48:38 +01:00
8e86e8720d Make stats query selective. Add stats index. Add paging to user list.
Entire-Checkpoint: d42431eee30d
2026-03-12 20:16:55 +01:00
Christoph Kluge
2d07bdf6b5 fix: add missing nullsafe in publicDash 2026-03-12 14:13:45 +01:00
Christoph Kluge
5c72664162 bump frontend patch versions 2026-03-10 18:15:24 +01:00
Christoph Kluge
f3e796f3f5 add nullsafes to node view 2026-03-10 17:05:50 +01:00
Christoph Kluge
d2bc046fc6 fix ranged filter GT and LT conditions, reduce energy filter preset 2026-03-09 11:28:30 +01:00
Christoph Kluge
88bd83b07e add nullsafe fallbacks 2026-03-06 10:19:46 +01:00
Christoph Kluge
d74465215d simplify and fix adaptive threshold logic 2026-03-06 10:09:44 +01:00
Christoph Kluge
2c519ab2dc bump frontend dependencies
- fixes CVE-2020-7660 in @rollup/plugin-terser
2026-03-05 12:23:00 +01:00
Christoph Kluge
db625239ea apply updated rangefilter logic to energy and stats 2026-03-04 14:18:30 +01:00
Christoph Kluge
84fda9c8e2 optimize resource filter by only using range query if required, review filter component 2026-03-03 19:08:16 +01:00
Christoph Kluge
f11ff3302d revert urql/svelte bump, bump svelte patch version, regenerate backend 2026-03-03 17:47:17 +01:00
Christoph Kluge
4e1b00a032 frontend dependency bump, includes @urql/svelte 5.0.0 2026-03-03 16:33:19 +01:00
Christoph Kluge
0a0db36433 load statusDetails GQL on tab change 2026-02-25 19:12:30 +01:00
Christoph Kluge
df3bc111a4 sort healthTable onMount 2026-02-25 13:23:44 +01:00
45a1bc78b7 Add csv export for user/prject list
Fixes #389
2026-02-24 20:26:12 +01:00
Christoph Kluge
ff180affd7 reintroduce state information for pie charts
- removed by oversight
2026-02-24 10:07:09 +01:00
dadcb983e7 Merge branch 'dev' into add_GetMemoryDomainsBySocket_2026 2026-02-23 18:47:03 +01:00
Christoph Kluge
31f3c28294 Remove schedState and metaData from metricHealth table 2026-02-23 13:26:06 +01:00
86fbecc679 Update frontend deps 2026-02-22 09:45:48 +01:00