Skip to content

fix: harden the CrowdSec import and restore, and finish the page translations - #1562

Merged
Wikid82 merged 13 commits into
developmentfrom
fix/crowdsec-followups-batch4
Oct 11, 2026
Merged

Wikid82 merged 13 commits into
developmentfrom
fix/crowdsec-followups-batch4

Conversation

@Wikid82

@Wikid82 Wikid82 commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-ups from the CrowdSec export/import work (#1561): safer imports, clearer restore errors, translations and test stability. 13 ordered commits; each builds and passes its own gate.

Not in this PR: #1551 (redacting notification values in exports) gets its own PR.

Verification

  • Backend coverage 91.4% statements / 90.4% lines; frontend 91.5% lines; patch coverage 91.6% (backend 92.0%, frontend 88.1%).
  • Full golangci-lint clean; go build, npm run build and type-check pass; go test -race -count=3 on the handlers package.
  • Local CodeQL: Go 4 results (all pre-existing suppressions, none in this diff), JS 0. Trivy: no high/critical.
  • Targeted E2E (--project=security-tests): import and diagnostics specs 72 passed, 0 skipped.
  • QA verdict PASS (one low finding, a stale test assertion, fixed). Report: docs/reports/qa_report.md.

Issues

Closing keywords only take effect on merge to main, so these stay open until the promotion.

Closes #1559, #1554, #1556, #1552, #1550, #1558, #1560

Claude Code helped produce this change.

…r layout in the import spec

The CrowdSec import and diagnostics specs now build archives with the
real config/ folder layout instead of a top-level config.yaml, and the
baseline carries acquis, profiles and simulation files. The export
assertions expect config/config.yaml exactly.

New pending specs cover refusing a top-level archive and keeping the
current files (including notification files) an archive omits; they
stay skipped until the matching behavior lands.
The CrowdSec import UI creates a real ~40MB application backup per import, which filled the 256M /app/data tmpfs across repeated runs. The two UI specs now delete the backups they create in afterAll (best effort), and the local tmpfs is raised to 512M as a backstop. Refs #1558.
…r CrowdSec reads

Importing an archive that keeps config.yaml at the top level into an
installation that reads its configuration from the config folder is now
refused with a clear message, and nothing is changed. Export a
configuration from the CrowdSec page, or put the files in a config/ folder
inside the archive.

A fresh installation without a config folder still accepts both layouts.
An archive whose config.yaml sits in some other folder (for example
parsers/config.yaml) is now reported as missing config.yaml right away.
…tain

An imported configuration archive that leaves out acquis.yaml, profiles.yaml,
simulation.yaml or the patterns folder no longer leaves CrowdSec unable to
start: the current copies are kept and listed in the import response
(kept_files). A file or folder the archive does provide always wins, and a
linked file or folder is never replaced.

When the kept profiles.yaml names a notification, the notification file that
defines it is brought back too. If it cannot be brought back without
replacing a file from the archive, the import is refused with a clear message
and nothing is changed.

The end-to-end specs for kept files are enabled, and the diagnostics specs now
expect the current acquis.yaml to be kept after a config-only import.
After an import, an inline note in the import card lists the current files that were kept because the archive did not contain them. Names are shown as plain text with control characters removed and length capped.

This inline note is new user-facing behaviour under a fix: subject on purpose: it belongs to the #1554 fix (the user must be told what was kept).

Also adds a test that a failed hub item restore with a partial response body shows the generic error and stays retryable.
…rt an unreadable install list

A restore now reports a hub item as not found only when cscli says it cannot find that exact item, instead of matching any output containing 'not found'.

If the list of installed items cannot be read again part-way through a restore, the restore answers with an error that still lists what was installed, and CrowdSec is reloaded so those installs take effect.
…st is cancelled

An import, export, file save, preset apply or hub restore that is queued behind another CrowdSec configuration change now gives up as soon as the browser request is cancelled, instead of waiting its turn and running anyway.
CrowdSec's live database, download cache, hub files and process file are now recognised however their names are capitalised, so an imported or restored archive can no longer replace or duplicate them by using different letter case.
Toasts, preset status lines, console enrollment errors and the loading overlay messages on the CrowdSec configuration page now follow the selected language. A test now fails if a new hard-coded message is added to the page.
Frontend tests now get a 15 second limit per test and hook, and two typing-heavy test files no longer simulate per-keystroke delays, so they stop failing on a busy machine.
…aviour

Explain the refused top-level archive, the kept companion and notification files, their known limits, and the clearer hub restore errors.
@github-advanced-security

Copy link
Copy Markdown
Contributor

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Supply Chain Verification Results

✅ PASSED

📦 SBOM Summary

  • Components: 1870

🔍 Vulnerability Scan

Severity Count
🔴 Critical 0
🟠 High 0
🟡 Medium 0
🟢 Low 0
Total 0

📎 Artifacts

  • SBOM (CycloneDX JSON) and Grype results available in workflow artifacts

Generated by Supply Chain Verification workflow • View Details

@codecov

codecov Bot commented Oct 11, 2026

Copy link
Copy Markdown

@Wikid82
Wikid82 marked this pull request as ready for review October 11, 2026 16:48
@Wikid82
Wikid82 merged commit cf06bd9 into development Oct 11, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants