Skip to content

[self-hosted] Use cscli lapi status for CrowdSec readiness check in installer#5949

Merged
lixmal merged 1 commit intomainfrom
fix-crowdsec-installer-lapi-status
Apr 22, 2026
Merged

[self-hosted] Use cscli lapi status for CrowdSec readiness check in installer#5949
lixmal merged 1 commit intomainfrom
fix-crowdsec-installer-lapi-status

Conversation

@lixmal
Copy link
Copy Markdown
Collaborator

@lixmal lixmal commented Apr 21, 2026

Describe your changes

The installer's CrowdSec readiness loop gated bouncer registration on cscli capi status, which checks Central API (CAPI) connectivity. Bouncer registration is a purely local operation against LAPI, so a CAPI 403 (e.g. rate limit, misconfiguration) would cause the installer to skip CrowdSec setup unnecessarily. Switch the wait to cscli lapi status to match the container healthcheck.

Issue ticket number and link

Related: #5944

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

Docs on main already reference cscli lapi status (netbirdio/docs#709).

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Summary by CodeRabbit

  • Bug Fixes
    • Corrected the CrowdSec service health check validation during startup initialization to verify the appropriate API status endpoint, ensuring accurate service readiness detection.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 979dbad8-c146-4c75-bc32-7b619a3841a4

📥 Commits

Reviewing files that changed from the base of the PR and between 064ec1c and a07c254.

📒 Files selected for processing (1)
  • infrastructure_files/getting-started.sh

📝 Walkthrough

Walkthrough

The change modifies the CrowdSec readiness check in the getting-started.sh script, replacing the CAPI status command with an LAPI status command to verify CrowdSec availability during the Traefik initialization flow.

Changes

Cohort / File(s) Summary
CrowdSec Readiness Check
infrastructure_files/getting-started.sh
Modified the readiness polling command from crowdsec cscli capi status to crowdsec cscli lapi status within the retry loop in start_services_and_show_instructions(). All surrounding error handling and timeout behavior remains unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • jnfrati

Poem

🐰 A whisker-twitch, a status swap,
From CAPI's call to LAPI's map,
The CrowdSec guardian now stands tall,
With fresher checks, it catches all! 🛡️

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: switching CrowdSec readiness check from capi to lapi status in the self-hosted installer.
Description check ✅ Passed The description follows the required template structure with all major sections completed: changes description, issue link, stack, checklist (bug fix marked), and documentation decision with justification.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-crowdsec-installer-lapi-status

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@lixmal lixmal merged commit a822a33 into main Apr 22, 2026
44 of 46 checks passed
@lixmal lixmal deleted the fix-crowdsec-installer-lapi-status branch April 22, 2026 08:35
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