[PR #5880] [MERGED] [infrastructure] Add CrowdSec LAPI container to self-hosted setup script #28692

Closed
opened 2026-08-05 08:06:47 -04:00 by saavagebueno · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbirdio/netbird/pull/5880
Author: @lixmal
Created: 4/14/2026
Status: Merged
Merged: 4/16/2026
Merged by: @lixmal

Base: mainHead: crowdsec-selfhosted-setup


📝 Commits (2)

  • 49b24b9 Add CrowdSec LAPI container to self-hosted setup script
  • 6f845fb Update infrastructure_files/getting-started.sh

📊 Changes

1 file changed (+125 additions, -7 deletions)

View changed files

📝 infrastructure_files/getting-started.sh (+125 -7)

📄 Description

Describe your changes

Add optional CrowdSec IP reputation support to the self-hosted getting-started.sh script.

  • Prompt to enable CrowdSec when the proxy is enabled (built-in Traefik option)
  • Add CrowdSec LAPI container (pinned to v1.7.7) to docker-compose with healthcheck and depends_on
  • Wait for LAPI readiness, register a bouncer via cscli, and write the API URL/key to proxy.env
  • Print CrowdSec Console enrollment instructions at the end
  • Gracefully skip CrowdSec setup if the LAPI doesn't become ready or bouncer registration fails

Related PRs:

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 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/698

Summary by CodeRabbit

  • New Features

    • Optional CrowdSec IP reputation blocking during setup, enabled only when using the built‑in proxy and proxy is enabled.
    • Interactive prompt to enroll in CrowdSec and automatic storage of enrollment key when successful.
    • Built‑in proxy configuration now includes CrowdSec service and database when enabled; setup will skip CrowdSec if enrollment fails.
  • Chores

    • Cleanup process removes generated CrowdSec configuration directory.
  • Documentation

    • Post‑setup instructions include CrowdSec enrollment guidance.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbirdio/netbird/pull/5880 **Author:** [@lixmal](https://github.com/lixmal) **Created:** 4/14/2026 **Status:** ✅ Merged **Merged:** 4/16/2026 **Merged by:** [@lixmal](https://github.com/lixmal) **Base:** `main` ← **Head:** `crowdsec-selfhosted-setup` --- ### 📝 Commits (2) - [`49b24b9`](https://github.com/netbirdio/netbird/commit/49b24b978089a5f198606d440fd7f443a9c6af2d) Add CrowdSec LAPI container to self-hosted setup script - [`6f845fb`](https://github.com/netbirdio/netbird/commit/6f845fb84fbd7b42773bc7bd7c3e80746bdeaf62) Update infrastructure_files/getting-started.sh ### 📊 Changes **1 file changed** (+125 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `infrastructure_files/getting-started.sh` (+125 -7) </details> ### 📄 Description ## Describe your changes Add optional CrowdSec IP reputation support to the self-hosted getting-started.sh script. - Prompt to enable CrowdSec when the proxy is enabled (built-in Traefik option) - Add CrowdSec LAPI container (pinned to v1.7.7) to docker-compose with healthcheck and depends_on - Wait for LAPI readiness, register a bouncer via cscli, and write the API URL/key to proxy.env - Print CrowdSec Console enrollment instructions at the end - Gracefully skip CrowdSec setup if the LAPI doesn't become ready or bouncer registration fails Related PRs: - netbirdio/netbird#5722 (proxy CrowdSec integration) - netbirdio/dashboard#600 (dashboard UI) ## Stack <!-- branch-stack --> ### Checklist - [ ] Is it a bug fix - [ ] Is a typo/documentation fix - [x] 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](https://github.com/netbirdio/netbird/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT.md). ## Documentation Select exactly one: - [x] I added/updated documentation for this change - [ ] Documentation is **not needed** for this change (explain why) ### 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/698 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Optional CrowdSec IP reputation blocking during setup, enabled only when using the built‑in proxy and proxy is enabled. * Interactive prompt to enroll in CrowdSec and automatic storage of enrollment key when successful. * Built‑in proxy configuration now includes CrowdSec service and database when enabled; setup will skip CrowdSec if enrollment fails. * **Chores** * Cleanup process removes generated CrowdSec configuration directory. * **Documentation** * Post‑setup instructions include CrowdSec enrollment guidance. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
saavagebueno added the pull-request label 2026-08-05 08:06:47 -04:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: DYNR/netbird#28692