mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-06 20:59:07 -05:00
[PR #1995] [MERGED] Fix: Display setup token after CrowdSec installation #4751
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/pangolin/pull/1995
Author: @Copilot
Created: 12/6/2025
Status: ✅ Merged
Merged: 12/6/2025
Merged by: @oschwartz10612
Base:
main← Head:copilot/fix-crowdsec-setup-token📝 Commits (3)
1aa155aInitial pland7311adAdd setup token printing after CrowdSec installation69561caFix setup token display condition to include CrowdSec installation📊 Changes
1 file changed (+1 additions, -1 deletions)
View changed files
📝
install/main.go(+1 -1)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
When CrowdSec is installed (either during initial installation or on an existing installation), the installer stops containers, reconfigures the stack, and restarts them. The setup token was not displayed after this restart, forcing users to tail logs manually.
Root Cause: The setup token printing section only executed when
!alreadyInstalledwas true, which excluded the case where CrowdSec is installed on an existing system.Solution: Updated the conditional check in
install/main.goto also run when CrowdSec is installed by checking theconfig.DoCrowdsecInstallflag.Changes Made
install/main.go: Modified the condition on line 245 fromif !alreadyInstalled {toif !alreadyInstalled || config.DoCrowdsecInstall {This ensures the existing setup token printing logic runs in both scenarios:
The fix leverages the existing infrastructure and
config.DoCrowdsecInstallflag that is set totruewhen CrowdSec installation is performed, ensuring users receive the setup token immediately after CrowdSec installation completes.How to test?
Test on fresh installation with CrowdSec:
Test on existing installation adding CrowdSec:
Build verification:
cd install && go build -o bin/installer_test .Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.