Skip to content

fix: wait for CrowdSec to finish starting before reloading it - #1790

Merged
Wikid82 merged 15 commits into
developmentfrom
fix/crowdsec-wait-for-start
Oct 31, 2026
Merged

Wikid82 merged 15 commits into
developmentfrom
fix/crowdsec-wait-for-start

Conversation

@Wikid82

@Wikid82 Wikid82 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Summary

Makes CrowdSec start, reload and import checks wait for the engine instead of racing it.

  • Start no longer waits out its full timeout when the engine exits while starting; it answers 500 crowdsec_engine_exited, reverts the switch and shows a message in the UI.
  • Whitelist and hub changes made right after Start are applied by one reloader once CrowdSec has finished starting. A deferred reload is reported as reload_pending (shown as a passive "reload scheduled" note) instead of "reload required".
  • The Charon whitelist file stays in place while the engine runs (an empty list keeps a never-matching placeholder).
  • A configuration import is checked before it is used: config.yaml needs a config_paths section, and the engine's own -t check must accept it (skipped with a warning if the check cannot run, or when its output points at the environment: busy port or database, missing notification plugins). A failed whitelist regeneration after import now rolls back.
  • The engine is started with SIGHUP ignored until it is running; process identity recognises that wrapper form.

Commits

Eight commits plus the QA report: specs, process identity, engine-exit detection, reloader (with frontend), whitelist placeholder, import check, a plugin-aware skip for that check, docs, and review fold-ins.

Testing

  • Backend coverage 91.85% (gate 87%); frontend lines 91.10% (gate 85%); patch coverage 94.0%.
  • Targeted Playwright: import and first-enable (security-tests) 62/62, whitelist (firefox) 12/12.
  • Container gate in throwaway containers: whitelist add 0.1 to 3 s after Start (21/21 alive), occupied-port Start, concurrent Start/Stop, placeholder behaviour and a 45 s stress, import archives (export, stock layout, no config_paths, broken config_dir), SIGHUP pair, decision ban through a proxy host.
  • Not run: the hub-restore refusal case (needs hub access); CodeQL and Trivy run in CI.
  • Known flake: TestPerf_GetStatus_Parallel_AssertThreshold can miss its 5 ms threshold under full-package load; passes alone.

See docs/reports/qa_report.md.

@safedep

safedep Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

SafeDep Report Summary

Green Malicious Packages Badge Green Vulnerable Packages Badge Green Risky License Badge

Package Details
Package Malware Vulnerability Risky License Report
icon github.com/gin-contrib/gzip @ 1.2.9
backend/go.mod
ok icon
ok icon
ok icon
🔗
icon github.com/gin-contrib/sse @ 1.2.0
backend/go.mod
ok icon
ok icon
ok icon
🔗
icon github.com/pandatix/go-abnf @ 0.5.4
backend/go.mod
ok icon
ok icon
ok icon
🔗

View complete scan results →

This report is generated by SafeDep GitHub App

@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

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

✅ Supply Chain Verification Results

✅ PASSED

📦 SBOM Summary

  • Components: 1875

🔍 Vulnerability Scan

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

📎 Artifacts

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

Generated by Supply Chain Verification workflow • View Details

@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Wikid82 and others added 4 commits October 31, 2026 03:59
Bump gin-contrib/gzip to v1.2.9, gin-contrib/sse to v1.2.0, and
pandatix/go-abnf to v0.5.4.
Rebuilds the prebuilt Caddy/CrowdSec toolchain image so the shipped
binaries pick up upstream fixes, and bumps the digest pin in the
Dockerfile.
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